Fork/Join JUnit Extensions

JUnit Extensions that use fork/join for parallel test execution.

License

License

MIT
Categories

Categories

JUnit Unit Testing
GroupId

GroupId

com.github.marschall
ArtifactId

ArtifactId

fork-join-junit-extensions
Last Version

Last Version

0.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

Fork/Join JUnit Extensions
JUnit Extensions that use fork/join for parallel test execution.
Project URL

Project URL

https://github.com/marschall/fork-join-junit-extensions
Source Code Management

Source Code Management

https://github.com/marschall/fork-join-junit-extensions

Download fork-join-junit-extensions

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.marschall/fork-join-junit-extensions/ -->
<dependency>
    <groupId>com.github.marschall</groupId>
    <artifactId>fork-join-junit-extensions</artifactId>
    <version>0.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.marschall/fork-join-junit-extensions/
implementation 'com.github.marschall:fork-join-junit-extensions:0.1.0'
// https://jarcasting.com/artifacts/com.github.marschall/fork-join-junit-extensions/
implementation ("com.github.marschall:fork-join-junit-extensions:0.1.0")
'com.github.marschall:fork-join-junit-extensions:jar:0.1.0'
<dependency org="com.github.marschall" name="fork-join-junit-extensions" rev="0.1.0">
  <artifact name="fork-join-junit-extensions" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.marschall', module='fork-join-junit-extensions', version='0.1.0')
)
libraryDependencies += "com.github.marschall" % "fork-join-junit-extensions" % "0.1.0"
[com.github.marschall/fork-join-junit-extensions "0.1.0"]

Dependencies

compile (1)

Group / Artifact Type Version
junit : junit jar 4.11

Project Modules

There are no modules declared in this project.

Fork/Join JUnit Extensions

This project allows you to run JUnit tests in parallel using Java 7 Fork/Join.

This complements Maven Surefire Plugin. 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

<dependency>
    <groupId>com.github.marschall</groupId>
    <artifactId>fork-join-junit-extensions</artifactId>
    <version>0.1.0</version>
    <scope>test</scope>
</dependency>

You have to run your tests with ForkJoinSuite.

@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).

@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<Object[]> parameters() {
    // build parameters
  }

}

Versions

Version
0.1.0