thanhnc201086 / spring-finance-manager

Automatically exported from code.google.com/p/spring-finance-manager
0 stars 0 forks source link

JUnit 4.5.0 + SureFire problems #2

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. CheckOut trunk
2. mvn install

What is the expected output? What do you see instead?

Test fail due to SureFire / JUnit (4.5.0) problems similar to the ones
described here:
http://forum.springsource.org/showthread.php?t=76524
(tried to access method org.junit.runners.BlockJUnit4ClassRunner.makeNotifier)

What version of the product are you using? On what operating system?

Revision 30.

Please provide any additional information below.

Can be fixed by editing the pom.xml file, changing JUnit version to 4.7.0
and modifying the maven-surefire-plugin part in the following style:

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <includes>
                        <include>**/*Tests.java</include>
                    </includes>
                    <excludes>
                        <exclude>**/Abstract*.java</exclude>
                    </excludes>

<junitArtifactName>org.junit:com.springsource.org.junit</junitArtifactName>
                </configuration>
            </plugin>

Original issue reported on code.google.com by b2prix21@gmail.com on 9 Sep 2009 at 11:05

GoogleCodeExporter commented 9 years ago
I downloaded the trunk, got in the pom.xml
<dependency>
 <groupId>org.junit</groupId>
 <artifactId>com.springsource.org.junit</artifactId>
 <version>4.5.0</version>
 <scope>test</scope>
</dependency>

The pom.xml from the trunk contains already the appropriate override of the
junitArtifactName

Googled a bit and found out on the Spring forum that version M4 of Spring 3 
needs the
version 4.6.0 of the junit
Changed the version in the pom to 4.6.0, run mvn clean test and voilà

So I guess there's only to commit the pom.xml with the corrected version of the
dependency.

Thanks a lot Stefan for assembling together this step-by-step tutorial to get 
started.

Original comment by olivier....@gmail.com on 25 Sep 2009 at 3:38