Hi all,
 I have several projects that have both integration and regular unit tests
in them.  I try to cover all of my code with good testing with a combination
of the two.  Since Maven2 runs the test, then integration-test phases during
an install, how can I get cobertura to append the cobertura.ser with the
results from the integration test?  Currently it just overwrites it, then
shows no code coverage in the report.  I have included my pom configuration.


Thanks,
Todd

<plugin>
               <groupId>org.codehaus.mojo</groupId>
               <artifactId>cobertura-maven-plugin</artifactId>
               <configuration>
                   <instrumentation>
                       <ignores>
                           <ignore>*Exception</ignore>
                       </ignores>
                   </instrumentation>

                   <check>

                       <!--  Stop execution if coverage falls below
thresholds -->
                       <haltOnFailure>false</haltOnFailure>
                       <!--  Each class must have a branch rate of >= 100%
-->
                       <branchRate>100</branchRate>
                       <!--  Each class must have a line rate of >= 75% -->
                       <lineRate>75</lineRate>
                       <!--  The total branch rate must be >= 100% -->
                       <totalBranchRate>100</totalBranchRate>
                       <!-- The total line rate must be >= 75% -->
                       <totalLineRate>75</totalLineRate>

                   </check>

               </configuration>
               <executions>
                   <execution>
                       <id>test-coverage-clean</id>
                       <phase>clean</phase>
                       <goals>
                           <goal>clean</goal>
                       </goals>
                   </execution>
                   <execution>
                       <id>integrationtest-coverage</id>
                       <phase>integration-test</phase>
                       <goals>
                           <goal>check</goal>
                       </goals>
                   </execution>
                   <execution>
                       <id>test-coverage</id>
                       <phase>test</phase>
                       <goals>
                           <goal>check</goal>
                       </goals>
                   </execution>
               </executions>
           </plugin>
           <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-surefire-plugin</artifactId>
               <configuration>
                   <excludes>
                       <exclude>**/*IntegrationTest.java</exclude>
                   </excludes>
               </configuration>
               <executions>
                   <execution>
                       <id>surefire-it</id>
                       <phase>integration-test</phase>
                       <configuration>
                           <excludes>
                               <exclude>none</exclude>
                           </excludes>
                           <includes>
                               <include>**/*IntegrationTest.java</include>
                           </includes>
                       </configuration>
                       <goals>
                           <goal>test</goal>
                       </goals>
                   </execution>
               </executions>
           </plugin>

Reply via email to