commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1557408 - /commons/proper/exec/trunk/src/test/java/org/apache/commons/exec/environment/EnvironmentUtilsTest.java
Date Sat, 11 Jan 2014 14:48:14 GMT
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);
     }
 



Mime
View raw message