01: package test.sample;
02:
03: /**
04: * This class
05: *
06: * @author Cedric Beust, Apr 26, 2004
07: */
08: public class Sample1 extends BaseSample1 {
09: /**
10: * @testng.after-class
11: */
12: public static void tearDownClass1() {
13: }
14:
15: /**
16: * @testng.after-class
17: */
18: public void tearDownClass2() {
19: }
20:
21: /**
22: * @testng.before-method
23: */
24: public void beforeTest() {
25: }
26:
27: /**
28: * @testng.after-method
29: */
30: public void afterTest() {
31: }
32:
33: /**
34: * @testng.test groups="even"
35: */
36: public void method2() {
37: }
38:
39: // Method moved to base class to test inheritance
40: // @Test(groups = { "odd" })
41: // public void method1() {
42: // }
43:
44: /**
45: * @testng.test groups="odd"
46: */
47: public void method3() {
48: }
49:
50: /**
51: * @testng.test enabled="false" groups="odd"
52: */
53: public void oddDisableMethod() {
54: }
55:
56: /**
57: * @testng.test groups="broken"
58: */
59: public void broken() {
60: }
61:
62: /**
63: * @testng.test groups="fail"
64: * @testng.expected-exceptions value="java.lang.NumberFormatException,java.lang.ArithmeticException"
65: */
66: public void throwExpectedException1ShouldPass() {
67: throw new NumberFormatException();
68: }
69:
70: /**
71: * @testng.test groups="fail"
72: * @testng.expected-exceptions value="java.lang.NumberFormatException,java.lang.ArithmeticException"
73: */
74: public void throwExpectedException2ShouldPass() {
75: throw new ArithmeticException();
76: }
77:
78: /**
79: * @testng.test groups="fail , bug "
80: */
81: public void throwExceptionShouldFail() {
82: throw new NumberFormatException();
83: }
84:
85: /**
86: * @testng.test groups="assert"
87: */
88: public void verifyLastNameShouldFail() {
89: assert "Beust".equals("") : "Expected name Beust, found blah";
90: }
91:
92: private static void ppp(String s) {
93: System.out.println("[Test1] " + s);
94: }
95:
96: }
|