You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Denis McCarthy <dm...@annadaletech.com> on 2008/01/04 13:18:13 UTC

Junit 4 surefire woes

Hi,
When I run mvn test, only junit 3 tests seem to run. All test classes are
found, but for all
junit 4 style test classes, I get reports like this:
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.002 sec
When I extend TestCase, junit 3 style, the tests work.
When I run with -X, I get lines like
org.apache.maven.surefire:surefire-api:jar:2.3.1,
Which seems to be the latest version. I do have a second dependency to
testng in my pom as well, if
this makes any difference.
The relevant parts of the pom are:

 <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <forkMode>once</forkMode>
                    <argLine>-Xmx256m -Xms128m -XX:MaxPermSize=64m
-XX:PermSize=64m</argLine>
                    <systemProperties>
                        <property>
                            <name>net.sourceforge.cobertura.datafile</name>

<value>${basedir}/target/cobertura/cobertura.ser</value>
                        </property>
                    </systemProperties>
                </configuration>
            </plugin>
and
<dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.4</version>
            <scope>test</scope>
        </dependency>


Does anyone have any ideas? I'm stumped.
Thanks
Denis