[Java]JUnit 4.x书写单元测试

Link: http://www.cnblogs.com/deepnighttwo/archive/2011/03/01/1968491.html

上面的文章介绍了几个JUnit 4.x里使用的用法,他们是值得注意的

1. 如何自己手动的组织Test Case,类似于TestNG里的group功能。-- org.junit.runners.Suit

2. 如何让JUnit 4写的Case能在JUnit 3下也运行,

 /**
     * Allow JUnit 4 test to be run under JUnit 3.
     */
    public static junit.framework.Test suite() {
        return new junit.framework.JUnit4TestAdapter(ExampleWithAssertThat.class);
    }
原文地址:https://www.cnblogs.com/buhaiqing/p/2910746.html