Skip to content

Instantly share code, notes, and snippets.

@krmahadevan
Created June 13, 2017 12:55
Show Gist options
  • Save krmahadevan/fa7ab905b09f84206d7c4af0c10e9d8c to your computer and use it in GitHub Desktop.
Save krmahadevan/fa7ab905b09f84206d7c4af0c10e9d8c to your computer and use it in GitHub Desktop.
...
... TestNG 6.11 by Cédric Beust ([email protected])
...
Executing : com.rationaleemotions.stackoverflow.qn44518748.SampleClassOne.testMethodA() on thread [ 11]
Executing : com.rationaleemotions.stackoverflow.qn44518748.SampleClassTwo.testMethodA() on thread [ 11]
Executing : com.rationaleemotions.stackoverflow.qn44518748.SampleClassOne.testMethodB() on thread [ 11]
Executing : com.rationaleemotions.stackoverflow.qn44518748.SampleClassTwo.testMethodB() on thread [ 11]
Executing : com.rationaleemotions.stackoverflow.qn44518748.SampleClassOne.testMethodC() on thread [ 11]
Executing : com.rationaleemotions.stackoverflow.qn44518748.SampleClassTwo.testMethodC() on thread [ 11]
===============================================
1265_Suite
Total tests run: 6, Failures: 0, Skips: 0
===============================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="1265_Suite" parallel="false" verbose="2">
<test name="92" parallel="classes" thread-count="1">
<packages>
<package name="com.rationaleemotions.stackoverflow.qn44518748"/>
</packages>
</test>
</suite>
package com.rationaleemotions.stackoverflow.qn44518748;
import org.testng.Reporter;
import org.testng.annotations.Test;
public class SampleClassOne {
@Test
public void testMethodA() {
Reporter.log("Executing : " + output(), true);
}
@Test(dependsOnMethods = "testMethodA")
public void testMethodB() {
Reporter.log("Executing : " + output(), true);
}
@Test(dependsOnMethods = "testMethodB")
public void testMethodC() {
Reporter.log("Executing : " + output(), true);
}
private String output() {
String clazzName = getClass().getCanonicalName();
String method = Reporter.getCurrentTestResult().getMethod().getMethodName();
return clazzName + "." + method + "() on thread [ " + Thread.currentThread().getId() + "]";
}
}
package com.rationaleemotions.stackoverflow.qn44518748;
import org.testng.Reporter;
import org.testng.annotations.Test;
public class SampleClassTwo {
@Test
public void testMethodA() {
Reporter.log("Executing : " + output(), true);
}
@Test(dependsOnMethods = "testMethodA")
public void testMethodB() {
Reporter.log("Executing : " + output(), true);
}
@Test(dependsOnMethods = "testMethodB")
public void testMethodC() {
Reporter.log("Executing : " + output(), true);
}
private String output() {
String clazzName = getClass().getCanonicalName();
String method = Reporter.getCurrentTestResult().getMethod().getMethodName();
return clazzName + "." + method + "() on thread [ " + Thread.currentThread().getId() + "]";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment