Revision: 6250
Author: j...@google.com
Date: Tue Sep 29 13:48:12 2009
Log: Fix lack of propagating numClients back to JUnitShell when the  
RunStyles
process their arguments.

Patch by: jat
Review by: fabbott (desk)

http://code.google.com/p/google-web-toolkit/source/detail?r=6250

Modified:
  /branches/farewellSwt/user/src/com/google/gwt/junit/JUnitShell.java
  /branches/farewellSwt/user/src/com/google/gwt/junit/RunStyleManual.java
  /branches/farewellSwt/user/src/com/google/gwt/junit/RunStyleRemoteWeb.java
  /branches/farewellSwt/user/src/com/google/gwt/junit/RunStyleSelenium.java

=======================================
--- /branches/farewellSwt/user/src/com/google/gwt/junit/JUnitShell.java Tue  
Sep 29 11:27:01 2009
+++ /branches/farewellSwt/user/src/com/google/gwt/junit/JUnitShell.java Tue  
Sep 29 13:48:12 2009
@@ -743,7 +743,11 @@
      }

      long currentTimeMillis = System.currentTimeMillis();
-    if (activeClients == numClients) {
+    if (activeClients >= numClients) {
+      if (activeClients > numClients) {
+        getTopLogger().log(TreeLogger.WARN, "Too many clients: expected "
+            + numClients + ", found " + activeClients);
+      }
        firstLaunch = false;

        /*
@@ -816,6 +820,17 @@
        compileForWebMode(moduleName, userAgents);
      }
    }
+
+  /**
+   * Set the expected number of clients.
+   *
+   * <p>Should only be called by RunStyle subtypes.
+   *
+   * @param numClients
+   */
+  void setNumClients(int numClients) {
+    this.numClients = numClients;
+  }

    /**
     * Finish processing command line arguments.
=======================================
--- /branches/farewellSwt/user/src/com/google/gwt/junit/RunStyleManual.java     
 
Sun Sep 20 12:33:31 2009
+++ /branches/farewellSwt/user/src/com/google/gwt/junit/RunStyleManual.java     
 
Tue Sep 29 13:48:12 2009
@@ -40,6 +40,7 @@
              e);
        }
      }
+    shell.setNumClients(numClients);
      return true;
    }

=======================================
---  
/branches/farewellSwt/user/src/com/google/gwt/junit/RunStyleRemoteWeb.java      
 
Tue Sep 29 11:27:01 2009
+++  
/branches/farewellSwt/user/src/com/google/gwt/junit/RunStyleRemoteWeb.java      
 
Tue Sep 29 13:48:12 2009
@@ -179,6 +179,7 @@
        }
      });
      int numClients = urls.length;
+    shell.setNumClients(numClients);
      BrowserManager[] browserManagers = new BrowserManager[numClients];
      for (int i = 0; i < numClients; ++i) {
        long callStart = System.currentTimeMillis();
=======================================
---  
/branches/farewellSwt/user/src/com/google/gwt/junit/RunStyleSelenium.java       
 
Tue Sep 29 11:27:01 2009
+++  
/branches/farewellSwt/user/src/com/google/gwt/junit/RunStyleSelenium.java       
 
Tue Sep 29 13:48:12 2009
@@ -108,6 +108,7 @@
      }

      this.remotes = targets;
+    shell.setNumClients(targets.length);

      // Install a shutdown hook that will close all of our outstanding  
Selenium
      // sessions.

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

Reply via email to