You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by Apache Wiki <wi...@apache.org> on 2009/06/22 19:55:22 UTC
[Db-derby Wiki] Update of "DerbyJUnitTesting" by TiagoEspinha
Dear Wiki user,
You have subscribed to a wiki page or wiki category on "Db-derby Wiki" for change notification.
The following page has been changed by TiagoEspinha:
http://wiki.apache.org/db-derby/DerbyJUnitTesting
The comment on the change is:
Inserting the concurrent testing chapter
------------------------------------------------------------------------------
* Download the latest version of Xalan as described above.
* Wire the downloaded jar files into your CLASSPATH.
+ == Running concurrent JUnit tests ==
+ It currently is possible to run concurrent JUnit tests. This can be done for standalone tests or for whole suites of tests, including the all-encompassing suites.All. For this to be possible, the base port for the tests must be defined for each run.
+
+ To do so, the property '''''derby.tests.basePort''''' must be specified upon the execution of the test.
+
+ It needs to be noted that the full range from the specified port through to ''basePort+10'' '''MUST''' be free. Therefore, when running several tests make sure that the range [basePort;basePort+10] for all of the tests does not overlap.
+
+ Examples:
+ {{{
+ # The base port is 2230. Ports from 2230 through to 2240 (inclusive) will be used
+ java -Dderby.tests.basePort=2230 junit.textui.TestRunner org.apache.derbyTesting.functionTests.suites.All
+
+ # The base port is 2241. It does not overlap with the previous test.
+ java -Dderby.tests.basePort=2241 junit.textui.TestRunner org.apache.derbyTesting.functionTests.suites.All
+
+ }}}
+ '''OK!'''
+ ----
+ {{{
+ # The base port is 2230. Like above, ports through 2240 will be used
+ java -Dderby.tests.basePort=2230 junit.textui.TestRunner org.apache.derbyTesting.functionTests.suites.All
+
+ # The base port is 2235 and falls within the range [2230;2240]. Unexpected behavior might arise.
+ java -Dderby.tests.basePort=2235 junit.textui.TestRunner org.apache.derbyTesting.functionTests.suites.All
+
+ }}}
+ '''NOT OK!'''
+
+ The first example will work perfectly, but to be absolutely safe, the ranges would be farther apart.
== Switching the Derby harness over to JUnit ==