Permalink
Browse files

Integration tests now install before the test and use the current emm…

…a-maven-plugin version. Also now actually *generating* the report in the EmmaCheckMojo if it's not present.
  • Loading branch information...
1 parent 545c4e2 commit 616dc079211f0239c3633671dc7da015ec326934 Andrew Phillips committed Jul 7, 2011
View
@@ -129,6 +129,9 @@
<projectsDirectory>
src/it
</projectsDirectory>
+ <cloneProjectsTo>
+ ${project.build.directory}/it
+ </cloneProjectsTo>
<goals>
<goal>site</goal>
<goal>verify</goal>
@@ -163,6 +166,7 @@
<id>integration-test</id>
<phase>integration-test</phase>
<goals>
+ <goal>install</goal>
<goal>run</goal>
</goals>
</execution>
View
@@ -15,12 +15,52 @@
<scope>test</scope>
</dependency>
</dependencies>
- <reporting>
- <plugins>
- <plugin>
- <groupId>org.sonatype.maven.plugin</groupId>
- <artifactId>emma-maven-plugin</artifactId>
- </plugin>
- </plugins>
- </reporting>
+ <profiles>
+ <profile>
+ <id>maven-2</id>
+ <activation>
+ <file>
+ <!-- only recognized by Maven 3.x (see MNG-2363) -->
+ <missing>${basedir}</missing>
+ </file>
+ </activation>
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.sonatype.maven.plugin</groupId>
+ <artifactId>emma-maven-plugin</artifactId>
+ <version>@project.version@</version>
+ </plugin>
+ </plugins>
+ </reporting>
+ </profile>
+ <profile>
+ <id>maven-3</id>
+ <activation>
+ <file>
+ <!-- only recognized by Maven 3.x (see MNG-2363) -->
+ <exists>${basedir}</exists>
+ </file>
+ </activation>
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <artifactId>maven-site-plugin</artifactId>
+ <version>3.0-beta-3</version>
+ <configuration>
+ <reportPlugins>
+ <plugin>
+ <groupId>org.sonatype.maven.plugin</groupId>
+ <artifactId>emma-maven-plugin</artifactId>
+ <version>@project.version@</version>
+ </plugin>
+ </reportPlugins>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+ </profile>
+ </profiles>
</project>
View
@@ -55,26 +55,80 @@
</plugin>
</plugins>
</build>
- <reporting>
- <plugins>
- <plugin>
- <groupId>org.sonatype.maven.plugin</groupId>
- <artifactId>emma-maven-plugin</artifactId>
- <configuration>
- <instrumentationPaths>
- <intrumentationPath>${project.build.outputDirectory}</intrumentationPath>
- <intrumentationPath>${project.build.directory}/dependency</intrumentationPath>
- </instrumentationPaths>
- <filters>
- <filter>+org.apache.commons.lang.StringUtils</filter>
- <filter>+hello.*</filter>
- </filters>
- <sourcePaths>
- <sourcePath>src/main/java</sourcePath>
- <sourcePath>${project.build.directory}/dependency-sources</sourcePath>
- </sourcePaths>
- </configuration>
- </plugin>
- </plugins>
- </reporting>
+ <profiles>
+ <profile>
+ <id>maven-2</id>
+ <activation>
+ <file>
+ <!-- only recognized by Maven 3.x (see MNG-2363) -->
+ <missing>${basedir}</missing>
+ </file>
+ </activation>
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.sonatype.maven.plugin</groupId>
+ <artifactId>emma-maven-plugin</artifactId>
+ <version>@project.version@</version>
+ <configuration>
+ <instrumentationPaths>
+ <intrumentationPath>${project.build.outputDirectory}</intrumentationPath>
+ <intrumentationPath>${project.build.directory}/dependency</intrumentationPath>
+ </instrumentationPaths>
+ <filters>
+ <filter>+org.apache.commons.lang.StringUtils</filter>
+ <filter>+hello.*</filter>
+ </filters>
+ <sourcePaths>
+ <sourcePath>src/main/java</sourcePath>
+ <sourcePath>${project.build.directory}/dependency-sources</sourcePath>
+ </sourcePaths>
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
+ </profile>
+ <profile>
+ <id>maven-3</id>
+ <activation>
+ <file>
+ <!-- only recognized by Maven 3.x (see MNG-2363) -->
+ <exists>${basedir}</exists>
+ </file>
+ </activation>
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <artifactId>maven-site-plugin</artifactId>
+ <version>3.0-beta-3</version>
+ <configuration>
+ <reportPlugins>
+ <plugin>
+ <groupId>org.sonatype.maven.plugin</groupId>
+ <artifactId>emma-maven-plugin</artifactId>
+ <version>@project.version@</version>
+ <configuration>
+ <instrumentationPaths>
+ <intrumentationPath>${project.build.outputDirectory}</intrumentationPath>
+ <intrumentationPath>${project.build.directory}/dependency</intrumentationPath>
+ </instrumentationPaths>
+ <filters>
+ <filter>+org.apache.commons.lang.StringUtils</filter>
+ <filter>+hello.*</filter>
+ </filters>
+ <sourcePaths>
+ <sourcePath>src/main/java</sourcePath>
+ <sourcePath>${project.build.directory}/dependency-sources</sourcePath>
+ </sourcePaths>
+ </configuration>
+ </plugin>
+ </reportPlugins>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+ </profile>
+ </profiles>
</project>
View
@@ -26,20 +26,66 @@
<scope>test</scope>
</dependency>
</dependencies>
- <reporting>
- <plugins>
- <plugin>
- <groupId>org.sonatype.maven.plugin</groupId>
- <artifactId>emma-maven-plugin</artifactId>
- <configuration>
- <filters>
- <filter>+hello.*</filter>
- <filter>+byebye.*</filter>
- </filters>
- </configuration>
- </plugin>
- </plugins>
- </reporting>
+ <profiles>
+ <profile>
+ <id>maven-2</id>
+ <activation>
+ <file>
+ <!-- only recognized by Maven 3.x (see MNG-2363) -->
+ <missing>${basedir}</missing>
+ </file>
+ </activation>
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.sonatype.maven.plugin</groupId>
+ <artifactId>emma-maven-plugin</artifactId>
+ <version>@project.version@</version>
+ <configuration>
+ <filters>
+ <filter>+hello.*</filter>
+ <filter>+byebye.*</filter>
+ </filters>
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
+ </profile>
+ <profile>
+ <id>maven-3</id>
+ <activation>
+ <file>
+ <!-- only recognized by Maven 3.x (see MNG-2363) -->
+ <exists>${basedir}</exists>
+ </file>
+ </activation>
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <artifactId>maven-site-plugin</artifactId>
+ <version>3.0-beta-3</version>
+ <configuration>
+ <reportPlugins>
+ <plugin>
+ <groupId>org.sonatype.maven.plugin</groupId>
+ <artifactId>emma-maven-plugin</artifactId>
+ <version>@project.version@</version>
+ <configuration>
+ <filters>
+ <filter>+hello.*</filter>
+ <filter>+byebye.*</filter>
+ </filters>
+ </configuration>
+ </plugin>
+ </reportPlugins>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+ </profile>
+ </profiles>
<modules>
<module>a</module>
<module>b</module>
View
@@ -16,24 +16,25 @@
</dependency>
</dependencies>
<build>
- <plugins>
- <plugin>
- <groupId>org.sonatype.maven.plugin</groupId>
- <artifactId>emma-maven-plugin</artifactId>
- <configuration>
- <check>
- <lineRate>90</lineRate>
- </check>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>clean</goal>
- <goal>check</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
+ <plugins>
+ <plugin>
+ <groupId>org.sonatype.maven.plugin</groupId>
+ <artifactId>emma-maven-plugin</artifactId>
+ <version>@project.version@</version>
+ <configuration>
+ <check>
+ <lineRate>90</lineRate>
+ </check>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>clean</goal>
+ <goal>check</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
</build>
</project>
View
@@ -16,30 +16,31 @@
</dependency>
</dependencies>
<build>
- <plugins>
- <plugin>
- <groupId>org.sonatype.maven.plugin</groupId>
- <artifactId>emma-maven-plugin</artifactId>
- <configuration>
- <check>
- <blockRate>80</blockRate>
- <regexes>
- <regex>
- <pattern>hello.Hello.*</pattern>
- <lineRate>100</lineRate>
- </regex>
- </regexes>
- </check>
- </configuration>
- <executions>
- <execution>
- <goals>
- <goal>clean</goal>
- <goal>check</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
+ <plugins>
+ <plugin>
+ <groupId>org.sonatype.maven.plugin</groupId>
+ <artifactId>emma-maven-plugin</artifactId>
+ <version>@project.version@</version>
+ <configuration>
+ <check>
+ <blockRate>80</blockRate>
+ <regexes>
+ <regex>
+ <pattern>hello.Hello.*</pattern>
+ <lineRate>100</lineRate>
+ </regex>
+ </regexes>
+ </check>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>clean</goal>
+ <goal>check</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
</build>
</project>
@@ -424,6 +424,7 @@ private File generateReport() throws MojoExecutionException
properties.setProperty( "report.xml.out.file", new File( outputDirectory, "coverage.xml" ).getAbsolutePath() );
properties.setProperty( "report.txt.out.file", new File( outputDirectory, "coverage.txt" ).getAbsolutePath() );
reporter.setPropertyOverrides( properties );
+ reporter.run();
return new File( outputDirectory, "coverage.xml" );
}

0 comments on commit 616dc07

Please sign in to comment.