Skip to content

Commit

Permalink
gplazma: Fix JVM implementation dependency in unit test
Browse files Browse the repository at this point in the history
The ListCommand outputs plugins in hash table order - this ordering is
implementation dependent, which in turn causes the
ListCommandTests.testDetailedList unit test to fail with some JVMs (eg Oracle
JDK 8).

Target: trunk
Request: 2.10
Request: 2.9
Request: 2.8
Request: 2.7
Request: 2.6
Require-notes: no
Require-book: no
Acked-by: Paul Millar <paul.millar@desy.de>
Patch: https://rb.dcache.org/r/7196/
(cherry picked from commit c0a68c5)
  • Loading branch information
gbehrmann committed Aug 19, 2014
1 parent 2f4bb9e commit fc19b7a
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.dcache.gplazma.loader.cli;

import com.google.common.collect.Ordering;

import java.io.PrintStream;

import org.dcache.gplazma.loader.PluginMetadata;
Expand Down Expand Up @@ -53,7 +55,7 @@ public void process( PluginMetadata plugin) {
boolean firstAlias = true;
StringBuilder sb = new StringBuilder();
sb.append( shortestName);
for( String name : plugin.getPluginNames()) {
for( String name : Ordering.natural().sortedCopy(plugin.getPluginNames())) {
if( name.equals( shortestName)) {
continue;
}
Expand Down Expand Up @@ -83,7 +85,7 @@ public void process( PluginMetadata plugin) {
StringBuilder sb = new StringBuilder();
sb.append( " Name: ");
boolean isFirstName = true;
for( String name : plugin.getPluginNames()) {
for( String name : Ordering.natural().sortedCopy(plugin.getPluginNames())) {
if( !isFirstName) {
sb.append( ",");
}
Expand Down

0 comments on commit fc19b7a

Please sign in to comment.