java - Can't run jUnit with Eclipse -


I use new eclipse Create a demo test with JUnit (I added the default jihad library built-in eclipse). Then I write this code:

  import junit.framework. *; Import org.junit.Test; Public class simpleest testcase (public simplest) (string name) {super (name); } Public Final Zero Main (String Method) {} ​​@Test Public Final Zero Examination SimpleTest () {int answer = 2; Inspiring points ((1 + 1), answer); }}  

But it does not run in the debug tab:

  org.eclipse.jdt.internal.junit.runner.RemoteTestRunner at localhost: 52754 thread [Main] (Suspended (exception classnamefound exception)) URLClassLoader $ 1.run () Row: Not Available [Local Variables Unavailable] AccessController.doPrivileged (PrivilegedExceptionAction & lt; T & gt; AccessControlContext) Row: Not Available [native Method] Launcher $ AppClassLoader (URLClassLoader) .findClass (String) Line: Not available Launcher $ AppClassLoader (classloader) .loadClass (String, Boolean) line: Not available Launcher $ AppClassLoader. LoadClass (string, boolean) Row: Not available Launcher $ AppClassLoader (Classloader). Load class (string) line: Not available  

How can I resolve this?

You, as many people, get confused with JUnit 3 and JUnit 4. If you are JUnit 3 Using, test your name "test *" and get it from TestCase. If you are using JUnit 4 using annotations.


Comments