public class MapsTestSuite extends GWTTestSuite {
public static Test suite() {
TestSuite suite = new TestSuite("Test for a Maps Application");
suite.addTestSuite(MapTest.class);
suite.addTestSuite(EventTest.class);
suite.addTestSuite(CopyTest.class);
return suite;
}
}
However, running this using the junit.testui.TestRunner in JUnit4.4 (for example if you are running from the command line using the Maven GWT plugin) gives the following helpful error:Error: java.lang.ClassCastException
Instead you want to do the following:
public class MapsTestSuite extends TestCase {
public static Test suite() {
GWTTestSuite suite = new GWTTestSuite("Test for a Maps Application");
suite.addTestSuite(MapTest.class);
suite.addTestSuite(EventTest.class);
suite.addTestSuite(CopyTest.class);
return suite;
}
}
i.e. Extend TestCase rather than GWTTestSuite to overcome this problem.
No comments:
Post a Comment