Junit4 Запустите все тесты в определенном пакете с помощью теста

Это возможно в 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
     }
  }

...

}
21
задан oers 26 September 2011 в 17:24
поделиться