Junit with Testsuit error
posted 18 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Hi friends,
Please help me in with Testsuit, I wrote the code in ecllipse I got the following error
package com;
import junit.framework.Test;
import junit.framework.TestSuite;
public class AllTests {
public static Test suite() {
TestSuite suite = new TestSuite("Test for com");
//$JUnit-BEGIN$
suite.addTestSuite(Testcase0.class);
suite.addTestSuite(Testcase1.class);
//$JUnit-END$
return suite;
}
public static void main(String args[]){
suite();
}
}
java.lang.Exception: No runnable methods
at org.junit.internal.runners.TestClassMethodsRunner.testAborted(TestClassMethodsRunner.java:42)
at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:33)
at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Please help me in with Testsuit, I wrote the code in ecllipse I got the following error
package com;
import junit.framework.Test;
import junit.framework.TestSuite;
public class AllTests {
public static Test suite() {
TestSuite suite = new TestSuite("Test for com");
//$JUnit-BEGIN$
suite.addTestSuite(Testcase0.class);
suite.addTestSuite(Testcase1.class);
//$JUnit-END$
return suite;
}
public static void main(String args[]){
suite();
}
}
java.lang.Exception: No runnable methods
at org.junit.internal.runners.TestClassMethodsRunner.testAborted(TestClassMethodsRunner.java:42)
at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:33)
at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
posted 18 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Bhargavi,
You need to call suite() from a test runner for anything to happen.
You need to call suite() from a test runner for anything to happen.
[OCP 21 book] | [OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
posted 18 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
You are trying to run a JUnit 3 test using a JUnit 4 runner. Either change the test to be a JUnit 4 test, or tell Eclipse to use the Junit 3 runner (inside the launch configuration).
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
| "Don't believe every tiny ad you see on the internet. But this one is rock solid." - George Washington Paul Wheaton's 16th Kickstarter: Gardening playing cards for gardeners and homesteaders https://coderanch.com/t/889615/Paul-Wheaton-Kickstarter-Gardening-playing |











