BAEL-5242: Add surefire config for TestNG (#11471)

* BAEL-5242: Add surefire config for TestNG

* BAEL-5242: Configure surefire to run unit and integration tests
This commit is contained in:
kwoyke 2021-11-23 06:26:31 +01:00 committed by GitHub
parent ffacd9b9ae
commit 1ee2327ab3
3 changed files with 60 additions and 4 deletions

View File

@ -16,7 +16,6 @@
</parent> </parent>
<dependencies> <dependencies>
<!-- test scoped -->
<dependency> <dependency>
<groupId>org.testng</groupId> <groupId>org.testng</groupId>
<artifactId>testng</artifactId> <artifactId>testng</artifactId>
@ -41,8 +40,46 @@
</testResources> </testResources>
</build> </build>
<profiles>
<profile>
<id>default-second</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>src\test\resources\parametrized_testng.xml</suiteXmlFile>
<suiteXmlFile>src\test\resources\test_suite.xml</suiteXmlFile>
<suiteXmlFile>src\test\resources\test_unit.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>integration-lite-second</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>src\test\resources\test_group.xml</suiteXmlFile>
<suiteXmlFile>src\test\resources\test_setup.xml</suiteXmlFile>
<suiteXmlFile>src\test\resources\test_int.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<properties> <properties>
<!-- testing -->
<testng.version>7.1.0</testng.version> <testng.version>7.1.0</testng.version>
</properties> </properties>

View File

@ -0,0 +1,10 @@
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="int">
<test name="integration tests">
<classes>
<class name="com.baeldung.GroupIntegrationTest" />
<class name="com.baeldung.MultiThreadedIntegrationTest" />
<class name="com.baeldung.TimeOutIntegrationTest" />
</classes>
</test>
</suite>

View File

@ -0,0 +1,9 @@
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="unit">
<test name="unit tests">
<classes>
<class name="com.baeldung.DependentLongRunningUnitTest" />
<class name="com.baeldung.PriorityLongRunningUnitTest" />
</classes>
</test>
</suite>