https://github.com/marschall/fork-join-junit-extensions
Allows to parallelize JUnit Tests using fork/join
https://github.com/marschall/fork-join-junit-extensions
Last synced: 3 months ago
JSON representation
Allows to parallelize JUnit Tests using fork/join
- Host: GitHub
- URL: https://github.com/marschall/fork-join-junit-extensions
- Owner: marschall
- Created: 2013-01-11T12:35:30.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2020-10-21T06:53:47.000Z (over 4 years ago)
- Last Synced: 2025-01-16T02:44:58.463Z (4 months ago)
- Language: Java
- Size: 19.5 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Fork/Join JUnit Extensions
==========================This project allows you to run JUnit tests in parallel using Java 7 [Fork/Join](http://www.oracle.com/technetwork/articles/java/fork-join-422606.html).
This complements [Maven Surefire Plugin](http://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#threadCount). Maven Surefire Plugin parallelizes at the class level and does not work in Eclipse or dynamically generated tests. This parallelizes tests in a class and works in Eclipse.
When you have lots of test classes where each runs quickly you want to use Maven Surefire Plugin. When you have few test classes that take a lot of time and have more than one test you want to use this.
Usage
-----```xml
com.github.marschall
fork-join-junit-extensions
0.1.0
test```
You have to run your tests with `ForkJoinSuite`.
```java
@RunWith(ForkJoinSuite.class)
public class MyTest {@Test
public void test1() {
// test code
}
// more tests methods}
```Customization
-------------With `@ForkJoinParameters` you can to set the actual runner to use (defaults to `JUnit4Builder`) and optionally the parallelism you want to have (defaults to number of CPUs).
```java
@RunWith(ForkJoinSuite.class)
@ForkJoinParameters(runnerBuilder = ParameterizedBuilder.class, parallelism = 2)
public class MyParameterizedTest {@Parameter
String parameter;@Test
public void test1() {
// test code
}
// more tests methods@Parameters
public static Collection parameters() {
// build parameters
}}
```