my java test do not compile, I run it and have : no junit tests could not find main class (specified in run-configuration)
A:
Can you write your code? How you are trying to run the test? In which enviroment? Junit and JDK versions?
And every other information that will be helpful :P
Thomas Sofras
2010-02-25 09:46:26
public class Test1 { @BeforeClass public static void setupOnce() { final Thread thread = new Thread() { public void run() { Main.main(new String[]{"-rtebase", "C:\\my appli", "-windows"}); } }; try { thread.start(); } catch (Exception ex) { } }
2010-02-25 09:48:45
from eclipse3.5 , click on run test as junit (version 4)it says no main class as specify class that I have put when I I configured project from (run->run configuration->main class in the java application
2010-02-25 10:14:07
A:
You don't have any @Test
methods in your class.
JUnit4 looks for methods annotated with @Test
- if it doesn't find any in a class, it omits that class completely.
Péter Török
2010-02-25 09:50:01
A:
I agree with Peter
@Test public void testSomeBehavior() { assertEquals("Empty list should have 0 elements", 0, emptyList.size()); }
Thomas Sofras
2010-02-25 09:56:58