You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by c_inconnu2 <c_...@yahoo.fr> on 2007/01/17 23:46:40 UTC

maven 2, clover and contexts

Hi,

I am trying to configure Clover to use "contextFilters" with 
"statementContext". Here is my pom.xml :

<reporting>
        <plugins>
            ...
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-clover-plugin</artifactId>
                <configuration>
                    <jdk>1.5</jdk>
                    <excludes>
                        <exclude>**/*AllTests.java</exclude>
                        <exclude>**/*Main.java</exclude>
                        <exclude>**/*Main$*.java</exclude>
                        <exclude>**/*Test.java</exclude>
                        <exclude>**/*Test$*.java</exclude>
                    </excludes>
                    <statementContext name="log" regexp="^logger\..*" />
                    <!--statementContext name="iflog" regexp="^if 
\(logger\.is.*" /-->
                    <statementContext name="iflog" 
regexp="if.?.?log.*\.isDebugEnabled.*}" />
                    <!--contextFilters>log,iflog</contextFilters-->
                    <contextFilters>try</contextFilters>
                </configuration>
            </plugin>
            ...
        <plugins>
<reporting>

as you can see, I tried many things. I looked the clover site, search 
mailing lists but nothing...
I even looked into the plugin source code : it seems that it does not 
handle "statementContext".
But since even the "try" context does not work...

Any help will be greatly appreciated, thanks

David


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: maven 2, clover and contexts

Posted by c_inconnu2 <c_...@yahoo.fr>.
Done : http://jira.codehaus.org/browse/MCLOVER-64
And i will start to look how to code a mojo ^^


Vincent Massol a écrit :
>
> On Jan 21, 2007, at 1:25 AM, c_inconnu2 wrote:
>
>> That works !
>
> Documentation updated.
>
>> Thanks for your help. Is there any plan to support "statementContext" 
>> in the plugin ?
>
> We need to support it but it's not done yet. Create a JIRA issue if 
> it's not there already. I'll probably be able to spend some time on 
> the plugin end of next week.
>
>> I'd like to exclude all my loggers... BTW, I'll try to understand how 
>> that works and see if i can contribute
>
> Cool!
>
> Thanks
> -Vincent
>
>>
>> David DIDIER
>>
>> Vincent Massol a écrit :
>>> Hi David,
>>>
>>> I think the reason is because the <contextFilter> configuration 
>>> element is a property of the report mojo and thus it needs to be 
>>> defined in the <reporting> section and not in the <build> section. 
>>> For example:
>>>
>>> <reporting>
>>>     <excludeDefaults>true</excludeDefaults>
>>>     <plugins>
>>>       <plugin>
>>>         <groupId>org.apache.maven.plugins</groupId>
>>>         <artifactId>maven-clover-plugin</artifactId>
>>>         <configuration>
>>>           <!-- Verify that context filters work -->
>>>           <contextFilters>try</contextFilters>
>>>         </configuration>
>>>       </plugin>
>>>     </plugins>
>>>   </reporting>
>>>
>>> Let me know if this works for you and I'll update the documentation.
>>>
>>> Thanks
>>> -Vincent
>>>
>>> On Jan 18, 2007, at 11:07 PM, c_inconnu2 wrote:
>>>
>>>> Hi Vincent,
>>>>
>>>> Thanks for your answer. Indeed there is no reason that it should 
>>>> work : I was just wondering...
>>>> But I tried to use contextFilters and I cannot manage to get it 
>>>> work either. Here is a part of my pom :
>>>>
>>>>    <reporting>
>>>>        <plugins>
>>>>            <plugin>
>>>>                <groupId>org.apache.maven.plugins</groupId>
>>>>                <artifactId>maven-clover-plugin</artifactId>
>>>>            </plugin>
>>>>
>>>>            <plugin>
>>>>                <groupId>org.codehaus.mojo</groupId>
>>>>                <artifactId>surefire-report-maven-plugin</artifactId>
>>>>            </plugin>
>>>>        </plugins>
>>>>    </reporting>
>>>>
>>>>    <build>
>>>>        <plugins>
>>>>            <plugin>
>>>>                <groupId>org.apache.maven.plugins</groupId>
>>>>                <artifactId>maven-compiler-plugin</artifactId>
>>>>                <configuration>
>>>>                    <source>1.5</source>
>>>>                    <target>1.5</target>
>>>>                    <showDeprecation>true</showDeprecation>
>>>>                </configuration>
>>>>            </plugin>
>>>>
>>>>            <plugin>
>>>>                <groupId>org.apache.maven.plugins</groupId>
>>>>                <artifactId>maven-clover-plugin</artifactId>
>>>>                <configuration>
>>>>                    <jdk>1.5</jdk>
>>>>                    <contextFilters>try</contextFilters>
>>>>                </configuration>
>>>>                <executions>
>>>>                    <execution>
>>>>                        <phase>pre-site</phase>
>>>>                        <goals>
>>>>                            <goal>instrument</goal>
>>>>                        </goals>
>>>>                    </execution>
>>>>                </executions>
>>>>            </plugin>
>>>>        </plugins>
>>>>    </build>
>>>>
>>>> I tested with this :
>>>>
>>>> public static String f()
>>>>    {
>>>>        try
>>>>        {
>>>>            if(true){
>>>>                Class.forName("AAA");                        }
>>>>            Class.forName("BBB");
>>>>        }
>>>>        catch (Exception e)
>>>>        {
>>>>            // TODO: handle exception
>>>>        }
>>>>        return "f";
>>>>    }
>>>>
>>>> If I understand, the line Class.forName("BBB"); should be reported 
>>>> as not tested ???
>>>> But it is in red in the report ("statement not executed"). And 
>>>> Class.forName("AAA"); was executed
>>>>
>>>> Thanks for your help
>>>>
>>>> Vincent Massol a écrit :
>>>>> Hi David,
>>>>>
>>>>> Why are you assuming that <statementContext> would work?
>>>>>
>>>>> Just check the plugin documentation and you'll see that the 
>>>>> correct tag name is <contextFilters>. Just check the documentation 
>>>>> for more details and examples.
>>>>>
>>>>> Thanks
>>>>> -Vincent
>>>>>
>>>>> On Jan 17, 2007, at 11:46 PM, c_inconnu2 wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> I am trying to configure Clover to use "contextFilters" with 
>>>>>> "statementContext". Here is my pom.xml :
>>>>>>
>>>>>> <reporting>
>>>>>>        <plugins>
>>>>>>            ...
>>>>>>            <plugin>
>>>>>>                <groupId>org.apache.maven.plugins</groupId>
>>>>>>                <artifactId>maven-clover-plugin</artifactId>
>>>>>>                <configuration>
>>>>>>                    <jdk>1.5</jdk>
>>>>>>                    <excludes>
>>>>>>                        <exclude>**/*AllTests.java</exclude>
>>>>>>                        <exclude>**/*Main.java</exclude>
>>>>>>                        <exclude>**/*Main$*.java</exclude>
>>>>>>                        <exclude>**/*Test.java</exclude>
>>>>>>                        <exclude>**/*Test$*.java</exclude>
>>>>>>                    </excludes>
>>>>>>                    <statementContext name="log" 
>>>>>> regexp="^logger\..*" />
>>>>>>                    <!--statementContext name="iflog" regexp="^if 
>>>>>> \(logger\.is.*" /-->
>>>>>>                    <statementContext name="iflog" 
>>>>>> regexp="if.?.?log.*\.isDebugEnabled.*}" />
>>>>>>                    <!--contextFilters>log,iflog</contextFilters-->
>>>>>>                    <contextFilters>try</contextFilters>
>>>>>>                </configuration>
>>>>>>            </plugin>
>>>>>>            ...
>>>>>>        <plugins>
>>>>>> <reporting>
>>>>>>
>>>>>> as you can see, I tried many things. I looked the clover site, 
>>>>>> search mailing lists but nothing...
>>>>>> I even looked into the plugin source code : it seems that it does 
>>>>>> not handle "statementContext".
>>>>>> But since even the "try" context does not work...
>>>>>>
>>>>>> Any help will be greatly appreciated, thanks
>>>>>>
>>>>>> David


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: maven 2, clover and contexts

Posted by Vincent Massol <vi...@massol.net>.
On Jan 21, 2007, at 1:25 AM, c_inconnu2 wrote:

> That works !

Documentation updated.

> Thanks for your help. Is there any plan to support  
> "statementContext" in the plugin ?

We need to support it but it's not done yet. Create a JIRA issue if  
it's not there already. I'll probably be able to spend some time on  
the plugin end of next week.

> I'd like to exclude all my loggers... BTW, I'll try to understand  
> how that works and see if i can contribute

Cool!

Thanks
-Vincent

>
> David DIDIER
>
> Vincent Massol a écrit :
>> Hi David,
>>
>> I think the reason is because the <contextFilter> configuration  
>> element is a property of the report mojo and thus it needs to be  
>> defined in the <reporting> section and not in the <build> section.  
>> For example:
>>
>> <reporting>
>>     <excludeDefaults>true</excludeDefaults>
>>     <plugins>
>>       <plugin>
>>         <groupId>org.apache.maven.plugins</groupId>
>>         <artifactId>maven-clover-plugin</artifactId>
>>         <configuration>
>>           <!-- Verify that context filters work -->
>>           <contextFilters>try</contextFilters>
>>         </configuration>
>>       </plugin>
>>     </plugins>
>>   </reporting>
>>
>> Let me know if this works for you and I'll update the documentation.
>>
>> Thanks
>> -Vincent
>>
>> On Jan 18, 2007, at 11:07 PM, c_inconnu2 wrote:
>>
>>> Hi Vincent,
>>>
>>> Thanks for your answer. Indeed there is no reason that it should  
>>> work : I was just wondering...
>>> But I tried to use contextFilters and I cannot manage to get it  
>>> work either. Here is a part of my pom :
>>>
>>>    <reporting>
>>>        <plugins>
>>>            <plugin>
>>>                <groupId>org.apache.maven.plugins</groupId>
>>>                <artifactId>maven-clover-plugin</artifactId>
>>>            </plugin>
>>>
>>>            <plugin>
>>>                <groupId>org.codehaus.mojo</groupId>
>>>                <artifactId>surefire-report-maven-plugin</artifactId>
>>>            </plugin>
>>>        </plugins>
>>>    </reporting>
>>>
>>>    <build>
>>>        <plugins>
>>>            <plugin>
>>>                <groupId>org.apache.maven.plugins</groupId>
>>>                <artifactId>maven-compiler-plugin</artifactId>
>>>                <configuration>
>>>                    <source>1.5</source>
>>>                    <target>1.5</target>
>>>                    <showDeprecation>true</showDeprecation>
>>>                </configuration>
>>>            </plugin>
>>>
>>>            <plugin>
>>>                <groupId>org.apache.maven.plugins</groupId>
>>>                <artifactId>maven-clover-plugin</artifactId>
>>>                <configuration>
>>>                    <jdk>1.5</jdk>
>>>                    <contextFilters>try</contextFilters>
>>>                </configuration>
>>>                <executions>
>>>                    <execution>
>>>                        <phase>pre-site</phase>
>>>                        <goals>
>>>                            <goal>instrument</goal>
>>>                        </goals>
>>>                    </execution>
>>>                </executions>
>>>            </plugin>
>>>        </plugins>
>>>    </build>
>>>
>>> I tested with this :
>>>
>>> public static String f()
>>>    {
>>>        try
>>>        {
>>>            if(true){
>>>                Class.forName("AAA");                        }
>>>            Class.forName("BBB");
>>>        }
>>>        catch (Exception e)
>>>        {
>>>            // TODO: handle exception
>>>        }
>>>        return "f";
>>>    }
>>>
>>> If I understand, the line Class.forName("BBB"); should be  
>>> reported as not tested ???
>>> But it is in red in the report ("statement not executed"). And  
>>> Class.forName("AAA"); was executed
>>>
>>> Thanks for your help
>>>
>>> Vincent Massol a écrit :
>>>> Hi David,
>>>>
>>>> Why are you assuming that <statementContext> would work?
>>>>
>>>> Just check the plugin documentation and you'll see that the  
>>>> correct tag name is <contextFilters>. Just check the  
>>>> documentation for more details and examples.
>>>>
>>>> Thanks
>>>> -Vincent
>>>>
>>>> On Jan 17, 2007, at 11:46 PM, c_inconnu2 wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I am trying to configure Clover to use "contextFilters" with  
>>>>> "statementContext". Here is my pom.xml :
>>>>>
>>>>> <reporting>
>>>>>        <plugins>
>>>>>            ...
>>>>>            <plugin>
>>>>>                <groupId>org.apache.maven.plugins</groupId>
>>>>>                <artifactId>maven-clover-plugin</artifactId>
>>>>>                <configuration>
>>>>>                    <jdk>1.5</jdk>
>>>>>                    <excludes>
>>>>>                        <exclude>**/*AllTests.java</exclude>
>>>>>                        <exclude>**/*Main.java</exclude>
>>>>>                        <exclude>**/*Main$*.java</exclude>
>>>>>                        <exclude>**/*Test.java</exclude>
>>>>>                        <exclude>**/*Test$*.java</exclude>
>>>>>                    </excludes>
>>>>>                    <statementContext name="log" regexp="^logger 
>>>>> \..*" />
>>>>>                    <!--statementContext name="iflog"  
>>>>> regexp="^if \(logger\.is.*" /-->
>>>>>                    <statementContext name="iflog" regexp="if.?.? 
>>>>> log.*\.isDebugEnabled.*}" />
>>>>>                    <!--contextFilters>log,iflog</contextFilters-->
>>>>>                    <contextFilters>try</contextFilters>
>>>>>                </configuration>
>>>>>            </plugin>
>>>>>            ...
>>>>>        <plugins>
>>>>> <reporting>
>>>>>
>>>>> as you can see, I tried many things. I looked the clover site,  
>>>>> search mailing lists but nothing...
>>>>> I even looked into the plugin source code : it seems that it  
>>>>> does not handle "statementContext".
>>>>> But since even the "try" context does not work...
>>>>>
>>>>> Any help will be greatly appreciated, thanks
>>>>>
>>>>> David
>>>>>
>>>>
>>>
>>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>


	

	
		
___________________________________________________________________________ 
Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et son interface révolutionnaire.
http://fr.mail.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: maven 2, clover and contexts

Posted by c_inconnu2 <c_...@yahoo.fr>.
That works ! Thanks for your help. Is there any plan to support 
"statementContext" in the plugin ? I'd like to exclude all my loggers... 
BTW, I'll try to understand how that works and see if i can contribute

David DIDIER

Vincent Massol a écrit :
> Hi David,
>
> I think the reason is because the <contextFilter> configuration 
> element is a property of the report mojo and thus it needs to be 
> defined in the <reporting> section and not in the <build> section. For 
> example:
>
> <reporting>
>     <excludeDefaults>true</excludeDefaults>
>     <plugins>
>       <plugin>
>         <groupId>org.apache.maven.plugins</groupId>
>         <artifactId>maven-clover-plugin</artifactId>
>         <configuration>
>           <!-- Verify that context filters work -->
>           <contextFilters>try</contextFilters>
>         </configuration>
>       </plugin>
>     </plugins>
>   </reporting>
>
> Let me know if this works for you and I'll update the documentation.
>
> Thanks
> -Vincent
>
> On Jan 18, 2007, at 11:07 PM, c_inconnu2 wrote:
>
>> Hi Vincent,
>>
>> Thanks for your answer. Indeed there is no reason that it should work 
>> : I was just wondering...
>> But I tried to use contextFilters and I cannot manage to get it work 
>> either. Here is a part of my pom :
>>
>>    <reporting>
>>        <plugins>
>>            <plugin>
>>                <groupId>org.apache.maven.plugins</groupId>
>>                <artifactId>maven-clover-plugin</artifactId>
>>            </plugin>
>>
>>            <plugin>
>>                <groupId>org.codehaus.mojo</groupId>
>>                <artifactId>surefire-report-maven-plugin</artifactId>
>>            </plugin>
>>        </plugins>
>>    </reporting>
>>
>>    <build>
>>        <plugins>
>>            <plugin>
>>                <groupId>org.apache.maven.plugins</groupId>
>>                <artifactId>maven-compiler-plugin</artifactId>
>>                <configuration>
>>                    <source>1.5</source>
>>                    <target>1.5</target>
>>                    <showDeprecation>true</showDeprecation>
>>                </configuration>
>>            </plugin>
>>
>>            <plugin>
>>                <groupId>org.apache.maven.plugins</groupId>
>>                <artifactId>maven-clover-plugin</artifactId>
>>                <configuration>
>>                    <jdk>1.5</jdk>
>>                    <contextFilters>try</contextFilters>
>>                </configuration>
>>                <executions>
>>                    <execution>
>>                        <phase>pre-site</phase>
>>                        <goals>
>>                            <goal>instrument</goal>
>>                        </goals>
>>                    </execution>
>>                </executions>
>>            </plugin>
>>        </plugins>
>>    </build>
>>
>> I tested with this :
>>
>> public static String f()
>>    {
>>        try
>>        {
>>            if(true){
>>                Class.forName("AAA");                        }
>>            Class.forName("BBB");
>>        }
>>        catch (Exception e)
>>        {
>>            // TODO: handle exception
>>        }
>>        return "f";
>>    }
>>
>> If I understand, the line Class.forName("BBB"); should be reported as 
>> not tested ???
>> But it is in red in the report ("statement not executed"). And 
>> Class.forName("AAA"); was executed
>>
>> Thanks for your help
>>
>> Vincent Massol a écrit :
>>> Hi David,
>>>
>>> Why are you assuming that <statementContext> would work?
>>>
>>> Just check the plugin documentation and you'll see that the correct 
>>> tag name is <contextFilters>. Just check the documentation for more 
>>> details and examples.
>>>
>>> Thanks
>>> -Vincent
>>>
>>> On Jan 17, 2007, at 11:46 PM, c_inconnu2 wrote:
>>>
>>>> Hi,
>>>>
>>>> I am trying to configure Clover to use "contextFilters" with 
>>>> "statementContext". Here is my pom.xml :
>>>>
>>>> <reporting>
>>>>        <plugins>
>>>>            ...
>>>>            <plugin>
>>>>                <groupId>org.apache.maven.plugins</groupId>
>>>>                <artifactId>maven-clover-plugin</artifactId>
>>>>                <configuration>
>>>>                    <jdk>1.5</jdk>
>>>>                    <excludes>
>>>>                        <exclude>**/*AllTests.java</exclude>
>>>>                        <exclude>**/*Main.java</exclude>
>>>>                        <exclude>**/*Main$*.java</exclude>
>>>>                        <exclude>**/*Test.java</exclude>
>>>>                        <exclude>**/*Test$*.java</exclude>
>>>>                    </excludes>
>>>>                    <statementContext name="log" 
>>>> regexp="^logger\..*" />
>>>>                    <!--statementContext name="iflog" regexp="^if 
>>>> \(logger\.is.*" /-->
>>>>                    <statementContext name="iflog" 
>>>> regexp="if.?.?log.*\.isDebugEnabled.*}" />
>>>>                    <!--contextFilters>log,iflog</contextFilters-->
>>>>                    <contextFilters>try</contextFilters>
>>>>                </configuration>
>>>>            </plugin>
>>>>            ...
>>>>        <plugins>
>>>> <reporting>
>>>>
>>>> as you can see, I tried many things. I looked the clover site, 
>>>> search mailing lists but nothing...
>>>> I even looked into the plugin source code : it seems that it does 
>>>> not handle "statementContext".
>>>> But since even the "try" context does not work...
>>>>
>>>> Any help will be greatly appreciated, thanks
>>>>
>>>> David
>>>>
>>>
>>
>>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: maven 2, clover and contexts

Posted by Vincent Massol <vi...@massol.net>.
Hi David,

I think the reason is because the <contextFilter> configuration  
element is a property of the report mojo and thus it needs to be  
defined in the <reporting> section and not in the <build> section.  
For example:

<reporting>
     <excludeDefaults>true</excludeDefaults>
     <plugins>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-clover-plugin</artifactId>
         <configuration>
           <!-- Verify that context filters work -->
           <contextFilters>try</contextFilters>
         </configuration>
       </plugin>
     </plugins>
   </reporting>

Let me know if this works for you and I'll update the documentation.

Thanks
-Vincent

On Jan 18, 2007, at 11:07 PM, c_inconnu2 wrote:

> Hi Vincent,
>
> Thanks for your answer. Indeed there is no reason that it should  
> work : I was just wondering...
> But I tried to use contextFilters and I cannot manage to get it  
> work either. Here is a part of my pom :
>
>    <reporting>
>        <plugins>
>            <plugin>
>                <groupId>org.apache.maven.plugins</groupId>
>                <artifactId>maven-clover-plugin</artifactId>
>            </plugin>
>
>            <plugin>
>                <groupId>org.codehaus.mojo</groupId>
>                <artifactId>surefire-report-maven-plugin</artifactId>
>            </plugin>
>        </plugins>
>    </reporting>
>
>    <build>
>        <plugins>
>            <plugin>
>                <groupId>org.apache.maven.plugins</groupId>
>                <artifactId>maven-compiler-plugin</artifactId>
>                <configuration>
>                    <source>1.5</source>
>                    <target>1.5</target>
>                    <showDeprecation>true</showDeprecation>
>                </configuration>
>            </plugin>
>
>            <plugin>
>                <groupId>org.apache.maven.plugins</groupId>
>                <artifactId>maven-clover-plugin</artifactId>
>                <configuration>
>                    <jdk>1.5</jdk>
>                    <contextFilters>try</contextFilters>
>                </configuration>
>                <executions>
>                    <execution>
>                        <phase>pre-site</phase>
>                        <goals>
>                            <goal>instrument</goal>
>                        </goals>
>                    </execution>
>                </executions>
>            </plugin>
>        </plugins>
>    </build>
>
> I tested with this :
>
> public static String f()
>    {
>        try
>        {
>            if(true){
>                Class.forName("AAA");                        }
>            Class.forName("BBB");
>        }
>        catch (Exception e)
>        {
>            // TODO: handle exception
>        }
>        return "f";
>    }
>
> If I understand, the line Class.forName("BBB"); should be reported  
> as not tested ???
> But it is in red in the report ("statement not executed"). And  
> Class.forName("AAA"); was executed
>
> Thanks for your help
>
> Vincent Massol a écrit :
>> Hi David,
>>
>> Why are you assuming that <statementContext> would work?
>>
>> Just check the plugin documentation and you'll see that the  
>> correct tag name is <contextFilters>. Just check the documentation  
>> for more details and examples.
>>
>> Thanks
>> -Vincent
>>
>> On Jan 17, 2007, at 11:46 PM, c_inconnu2 wrote:
>>
>>> Hi,
>>>
>>> I am trying to configure Clover to use "contextFilters" with  
>>> "statementContext". Here is my pom.xml :
>>>
>>> <reporting>
>>>        <plugins>
>>>            ...
>>>            <plugin>
>>>                <groupId>org.apache.maven.plugins</groupId>
>>>                <artifactId>maven-clover-plugin</artifactId>
>>>                <configuration>
>>>                    <jdk>1.5</jdk>
>>>                    <excludes>
>>>                        <exclude>**/*AllTests.java</exclude>
>>>                        <exclude>**/*Main.java</exclude>
>>>                        <exclude>**/*Main$*.java</exclude>
>>>                        <exclude>**/*Test.java</exclude>
>>>                        <exclude>**/*Test$*.java</exclude>
>>>                    </excludes>
>>>                    <statementContext name="log" regexp="^logger 
>>> \..*" />
>>>                    <!--statementContext name="iflog" regexp="^if \ 
>>> (logger\.is.*" /-->
>>>                    <statementContext name="iflog" regexp="if.?.? 
>>> log.*\.isDebugEnabled.*}" />
>>>                    <!--contextFilters>log,iflog</contextFilters-->
>>>                    <contextFilters>try</contextFilters>
>>>                </configuration>
>>>            </plugin>
>>>            ...
>>>        <plugins>
>>> <reporting>
>>>
>>> as you can see, I tried many things. I looked the clover site,  
>>> search mailing lists but nothing...
>>> I even looked into the plugin source code : it seems that it does  
>>> not handle "statementContext".
>>> But since even the "try" context does not work...
>>>
>>> Any help will be greatly appreciated, thanks
>>>
>>> David
>>>
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>


	

	
		
___________________________________________________________________________ 
Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et son interface révolutionnaire.
http://fr.mail.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: maven 2, clover and contexts

Posted by c_inconnu2 <c_...@yahoo.fr>.
Hi Vincent,

Thanks for your answer. Indeed there is no reason that it should work : 
I was just wondering...
But I tried to use contextFilters and I cannot manage to get it work 
either. Here is a part of my pom :

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-clover-plugin</artifactId>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>surefire-report-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </reporting>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.5</source>
                    <target>1.5</target>
                    <showDeprecation>true</showDeprecation>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-clover-plugin</artifactId>
                <configuration>
                    <jdk>1.5</jdk>
                    <contextFilters>try</contextFilters>
                </configuration>
                <executions>
                    <execution>
                        <phase>pre-site</phase>
                        <goals>
                            <goal>instrument</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

I tested with this :

public static String f()
    {
        try
        {
            if(true){
                Class.forName("AAA");             
            }
            Class.forName("BBB");
        }
        catch (Exception e)
        {
            // TODO: handle exception
        }
        return "f";
    }

If I understand, the line Class.forName("BBB"); should be reported as 
not tested ???
But it is in red in the report ("statement not executed"). And 
Class.forName("AAA"); was executed

Thanks for your help

Vincent Massol a écrit :
> Hi David,
>
> Why are you assuming that <statementContext> would work?
>
> Just check the plugin documentation and you'll see that the correct 
> tag name is <contextFilters>. Just check the documentation for more 
> details and examples.
>
> Thanks
> -Vincent
>
> On Jan 17, 2007, at 11:46 PM, c_inconnu2 wrote:
>
>> Hi,
>>
>> I am trying to configure Clover to use "contextFilters" with 
>> "statementContext". Here is my pom.xml :
>>
>> <reporting>
>>        <plugins>
>>            ...
>>            <plugin>
>>                <groupId>org.apache.maven.plugins</groupId>
>>                <artifactId>maven-clover-plugin</artifactId>
>>                <configuration>
>>                    <jdk>1.5</jdk>
>>                    <excludes>
>>                        <exclude>**/*AllTests.java</exclude>
>>                        <exclude>**/*Main.java</exclude>
>>                        <exclude>**/*Main$*.java</exclude>
>>                        <exclude>**/*Test.java</exclude>
>>                        <exclude>**/*Test$*.java</exclude>
>>                    </excludes>
>>                    <statementContext name="log" regexp="^logger\..*" />
>>                    <!--statementContext name="iflog" regexp="^if 
>> \(logger\.is.*" /-->
>>                    <statementContext name="iflog" 
>> regexp="if.?.?log.*\.isDebugEnabled.*}" />
>>                    <!--contextFilters>log,iflog</contextFilters-->
>>                    <contextFilters>try</contextFilters>
>>                </configuration>
>>            </plugin>
>>            ...
>>        <plugins>
>> <reporting>
>>
>> as you can see, I tried many things. I looked the clover site, search 
>> mailing lists but nothing...
>> I even looked into the plugin source code : it seems that it does not 
>> handle "statementContext".
>> But since even the "try" context does not work...
>>
>> Any help will be greatly appreciated, thanks
>>
>> David
>>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: maven 2, clover and contexts

Posted by Vincent Massol <vi...@massol.net>.
Hi David,

Why are you assuming that <statementContext> would work?

Just check the plugin documentation and you'll see that the correct  
tag name is <contextFilters>. Just check the documentation for more  
details and examples.

Thanks
-Vincent

On Jan 17, 2007, at 11:46 PM, c_inconnu2 wrote:

> Hi,
>
> I am trying to configure Clover to use "contextFilters" with  
> "statementContext". Here is my pom.xml :
>
> <reporting>
>        <plugins>
>            ...
>            <plugin>
>                <groupId>org.apache.maven.plugins</groupId>
>                <artifactId>maven-clover-plugin</artifactId>
>                <configuration>
>                    <jdk>1.5</jdk>
>                    <excludes>
>                        <exclude>**/*AllTests.java</exclude>
>                        <exclude>**/*Main.java</exclude>
>                        <exclude>**/*Main$*.java</exclude>
>                        <exclude>**/*Test.java</exclude>
>                        <exclude>**/*Test$*.java</exclude>
>                    </excludes>
>                    <statementContext name="log" regexp="^logger 
> \..*" />
>                    <!--statementContext name="iflog" regexp="^if \ 
> (logger\.is.*" /-->
>                    <statementContext name="iflog" regexp="if.?.? 
> log.*\.isDebugEnabled.*}" />
>                    <!--contextFilters>log,iflog</contextFilters-->
>                    <contextFilters>try</contextFilters>
>                </configuration>
>            </plugin>
>            ...
>        <plugins>
> <reporting>
>
> as you can see, I tried many things. I looked the clover site,  
> search mailing lists but nothing...
> I even looked into the plugin source code : it seems that it does  
> not handle "statementContext".
> But since even the "try" context does not work...
>
> Any help will be greatly appreciated, thanks
>
> David
>


	

	
		
___________________________________________________________________________ 
Yahoo! Mail r�invente le mail ! D�couvrez le nouveau Yahoo! Mail et son interface r�volutionnaire.
http://fr.mail.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org