harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r910685 - /harmony/enhanced/classlib/trunk/modules/instrument/src/test/java/org/apache/harmony/tests/java/lang/instrument/HelloWorldTest.java
Date Tue, 16 Feb 2010 20:52:44 GMT
Author: hindessm
Date: Tue Feb 16 20:52:43 2010
New Revision: 910685

URL: http://svn.apache.org/viewvc?rev=910685&view=rev
Log:
Capture output to help debug these tests.

Modified:
    harmony/enhanced/classlib/trunk/modules/instrument/src/test/java/org/apache/harmony/tests/java/lang/instrument/HelloWorldTest.java

Modified: harmony/enhanced/classlib/trunk/modules/instrument/src/test/java/org/apache/harmony/tests/java/lang/instrument/HelloWorldTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/instrument/src/test/java/org/apache/harmony/tests/java/lang/instrument/HelloWorldTest.java?rev=910685&r1=910684&r2=910685&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/instrument/src/test/java/org/apache/harmony/tests/java/lang/instrument/HelloWorldTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/instrument/src/test/java/org/apache/harmony/tests/java/lang/instrument/HelloWorldTest.java
Tue Feb 16 20:52:43 2010
@@ -53,7 +53,13 @@
 
         helper.run();
 
-        assertEquals(0, helper.getExitCode());
+        if (helper.getExitCode() != 0) {
+            System.out.println("std err:");
+            System.out.println(helper.getStdErr());
+            System.out.println("std out:");
+            System.out.println(helper.getStdOut());
+            fail("helper exit code was non-zero");
+        }
         assertEquals("Hello World" + LINE_SEPARATOR, helper.getStdOut());
         assertEquals("", helper.getStdErr());
     }
@@ -72,7 +78,13 @@
 
         helper.run();
 
-        assertEquals(0, helper.getExitCode());
+        if (helper.getExitCode() != 0) {
+            System.out.println("std err:");
+            System.out.println(helper.getStdErr());
+            System.out.println("std out:");
+            System.out.println(helper.getStdOut());
+            fail("helper exit code was non-zero");
+        }
         assertEquals("Hello World" + LINE_SEPARATOR, helper.getStdOut());
         assertEquals("", helper.getStdErr());
     }
@@ -91,8 +103,20 @@
 
         helper.run();
 
-        assertTrue(0 != helper.getExitCode());
-        assertTrue(helper.getStdErr().contains(
-                ClassNotFoundException.class.getName()));
-    }
+        if (helper.getExitCode() == 0) {
+            System.out.println("std err:");
+            System.out.println(helper.getStdErr());
+            System.out.println("std out:");
+            System.out.println(helper.getStdOut());
+            fail("helper exit code was zero");
+        }
+        if (!(helper.getStdErr().contains(
+                  ClassNotFoundException.class.getName()))) {
+            System.out.println("std err:");
+            System.out.println(helper.getStdErr());
+            System.out.println("std out:");
+            System.out.println(helper.getStdOut());
+            fail("helper should have thrown ClassNotFoundException");
+        }
+     }
 }



Mime
View raw message