| CARVIEW |
|
parallel-junit
|
| Summary | Runs JUnit tests in parallel |
|---|---|
| Categories | None |
| License | Berkeley Software Distribution (BSD) License |
| Owner(s) | kohsuke |
A small library that lets you run JUnit tests in parallel.
How it works
This small library implements the org.kohsuke.junit.ParallelTestSuite class, which extends the junit.framework.TestSuite class. The ParallelTestSuite class enhances the base TestSuite class by running tests in parallel. Test objects registered to a ParallelTestSuite object run in parallel, allowing efficient test execution.
Because TestResult and TestListener aren't designed to run tests in parallel, this implementation coordinate the worker threads and reorder event callbacks so that the TestResult object receives them in an orderly manner. In addition, output to System.out and System.err are also serialized to avoid screen clutter.
Download
Download the jar file from here
Usage
Just instanciate a ParallelTestSuite instead of TestSuite as follows:
TestSuite suite = new ParallelTestSuite(); // add tests suite.addTest(...); ... // run the tests TestRunner.run(suite);
If you have three tests A,B, and C, and if you need to run A and B sequentially, then you can do this as follows:
TestSuite suite = new ParallelTestSuite(); TestSuite sub = new TestSuite(); sub.addTest(a); sub.addTest(b); suite.addTest(sub); // add (A,B) suite.addTest(c); // add C TestRunner.run(suite);
Have a happy testing life.
| Powered by CollabNet | Feedback |
FAQ |
Press |
Developer tools
© 1995 - 2007 CollabNet. CollabNet is a registered trademark of CollabNet, Inc. |
