blob: b3aee6124dbb152628ef3f3dca901318a5be189d [file] [log] [blame]
package test.sample;
import org.testng.annotations.AfterClass;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.ExpectedExceptions;
import org.testng.annotations.Test;
/**
* This class
*
* @author Cedric Beust, Apr 26, 2004
*
*/
public class Sample1 extends BaseSample1 {
@AfterClass
public static void tearDownClass1() {
}
@AfterClass
public void tearDownClass2() {
}
@BeforeMethod
public void beforeTest() {
}
@AfterMethod
public void afterTest() {
}
@Test(groups = {"even"})
public void method2() {
}
@Test(groups = {"odd"})
public void method3() {
}
@Test(groups = {"odd"}, enabled = false)
public void oddDisableMethod() {
}
@Test(groups = {"broken"})
public void broken() {
}
@Test(groups = {"fail"})
@ExpectedExceptions( {NumberFormatException.class, ArithmeticException.class})
public void throwExpectedException1ShouldPass() {
throw new NumberFormatException();
}
@Test(groups = {"fail"})
@ExpectedExceptions( {NumberFormatException.class, ArithmeticException.class})
public void throwExpectedException2ShouldPass() {
throw new ArithmeticException();
}
@Test(groups = {"fail", "bug"})
public void throwExceptionShouldFail() {
throw new NumberFormatException();
}
@Test(groups = {"assert"})
public void verifyLastNameShouldFail() {
assert "Beust".equals("") : "Expected name Beust, found blah";
}
private static void ppp(String s) {
System.out.println("[Test1] " + s);
}
}