Reviewers: fabbott,

Description:
JUnitShell currently prints the remote browser info only if there are
multiple remote browsers being tested.

Also, its hard to know which arguments were used on a failed test target
in the build file.

Fix:
====
I removed the check to see how many clients we have, and we now print
the number of remote browsers always.  I also fixed a bug where the
error message would contain "null" if the original error message was
null.

I also added the test.args to the fail message. Now, we can see the full
target and args used to run the test.

Please review this at http://gwt-code-reviews.appspot.com/93805

Affected files:
   common.ant.xml
   user/src/com/google/gwt/junit/JUnitShell.java


Index: common.ant.xml
===================================================================
--- common.ant.xml      (revision 6685)
+++ common.ant.xml      (working copy)
@@ -237,7 +237,9 @@
            <isset property="junit.failure"/>
          </and>
        </condition>
-      <fail message="One or more junit tests failed for target:  
@{test.name}" if="junit.stop.build" />
+      <fail
+          message="One or more junit tests failed for target: @{test.name}  
@{test.args}"
+          if="junit.stop.build" />
      </sequential>
    </macrodef>

Index: user/src/com/google/gwt/junit/JUnitShell.java
===================================================================
--- user/src/com/google/gwt/junit/JUnitShell.java       (revision 6685)
+++ user/src/com/google/gwt/junit/JUnitShell.java       (working copy)
@@ -941,20 +941,21 @@
      assert results != null;
      assert results.size() == numClients : results.size() + " != " +  
numClients;

-    boolean parallelTesting = numClients > 1;
-
      for (Entry<String, JUnitResult> entry : results.entrySet()) {
        String clientId = entry.getKey();
        JUnitResult result = entry.getValue();
        assert (result != null);
        Throwable exception = result.getException();
-      // In the case that we're running multiple clients at once, we need  
to
-      // let the user know the browser in which the failure happened
-      if (parallelTesting && exception != null) {
+
+      // Let the user know the browser in which the failure happened.
+      if (exception != null) {
          String msg = "Remote test failed at " + clientId;
          if (exception instanceof AssertionFailedError) {
-          AssertionFailedError newException = new AssertionFailedError(msg
-              + "\n" + exception.getMessage());
+          String oldMessage = exception.getMessage();
+          if (oldMessage != null) {
+            msg += "\n" + exception.getMessage();
+          }
+          AssertionFailedError newException = new  
AssertionFailedError(msg);
            newException.setStackTrace(exception.getStackTrace());
            newException.initCause(exception.getCause());
            exception = newException;



--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to