You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2014/01/11 15:48:14 UTC

svn commit: r1557408 - /commons/proper/exec/trunk/src/test/java/org/apache/commons/exec/environment/EnvironmentUtilsTest.java

Author: sebb
Date: Sat Jan 11 14:48:13 2014
New Revision: 1557408

URL: http://svn.apache.org/r1557408
Log:
Hash ordering varies between JVMs

Modified:
    commons/proper/exec/trunk/src/test/java/org/apache/commons/exec/environment/EnvironmentUtilsTest.java

Modified: commons/proper/exec/trunk/src/test/java/org/apache/commons/exec/environment/EnvironmentUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/exec/trunk/src/test/java/org/apache/commons/exec/environment/EnvironmentUtilsTest.java?rev=1557408&r1=1557407&r2=1557408&view=diff
==============================================================================
--- commons/proper/exec/trunk/src/test/java/org/apache/commons/exec/environment/EnvironmentUtilsTest.java (original)
+++ commons/proper/exec/trunk/src/test/java/org/apache/commons/exec/environment/EnvironmentUtilsTest.java Sat Jan 11 14:48:13 2014
@@ -25,6 +25,7 @@ import static org.junit.Assert.assertNot
 import static org.junit.Assert.assertNull;
 
 import java.io.IOException;
+import java.util.Arrays;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Locale;
@@ -54,6 +55,9 @@ public class EnvironmentUtilsTest {
         env.put("foo", "bar");
         final String[] envStrings = EnvironmentUtils.toStrings(env);
         final String[] expected = new String[]{"foo2=bar2", "foo=bar"};
+        // ensure the result does not depend on the hash ordering
+        Arrays.sort(expected);
+        Arrays.sort(envStrings);
         assertArrayEquals(expected, envStrings);
     }