Revision: 6661
Author: rj...@google.com
Date: Wed Nov  4 12:01:23 2009
Log: Merges tr...@6655 into releases/2.0
   Introduces JUnitShell argument -testMethodTimeout
   svn merge --ignore-ancestry -c 6655  
https://google-web-toolkit.googlecode.com/svn/trunk .


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

Modified:
  /releases/2.0/branch-info.txt
  /releases/2.0/user/src/com/google/gwt/junit/JUnitShell.java

=======================================
--- /releases/2.0/branch-info.txt       Wed Nov  4 11:35:50 2009
+++ /releases/2.0/branch-info.txt       Wed Nov  4 12:01:23 2009
@@ -274,3 +274,7 @@
  tr...@6653 was merged into this branch
    XMLElement owns parsing
    svn merge --ignore-ancestry -c 6653  
https://google-web-toolkit.googlecode.com/svn/trunk .
+
+tr...@6655 was merged into this branch
+  Introduces JUnitShell argument -testMethodTimeout
+  svn merge --ignore-ancestry -c 6655  
https://google-web-toolkit.googlecode.com/svn/trunk .
=======================================
--- /releases/2.0/user/src/com/google/gwt/junit/JUnitShell.java Wed Nov  4  
08:46:30 2009
+++ /releases/2.0/user/src/com/google/gwt/junit/JUnitShell.java Wed Nov  4  
12:01:23 2009
@@ -41,6 +41,7 @@
  import com.google.gwt.junit.client.impl.JUnitResult;
  import com.google.gwt.junit.client.impl.JUnitHost.TestInfo;
  import com.google.gwt.util.tools.ArgHandlerFlag;
+import com.google.gwt.util.tools.ArgHandlerInt;
  import com.google.gwt.util.tools.ArgHandlerString;

  import junit.framework.AssertionFailedError;
@@ -106,7 +107,6 @@
      void processResult(TestCase testCase, JUnitResult result);
    }

-  @SuppressWarnings("deprecation")
    class ArgProcessor extends GWTShell.ArgProcessor {

      public ArgProcessor() {
@@ -179,6 +179,38 @@
          }
        });

+      registerHandler(new ArgHandlerInt() {
+        @Override
+        public String[] getDefaultArgs() {
+          return new String[] {getTag(), "5"};
+        }
+
+        @Override
+        public String getPurpose() {
+          return "Set the test method timeout, in minutes";
+        }
+
+        @Override
+        public String getTag() {
+          return "-testMethodTimeout";
+        }
+
+        @Override
+        public String[] getTagArgs() {
+          return new String[] {"minutes"};
+        }
+
+        @Override
+        public boolean isUndocumented() {
+          return false;
+        }
+
+        @Override
+        public void setInt(int minutes) {
+          baseTestMethodTimeoutMillis = minutes * 60 * 1000;
+        }
+      });
+
        registerHandler(new ArgHandlerString() {
          @Override
          public String getPurpose() {
@@ -359,13 +391,6 @@
     */
    private static final String PROP_GWT_ARGS = "gwt.args";

-  /**
-   * The amount of time to wait for all clients to complete a single test
-   * method, in milliseconds, measured from when the <i>last</i> client  
connects
-   * (and thus starts the test). default of 5 minutes.
-   */
-  private static final long TEST_METHOD_TIMEOUT_MILLIS = 5 * 60 * 1000;
-
    /**
     * Singleton object for hosting unit tests. All test case instances  
executed
     * by the TestRunner will use the single unitTestShell.
@@ -563,9 +588,16 @@
    private BatchingStrategy batchingStrategy = new NoBatchingStrategy();

    /**
-   * Timeout in presence of batching. reassigned later.
+   * The amount of time to wait for all clients to complete a single test
+   * method, in milliseconds, measured from when the <i>last</i> client  
connects
+   * (and thus starts the test). Set by the -testMethodTimeout argument.
     */
-  private long testBatchingMethodTimeoutMillis =  
TEST_METHOD_TIMEOUT_MILLIS;
+  private long baseTestMethodTimeoutMillis;
+
+  /**
+   * Test method timeout as modified by the batching strategy.
+   */
+  private long testBatchingMethodTimeoutMillis;

    /**
     * Determines how modules are compiled.
@@ -953,7 +985,7 @@
        throws UnableToCompleteException {

      testBatchingMethodTimeoutMillis =  
batchingStrategy.getTimeoutMultiplier()
-        * TEST_METHOD_TIMEOUT_MILLIS;
+        * baseTestMethodTimeoutMillis;
      if (mustNotExecuteTest(getBannedPlatforms(testCase.getClass(),
          testCase.getName()))) {
        return;

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

Reply via email to