commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1004485 - /commons/proper/exec/trunk/src/test/java/org/apache/commons/exec/environment/EnvironmentUtilTest.java
Date Tue, 05 Oct 2010 00:38:10 GMT
Author: sebb
Date: Tue Oct  5 00:38:10 2010
New Revision: 1004485

URL: http://svn.apache.org/viewvc?rev=1004485&view=rev
Log:
More info if assertions fail

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

Modified: commons/proper/exec/trunk/src/test/java/org/apache/commons/exec/environment/EnvironmentUtilTest.java
URL: http://svn.apache.org/viewvc/commons/proper/exec/trunk/src/test/java/org/apache/commons/exec/environment/EnvironmentUtilTest.java?rev=1004485&r1=1004484&r2=1004485&view=diff
==============================================================================
--- commons/proper/exec/trunk/src/test/java/org/apache/commons/exec/environment/EnvironmentUtilTest.java
(original)
+++ commons/proper/exec/trunk/src/test/java/org/apache/commons/exec/environment/EnvironmentUtilTest.java
Tue Oct  5 00:38:10 2010
@@ -59,11 +59,11 @@ public class EnvironmentUtilTest extends
         Map procEnvironment = EnvironmentUtils.getProcEnvironment();
         // we assume that there is at least one environment variable
         // for this process, i.e. $JAVA_HOME
-        assertTrue(procEnvironment.size() > 0);
+        assertTrue("Expecting non-zero environment size", procEnvironment.size() > 0);
         String[] envArgs = EnvironmentUtils.toStrings(procEnvironment);
         for(int i=0; i<envArgs.length; i++) {
-            assertNotNull(envArgs[i]);
-            assertTrue(envArgs[i].length() > 0);
+            assertNotNull("Entry "+i+" should not be null",envArgs[i]);
+            assertTrue("Entry "+i+" should not be empty",envArgs[i].length() > 0);
             System.out.println(envArgs[i]);
         }
     }



Mime
View raw message