db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From o..@apache.org
Subject svn commit: r832364 - /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/multi/StressMultiTest.java
Date Tue, 03 Nov 2009 09:43:30 GMT
Author: ole
Date: Tue Nov  3 09:43:30 2009
New Revision: 832364

URL: http://svn.apache.org/viewvc?rev=832364&view=rev
Log:
DERBY-4429 - Let StressMultiTest read Threads and Minutes to run as system property

Modified:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/multi/StressMultiTest.java

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/multi/StressMultiTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/multi/StressMultiTest.java?rev=832364&r1=832363&r2=832364&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/multi/StressMultiTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/multi/StressMultiTest.java
Tue Nov  3 09:43:30 2009
@@ -79,6 +79,8 @@
      */
     private static int MINUTES = 10;
     
+    private static final String THREADSMINUTES = "derby.tests.ThreadsMinutes";
+    
     /**
      * Force verbosity, used for debugging. Will print alot of information
      * to the screen. 
@@ -252,6 +254,24 @@
     public void setUp() throws Exception{
         super.setUp();
         this.getTestConfiguration().setVerbosity(DEBUG);
+        
+        // Let -Dderby.tests.ThreadsMinutes=TTxMM override.
+        String optThreadsMinutes = getSystemProperty(THREADSMINUTES);
+        if ( optThreadsMinutes != null )
+        { // Syntax: '99x22' meaning 99 threads 22 minutes.
+            int xPos = optThreadsMinutes.indexOf("x");
+            try{
+                // Assuming xPos >= 1 : substring or parseInt will catch it.
+                THREADS = Integer.parseInt(optThreadsMinutes.substring(0, xPos));
+                MINUTES = Integer.parseInt(optThreadsMinutes.substring(xPos+1, optThreadsMinutes.length()));
+            }
+            catch ( Exception e) {
+                alarm("Illegal value for '"+THREADSMINUTES+"': '"
+                        +optThreadsMinutes+"' - " +e.getMessage()
+                        +". Threads: " + THREADS +", minutes: " + MINUTES);
+            }
+            traceit("Threads: " + THREADS +", minutes: " + MINUTES);
+        }
     }
 
     /*



Mime
View raw message