I’ve made some unit tests (in test class). The tutorial I’ve read said that I should make a TestSuite for the unittests.
Odd is that when I’m running the unit test directly (selecting the test class – Run as jUnit test) everything is working fine, altough when I’m trying the same thing with the test suite there’s always an exception: java.lang.Exception: No runnable methods.
Here is the code of the test suite:
import junit.framework.Test; import junit.framework.TestSuite; public class AllTests { public static Test suite() { TestSuite suite = new TestSuite('Test suite for com.xxx.yyyy.test'); //$JUnit-BEGIN$ suite.addTestSuite(TestCase.class); //$JUnit-END$ return suite; } }
Any ideas why this isn’t working ?
I’m not experienced in ant – so I’m not using it for testing it right now.
Searching the internet it seems like I’m mixing up the old jUnit 3.8 and jUnit 4.0 behavior. Trying now a way to use the ‘new behavior’
edited:
now it works:
AllTest changed to:
TestCase changed to: