这在 JUnit4 中可行吗?
在 JUnit3 中,我会执行以下操作:
public class MyTestSuite {
public static Test suite() throws Exception {
doBeforeActions();
try {
TestSuite testSuite = new TestSuite();
for(Class clazz : getAllClassesInPackage("com.mypackage")){
testSuite.addTestSuite(clazz);
}
return testSuite;
} finally {
doAfterActions
}
}
...
}