Skip to content

Instantly share code, notes, and snippets.

@jbarop
Created July 26, 2012 15:24
Show Gist options
  • Select an option

  • Save jbarop/3182684 to your computer and use it in GitHub Desktop.

Select an option

Save jbarop/3182684 to your computer and use it in GitHub Desktop.
GwtTestSuite
public class MyFancyGwtTestSuite extends GWTTestSuite {
/**
* List of all {@link GWTTestCase}s
*/
private final static Set<Class<? extends GWTTestCase>> allGwtTestCases = new HashSet<Class<? extends GWTTestCase>>();
/**
* Find all {@link GWTTestCase}s in the "<code>com.devbliss.idpool.gwt</code>" package and return
* a suite containing these tests.
*/
public static Test suite() {
ComponentScanner scanner = new ComponentScanner();
scanner.getClasses(new ComponentQuery() {
@Override
protected void query() {
select().from("com.devbliss.idpool.gwt").andStore(
thoseExtending(GWTTestCase.class).into(allGwtTestCases));
}
});
TestSuite suite = new TestSuite("All GWTTestCase tests");
for (Class<? extends GWTTestCase> unitTestClasz : allGwtTestCases) {
suite.addTestSuite(unitTestClasz);
}
return suite;
}
}
public class MyGwtTestSuite extends GWTTestSuite {
public static Test suite() {
TestSuite suite = new TestSuite("All GWTTestCase tests");
suite.addTestSuite(FirstGwtTest.class);
suite.addTestSuite(SecondGwtTest.class);
suite.addTestSuite(ThirdGwtTest.class);
return suite;
}
}
<dependency>
<groupId>net.sf.extcos</groupId>
<artifactId>extcos</artifactId>
<version>0.3b</version>
<scope>test</scope>
</dependency>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment