Hi,
I have set up testng.xml to look through a package that has only one TestNG test in it. There are JUnit tests in the package and they are being picked up as well. I am running in 'mixed' mode and using CLASSFILESET to run the JUnit tests. I want to use XMLFILESET to run the TestNG tests so we can migrate gradually.
To try and get around this I've set up testng.xml to only include groups called "testng", of which 1 exists. I was expecting it to look through the package, find all the JUnit tests, check if they were included or not and then skip them because they're not included. Then run the 1 TestNG test. However, it is still including them all (and falling over when trying to run them).
I hope that makes sense, sample code below. Any help is much appreciated.
Foz
<?xml version="1.0" encoding="UTF-8"?>
<suite name="Suite" parallel="false" verbose="3">
<listeners>
<listener class-name="com.abc.xyz.SuiteListener" />
</listeners>
<groups>
<run>
<include name="testng" />
</run>
</groups>
<test name="BaseTest">
<packages>
<package name="com.abc.xyz.*" />
</packages>
</test> <!-- Base Test -->
</suite> <!-- Suite -->
This simple test exists in the package.
public class TestNGSimpleTest {
@BeforeClass
public void setUp() {
// code that will be invoked when this test is instantiated
System.out.println("Test instantiated");
}
@Test(groups = { "testng" })
public void aFastTest() {
System.out.println("Fast test");
}
@Test(groups = { "slow" })
public void aSlowTest() {
System.out.println("Slow test");
}
}