I am trying JUnit 4.11. I wrote this sample provided at JUnit FooTest.java
public class FooTest{
@Test
public void thisAlwaysPass(){
}
}
I have the JUnit 4.11 jar and the Hamcrest jar at /usr/lib/jvm/java/jre/lib/ext
Now when I run the following command, it says that it is unable to find the class.
$ java -cp . org.junit.runner.JUnitCore FooTest
JUnit version 4.11
could not find class : FooTest
Time : 0.002
OK (0 Tests)
I thought there is some problem with the classpath. So I tried without JUnit, and it said that main is missing:
$ java -cp . FooTest
Error: main method not found in FooTest
So Java is able to load the class. But when I try to run with JUnit, it cannot find the class. I have a basic understanding of the java class loading. Am I missing something here with JUnit?
I am using Fedora 17 & OpenJDK 1.7