Mock tests, Interview questions, Tutorials and Tech news
 
 

Archive

Posts Tagged ‘tests’

Maven Surefire for Integration Tests in JUnit

June 14th, 2011 1 comment

Maven surefire plugin is used to run unit tests during test phase of build lifecycle . The reports are generated in .txt or .xml file. These files are generated at ${basedir}/target/surefire-reports

Surefire runs unit tests during build phase, not integration tests which are executed during package phase. But you can include integration tests also to be run

Below is the configuration for surefire plugin in your pom.xml

<profile>
<id>itest</id>
<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.surefire.report.version}</version>
<configuration>
<includes>
<include>**/*IntTest.java</include>
<include>**/*IntTests.java</include>
</includes>
</configuration>
</plugin>

</plugins>
</build>
</profile>

Categories: Programming / tutorials Tags: ,
Get Adobe Flash playerPlugin by wpburn.com wordpress themes