I am trying to use maven with Junit4 test cases. Eclipse runs these
tests just fine but maven doesn't recognize any of these tests.

Here is the code
import org.junit.Test;
import static org.junit.Assert.*;

public class AdditionTest {
          private int x = 1;
          private int y = 1;
          
          @Test 
          public void addition() {
            int z = x + y;
            assertEquals(2, z);
          }
}

POM file
        <dependencies>
                <dependency>
                        <groupId>org.junit</groupId>
                        <artifactId>junit</artifactId>
                        <version>4.4</version>
                </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>
                                </configuration>
                        </plugin>
                        <plugin>
        
<groupId>org.apache.maven.plugins</groupId>
        
<artifactId>maven-surefire-plugin</artifactId>
                                <version>2.4.3</version>
                                <configuration>
                                        <includes>
        
<include>**/*Test.java</include>
                                        </includes>
                                </configuration>
                        </plugin>                       
                </plugins>
        </build>


Am I doing anything wrong here? Or anything else needs to be done?

This email and any files transmitted with it are confidential, proprietary
and intended solely for the individual or entity to whom they are addressed.
If you have received this email in error please delete it immediately.


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

Reply via email to