Author: vmassol
Date: Tue Oct  3 14:22:12 2006
New Revision: 452628

URL: http://svn.apache.org/viewvc?view=rev&rev=452628
Log:
MCLOVER-48: Add support for block contexts

* Finished adding tests

Added:
    maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/test/verifier/
    
maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/test/verifier/verifications.xml
   (with props)
Modified:
    maven/plugins/trunk/maven-clover-plugin/src/it/contexts/   (props changed)
    maven/plugins/trunk/maven-clover-plugin/src/it/contexts/goals.txt
    maven/plugins/trunk/maven-clover-plugin/src/it/contexts/pom.xml
    
maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/main/java/org/apache/maven/plugin/clover/samples/contexts/Simple.java

Propchange: maven/plugins/trunk/maven-clover-plugin/src/it/contexts/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Oct  3 14:22:12 2006
@@ -0,0 +1,2 @@
+build.log
+target

Modified: maven/plugins/trunk/maven-clover-plugin/src/it/contexts/goals.txt
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-clover-plugin/src/it/contexts/goals.txt?view=diff&rev=452628&r1=452627&r2=452628
==============================================================================
--- maven/plugins/trunk/maven-clover-plugin/src/it/contexts/goals.txt (original)
+++ maven/plugins/trunk/maven-clover-plugin/src/it/contexts/goals.txt Tue Oct  
3 14:22:12 2006
@@ -1 +1 @@
-clean install
+clean install site verifier:verify

Modified: maven/plugins/trunk/maven-clover-plugin/src/it/contexts/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-clover-plugin/src/it/contexts/pom.xml?view=diff&rev=452628&r1=452627&r2=452628
==============================================================================
--- maven/plugins/trunk/maven-clover-plugin/src/it/contexts/pom.xml (original)
+++ maven/plugins/trunk/maven-clover-plugin/src/it/contexts/pom.xml Tue Oct  3 
14:22:12 2006
@@ -14,18 +14,28 @@
       <scope>test</scope>
     </dependency>
   </dependencies>
-  <build>
+  <reporting>
+    <excludeDefaults>true</excludeDefaults>
     <plugins>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-clover-plugin</artifactId>
         <configuration>
-
           <!-- Verify that context filters work -->
-          <contextFilters>static</contextFilters>
-
-          <targetPercentage>80%</targetPercentage>
-
+          <contextFilters>try</contextFilters>
+        </configuration>
+      </plugin>
+    </plugins>
+  </reporting>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-clover-plugin</artifactId>
+        <configuration>
+          <!-- Without the block filter the TPC is 50% and with it it's 57,1%. 
Thus we check for a TPC above of
+               55% to verify the filter has been applied correctly -->
+          <targetPercentage>55%</targetPercentage>
         </configuration>
         <executions>
           <execution>
@@ -34,7 +44,6 @@
             <goals>
               <goal>instrument</goal>
               <goal>check</goal>
-              <goal>log</goal>
             </goals>
           </execution>
         </executions>

Modified: 
maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/main/java/org/apache/maven/plugin/clover/samples/contexts/Simple.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/main/java/org/apache/maven/plugin/clover/samples/contexts/Simple.java?view=diff&rev=452628&r1=452627&r2=452628
==============================================================================
--- 
maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/main/java/org/apache/maven/plugin/clover/samples/contexts/Simple.java
 (original)
+++ 
maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/main/java/org/apache/maven/plugin/clover/samples/contexts/Simple.java
 Tue Oct  3 14:22:12 2006
@@ -17,18 +17,20 @@
 
 public class Simple
 {
-    static
-    {
-        System.getProperties();
-    }
-    
     public void someMethod1()
     {        
     }
 
     public void someMethodToReduceStatementCoverage()
     {
-        System.getProperties();        
+        try
+        {
+            System.getProperties();
+        }
+        finally
+        {
+            // We use a try/finally so that we can use a block context of 
+        }
     }
     
     public void someMethod2(int i)

Added: 
maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/test/verifier/verifications.xml
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/test/verifier/verifications.xml?view=auto&rev=452628
==============================================================================
--- 
maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/test/verifier/verifications.xml
 (added)
+++ 
maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/test/verifier/verifications.xml
 Tue Oct  3 14:22:12 2006
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<verifications>
+  <files>
+    <file>
+      <location>target/site/clover/pkgs-summary.html</location>
+      <contains>57.1%</contains>
+    </file>
+  </files>
+</verifications>

Propchange: 
maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/test/verifier/verifications.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/plugins/trunk/maven-clover-plugin/src/it/contexts/src/test/verifier/verifications.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"


Reply via email to