TestSuite创建方式(一)

public class MyTestSuite extends TestCase {

    public MyTestSuite () {
        super();
    }

    public static Test suite() {
        TestSuite suite = new TestSuite();
        suite.addTest(new JUnit4TestAdapter(A.class));
        suite.addTest(new JUnit4TestAdapter(B.class));
        TestSetup wrapper = new TestSetup(suite) {
            @Before
            protected void setUp() throws LTFSLEBaseException, Exception { 
                oneTimeSetUp();
            }
           @After
            protected void tearDown() throws LTFSLEBaseException, Exception {
                oneTimeTearDown();
            }
        };
        return wrapper;
    }

    protected static void oneTimeSetUp() {
    }

    protected static void oneTimeTearDown(){

    }


你可能感兴趣的:(TestSuite创建方式(一))