01: package test.factory.classconf;
02:
03: import org.testng.annotations.AfterClass;
04: import org.testng.annotations.BeforeClass;
05: import org.testng.annotations.Factory;
06: import org.testng.annotations.Test;
07:
08: /**
09: * This class/interface
10: */
11: public class XClassOrderWithFactory {
12: public static final String EXPECTED_LOG = "BTABTABTA";
13: public static final StringBuffer LOG = new StringBuffer();
14:
15: @Factory
16: public Object[] createInstances() throws Exception {
17: return new Object[] { new XClassOrderTest(),
18: new XClassOrderTest(), new XClassOrderTest() };
19: }
20:
21: public static class XClassOrderTest {
22: @BeforeClass
23: public void beforeClass() {
24: LOG.append("B");
25: }
26:
27: public @Test
28: void test() {
29: LOG.append("T");
30: }
31:
32: public @AfterClass
33: void afterClass() {
34: LOG.append("A");
35: }
36: }
37: }
|