use of org.testng.xml.XmlTest in project intellij-community by JetBrains.
the class TestNGTreeHierarchyTest method doTest.
private static void doTest(XmlSuite suite, String expected) {
final StringBuffer buf = new StringBuffer();
final IDEATestNGRemoteListener listener = createListener(buf);
for (XmlTest test : suite.getTests()) {
for (XmlClass aClass : test.getClasses()) {
final String classFQName = aClass.getName();
for (XmlInclude include : aClass.getIncludedMethods()) {
final String methodName = include.getName();
List<Integer> numbers = include.getInvocationNumbers();
if (numbers.isEmpty()) {
numbers = Collections.singletonList(0);
}
for (Integer integer : numbers) {
final MockTestNGResult result = new MockTestNGResult(classFQName, methodName, null, new Object[] { integer });
listener.onTestStart(result);
listener.onTestFinished(result);
}
}
}
}
Assert.assertEquals("output: " + buf, expected, StringUtil.convertLineSeparators(buf.toString()));
}
Aggregations