blob: 6d68e06554d17b3cf6dce12b2a24f5063dc2b58a [file] [log] [blame]
package test.verify;
import org.testng.ITestNGListener;
import org.testng.ITestNGListenerFactory;
import org.testng.annotations.Listeners;
import org.testng.annotations.Test;
/**
* Illustrate the implementation of a @Verify/@Verifier test.
*
* One method should be annotated with @Verifier and then each test method
* annotated with @Verify will be followed with a call to the @Verifier
* method.
*/
@Listeners(VerifyTestListener.class)
public class Verify2SampleTest implements ITestNGListenerFactory {
public Verify2SampleTest() {}
@Verify
@Test
public void f1() {
log("f1");
}
@Verify
@Test
public void f2() {
log("f2");
}
@Verifier
@Test
public void verify() {
log("Verifying");
}
private void log(String string) {
if (false) {
System.out.println(hashCode() + " " + string);
}
}
public ITestNGListener createListener(Class<? extends ITestNGListener> listenerClass) {
log("Creating a listener of type " + listenerClass);
return null;
}
}