For some reason I cannot get Maven 2 Surefire plugin to execute JUnit 4 test class.
public class SimpleTest {
@org.junit.Test
public void simple() {
System.out.println("foo");
}
}
However if I change this class to be JUnit-3 like, such as
public class SimpleTest extends junit.framework.TestCase {
public void testBar() {
System.out.println("bar");
}
@org.junit.Test
public void simple() {
System.out.println("foo");
}
}
then it gets executed. Here's what I've done:
- verified Maven version: Apache Maven 2.2.1 (r801777; 2009-08-06 20:16:01+0100)
- verified Surefire version: followed this advice
- verified Surefire version: checked Surefire jars in my
~/.m2/repository/org/apache/maven/surefire
-- all of them are either version 2.4.2 or 2.4.3 - done a
mvn dependency:tree | grep junit
to ensure I only depend on junit version 4.7
The module I am having this problem at doesn't have JUnit 3 tests.
Is there anything else I am missing?