Can you run with -X to see if the junit4 provider is being used ?

Tom

On 1/10/07, Lageson,Thomas M <[EMAIL PROTECTED]> wrote:
I have noticed a couple of things in my testing of the 2.3 Snapshot of
the maven-surefire-plugin when going against JUnit 4.1 with Maven2.



1)        It does not recognize the setup (@Before annotation).

2)           It did not recognize test method names (@Test annotation)
that didn't have a method name beginning with test (according to the
Junit docs, the method names no longer have to be named
test<methodname>.

3)           It only runs one test file.  I have tried forking.  No
matter what I try, simply running "mvn clean test" will only run one
test file.  Running "mvn clean test
-Dtest=MyAppTest,MyAppTest1,MyAppTest2" will run all three tests.  I
expected that "mvn clean test" would run all the tests in the project.



Any ideas, obvious things I am overlooking?



Thanks.



My pom.xml is:

<project xmlns="http://maven.apache.org/POM/4.0.0";

      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";

      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd";>

      <modelVersion>4.0.0</modelVersion>

      <groupId>com.lageson.sample</groupId>

      <artifactId>TestJavaJunit4</artifactId>

      <packaging>jar</packaging>

      <version>1.0-SNAPSHOT</version>

      <name>TestJavaJunit4</name>

      <url>http://maven.apache.org</url>

      <dependencies>

            <dependency>

                  <groupId>junit</groupId>

                  <artifactId>junit</artifactId>

                  <version>4.1</version>

                  <scope>test</scope>

            </dependency>

      </dependencies>

      <build>

            <plugins>

                  <plugin>

                        <groupId>org.apache.maven.plugins</groupId>

                        <artifactId>maven-compiler-plugin</artifactId>

                        <configuration>

                              <source>1.5</source>

                              <target>1.5</target>

                              <!--
<compilerArgument>-verbose</compilerArgument> -->



                        </configuration>

                  </plugin>

                  <plugin>

                        <groupId>org.apache.maven.plugins</groupId>

                        <artifactId>maven-surefire-plugin</artifactId>

                        <configuration>

                              <source>1.5</source>

                              <target>1.5</target>

                              <!-- <forkMode>pertest</forkMode> -->

                              <!-- <forkMode>always</forkMode>-->

                              <argLine>-enableassertions</argLine>

                        </configuration>



                  </plugin>



            </plugins>

      </build>

</project>



My output is:

C:\IBMRAD70\myworkspace\TestJavaJunit4>mvn clean test

[INFO] Scanning for projects...

[INFO]
------------------------------------------------------------------------
-

---

[INFO] Building TestJavaJunit4

[INFO]    task-segment: [clean, test]

[INFO]
------------------------------------------------------------------------
-

---

[INFO] [clean:clean]

[INFO] Deleting directory C:\IBMRAD70\myworkspace\TestJavaJunit4\target

[INFO] Deleting directory
C:\IBMRAD70\myworkspace\TestJavaJunit4\target\classes

[INFO] Deleting directory
C:\IBMRAD70\myworkspace\TestJavaJunit4\target\test-cla

sses

[INFO] [resources:resources]

[INFO] Using default encoding to copy filtered resources.

[INFO] [compiler:compile]

Compiling 1 source file to
C:\IBMRAD70\myworkspace\TestJavaJunit4\target\classes



[INFO] [resources:testResources]

[INFO] Using default encoding to copy filtered resources.

[INFO] [compiler:testCompile]

Compiling 3 source files to
C:\IBMRAD70\myworkspace\TestJavaJunit4\target\test-c

lasses

[INFO] [surefire:test]

[INFO] Surefire report directory:
C:\IBMRAD70\myworkspace\TestJavaJunit4\target\

surefire-reports



-------------------------------------------------------

 T E S T S

-------------------------------------------------------

Running com.lageson.sample.MyAppTest

Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.04 sec



Results :

Tests run: 3, Failures: 0, Errors: 0, Skipped: 0



[INFO]
------------------------------------------------------------------------

[INFO] BUILD SUCCESSFUL

[INFO]
------------------------------------------------------------------------

[INFO] Total time: 4 seconds

[INFO] Finished at: Wed Jan 10 09:50:46 CST 2007

[INFO] Final Memory: 4M/7M

[INFO]
------------------------------------------------------------------------




==============================================================================
This communication, together with any attachments hereto or links contained 
herein, is for the sole use of the intended recipient(s) and may contain 
information that is confidential or legally protected. If you are not the 
intended recipient, you are hereby notified that any review, disclosure, 
copying, dissemination, distribution or use of this communication is STRICTLY 
PROHIBITED.  If you have received this communication in error, please notify 
the sender immediately by return e-mail message and delete the original and all 
copies of the communication, along with any attachments hereto or links herein, 
from your system.

==============================================================================
The St. Paul Travelers e-mail system made this annotation on 01/10/07, 10:56:23.




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to