java - JUnit4 run all tests in a specific package using a testsuite -


is possible in junit4?

in junit3, following:

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;      } {         doafteractions      }   }  ...  } 

the takari-cpsuite (originally developed johannes link) offers classpath-suite should fit needs. allows filtering of classes in classpath regular expressions like:

import org.junit.extensions.cpsuite.classpathsuite.*; ... @classnamefilters({"mytests.*", ".*test"}) public class mysuite... 

Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -