I've a scenario where I need to run some pre and post script(java classes) before and after integration test. I'm running integration test using maven-failsafe-plugin and want to use the pre-post functionality of same.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.0.0-M5</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
<configuration>
<includes>
<include>**/*IT.java</include>
</includes>
<testFailureIgnore>true</testFailureIgnore>
<parallel>classes</parallel>
<threadCount>${parallelCount}</threadCount>
<forkCount>${parallelCount}</forkCount>
<reuseForks>false</reuseForks>
<perCoreThreadCount>false</perCoreThreadCount>
</configuration>
</plugin>
I'm using https://github.com/temyers/cucumber-jvm-parallel-plugin to run tests in parallel, which generates multiple runner at runtime so cant use Junit's beforeAll/afterAll or beforeEach/afterEach as it will trigger pre/post script for each generated runner.
Can someone help or provide some guidance over the same? Thanks.
I guess you need to configure explicitly what exactly you need to run at each specific phase: