1

I have a few junit tests that take a long time to run. Is it possible to assign a thread to each test to run them concurrently? How would this be done?

VedantK
  • 9,728
  • 7
  • 66
  • 71
ABC123
  • 1,037
  • 2
  • 20
  • 44

1 Answers1

2

Yes, You can.

If you are using maven. You can take help of

maven-surefire-plugin

In Spring,

You can check this Link

<build>
    <plugins>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.7.1</version>
        <configuration>
            <parallel>classes</parallel>
            <threadCount>5</threadCount>
        </configuration>
    </plugin>
    </plugins>
</build>

Solution 2: Junit4 provides parallel feature using ParallelComputer

VedantK
  • 9,728
  • 7
  • 66
  • 71