Clover ContextFilters

View: New views
5 Messages — Rating Filter:   Alert me  

Clover ContextFilters

by leojhartiv :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm trying to figure out if there's anything special I need to do in order to enable context filters in Sonar->Clover?

I have the following configuration in my POM:

<profiles>
                <profile>
                        <!--
                                This profile adds Clover test coverage reporting. Because of a
                                conflict between Atlassian and Maven, the clover process is
                                excessively long and at times, buggy. We'll disable it until the
                                bugs are resolved
                        -->
                        <id>clover</id>
                        <activation>
                                <property>
                                        <name>runClover</name>
                                        <value>true</value>
                                </property>
                        </activation>
                        <build>
                                <plugins>
                                        <plugin>
                                                <groupId>
                                                        com.atlassian.maven.plugins
                                                </groupId>
                                                <artifactId>
                                                        maven-clover2-plugin
                                                </artifactId>
                                                <version>${clover.version}</version>
                                                <dependencies>
                                                        <dependency>
                                                                <groupId>
                                                                        com.fidelity.shares
                                                                </groupId>
                                                                <artifactId>
                                                                        shares-build
                                                                </artifactId>
                                                                <version>${shares.version}</version>
                                                        </dependency>
                                                </dependencies>
                                                <configuration>
                                                        <statementContexts>
                                                                <Log>^(log|LOG)\..*</Log>
                                                                <IfLog>^if \((log|LOG)\.is.*</IfLog>
                                                                <IfThisLog>^if \(this\.log\.is.*</IfThisLog>
                                                                <ThisLog>^this\.log\..*</ThisLog>
                                                        </statementContexts>
                                                        <methodContexts>
                                                                <ToSymbol>(.* )?public String toSymbol\(\).*</ToSymbol>
                                                                <FromSymbol><![CDATA[(.* )?public static final [a-zA-Z0-9]* fromSymbol\((final )?String symbol\).*]]></FromSymbol>
                                                        </methodContexts>
                                                        <failOnViolation>false</failOnViolation>
                                                        <licenseLocation>
                                                                com/fidelity/shares/build/clover.license
                                                        </licenseLocation>
                                                        <jdk>1.5</jdk>
                                                        <targetPercentage>${clover.targetPercentage}</targetPercentage>
                                                </configuration>
                                        </plugin>
                                </plugins>
                        </build>
                        <reporting>
                                <plugins>
                                        <plugin>
                                                <groupId>
                                                        com.atlassian.maven.plugins
                                                </groupId>
                                                <artifactId>
                                                        maven-clover2-plugin
                                                </artifactId>
                                                <version>${clover.version}</version>
                                                <configuration>
                                                        <contextFilters>property,constructor,Log,IfLog,IfThisLog,ThisLog,ToSymbol,FromSymbol</contextFilters>
                                                        <generateXml>true</generateXml>
                                                        <generateHtml>true</generateHtml>
                                                        <reportDescriptor>${clover.config.file}</reportDescriptor>
                                                        <generateHistorical>true</generateHistorical>
                                                        <historyDir>${clover.historyDir}</historyDir>
                                                </configuration>
                                        </plugin>
                                </plugins>
                        </reporting>
                </profile>
</profiles>

When I run mvn -DrunClover=true clean clover2:instrument clover2:clover, my clover configuration is found, a clover report is generated and I see that my contextFilters are respected (setters and getters, etc are ignored).  

However, when I run: mvn -DrunClover=true clean install sonar:sonar, I'm noticing that sonar does recognize my license file, but it doesn't seem to use my contextFilter settings.  

Is there something I need to do specifically to get this to work?

Thanks!

Re: Clover ContextFilters

by Freddy Mallet :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi Leo,

Could you please send the content of the file target/sonar/sonar-pom.xml which is generated once the Maven Sonar plugin has been launched (mvn -DrunClover=true clean install sonar:sonar) ?

Thanks
Freddy


On Fri, Oct 16, 2009 at 8:26 PM, leojhartiv <leo.hart@...> wrote:

I'm trying to figure out if there's anything special I need to do in order to
enable context filters in Sonar->Clover?

I have the following configuration in my POM:

<profiles>
               <profile>
                       <!--
                               This profile adds Clover test coverage reporting. Because of a
                               conflict between Atlassian and Maven, the clover process is
                               excessively long and at times, buggy. We'll disable it until the
                               bugs are resolved
                       -->
                       <id>clover</id>
                       <activation>
                               <property>
                                       <name>runClover</name>
                                       <value>true</value>
                               </property>
                       </activation>
                       <build>
                               <plugins>
                                       <plugin>
                                               <groupId>
                                                       com.atlassian.maven.plugins
                                               </groupId>
                                               <artifactId>
                                                       maven-clover2-plugin
                                               </artifactId>
                                               <version>${clover.version}</version>
                                               <dependencies>
                                                       <dependency>
                                                               <groupId>
                                                                       com.fidelity.shares
                                                               </groupId>
                                                               <artifactId>
                                                                       shares-build
                                                               </artifactId>
                                                               <version>${shares.version}</version>
                                                       </dependency>
                                               </dependencies>
                                               <configuration>
                                                       <statementContexts>
                                                               <Log>^(log|LOG)\..*</Log>
                                                               <IfLog>^if \((log|LOG)\.is.*</IfLog>
                                                               <IfThisLog>^if \(this\.log\.is.*</IfThisLog>
                                                               <ThisLog>^this\.log\..*</ThisLog>
                                                       </statementContexts>
                                                       <methodContexts>
                                                               <ToSymbol>(.* )?public String toSymbol\(\).*</ToSymbol>
                                                               <FromSymbol><![CDATA[(.* )?public static final [a-zA-Z0-9]*
fromSymbol\((final )?String symbol\).*]]></FromSymbol>
                                                       </methodContexts>
                                                       <failOnViolation>false</failOnViolation>
                                                       <licenseLocation>
                                                               com/fidelity/shares/build/clover.license
                                                       </licenseLocation>
                                                       <jdk>1.5</jdk>
                                                       <targetPercentage>${clover.targetPercentage}</targetPercentage>
                                               </configuration>
                                       </plugin>
                               </plugins>
                       </build>
                       <reporting>
                               <plugins>
                                       <plugin>
                                               <groupId>
                                                       com.atlassian.maven.plugins
                                               </groupId>
                                               <artifactId>
                                                       maven-clover2-plugin
                                               </artifactId>
                                               <version>${clover.version}</version>
                                               <configuration>

<contextFilters>property,constructor,Log,IfLog,IfThisLog,ThisLog,ToSymbol,FromSymbol</contextFilters>
                                                       <generateXml>true</generateXml>
                                                       <generateHtml>true</generateHtml>
                                                       <reportDescriptor>${clover.config.file}</reportDescriptor>
                                                       <generateHistorical>true</generateHistorical>
                                                       <historyDir>${clover.historyDir}</historyDir>
                                               </configuration>
                                       </plugin>
                               </plugins>
                       </reporting>
               </profile>
</profiles>

When I run mvn -DrunClover=true clean clover2:instrument clover2:clover, my
clover configuration is found, a clover report is generated and I see that
my contextFilters are respected (setters and getters, etc are ignored).

However, when I run: mvn -DrunClover=true clean install sonar:sonar, I'm
noticing that sonar does recognize my license file, but it doesn't seem to
use my contextFilter settings.

Is there something I need to do specifically to get this to work?

Thanks!
--
View this message in context: http://www.nabble.com/Clover-ContextFilters-tp25930142p25930142.html
Sent from the Sonar user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email




Re: Clover ContextFilters

by leojhartiv :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Here it is.  Thanks!

Freddy Mallet wrote:
Hi Leo,

Could you please send the content of the file target/sonar/sonar-pom.xml
which is generated once the Maven Sonar plugin has been launched (mvn
-DrunClover=true clean install sonar:sonar) ?

Thanks
Freddy


On Fri, Oct 16, 2009 at 8:26 PM, leojhartiv <leo.hart@gmail.com> wrote:

>
> I'm trying to figure out if there's anything special I need to do in order
> to
> enable context filters in Sonar->Clover?
>
> I have the following configuration in my POM:
>
> <profiles>
>                <profile>
>                        <!--
>                                This profile adds Clover test coverage
> reporting. Because of a
>                                conflict between Atlassian and Maven, the
> clover process is
>                                excessively long and at times, buggy. We'll
> disable it until the
>                                bugs are resolved
>                        -->
>                        <id>clover</id>
>                        <activation>
>                                <property>
>                                        <name>runClover</name>
>                                        <value>true</value>
>                                </property>
>                        </activation>
>                        <build>
>                                <plugins>
>                                        <plugin>
>                                                <groupId>
>
>  com.atlassian.maven.plugins
>                                                </groupId>
>                                                <artifactId>
>                                                        maven-clover2-plugin
>                                                </artifactId>
>
>  <version>${clover.version}</version>
>                                                <dependencies>
>                                                        <dependency>
>                                                                <groupId>
>
>  com.fidelity.shares
>                                                                </groupId>
>                                                                <artifactId>
>
>  shares-build
>
>  </artifactId>
>
>  <version>${shares.version}</version>
>                                                        </dependency>
>                                                </dependencies>
>                                                <configuration>
>                                                        <statementContexts>
>
>  <Log>^(log|LOG)\..*</Log>
>                                                                <IfLog>^if
> \((log|LOG)\.is.*</IfLog>
>
>  <IfThisLog>^if \(this\.log\.is.*</IfThisLog>
>
>  <ThisLog>^this\.log\..*</ThisLog>
>                                                        </statementContexts>
>                                                        <methodContexts>
>
>  <ToSymbol>(.* )?public String toSymbol\(\).*</ToSymbol>
>
>  <FromSymbol><![CDATA[(.* )?public static final [a-zA-Z0-9]*
> fromSymbol\((final )?String symbol\).*]]></FromSymbol>
>                                                        </methodContexts>
>
>  <failOnViolation>false</failOnViolation>
>                                                        <licenseLocation>
>
>  com/fidelity/shares/build/clover.license
>                                                        </licenseLocation>
>                                                        <jdk>1.5</jdk>
>
>  <targetPercentage>${clover.targetPercentage}</targetPercentage>
>                                                </configuration>
>                                        </plugin>
>                                </plugins>
>                        </build>
>                        <reporting>
>                                <plugins>
>                                        <plugin>
>                                                <groupId>
>
>  com.atlassian.maven.plugins
>                                                </groupId>
>                                                <artifactId>
>                                                        maven-clover2-plugin
>                                                </artifactId>
>
>  <version>${clover.version}</version>
>                                                <configuration>
>
>
> <contextFilters>property,constructor,Log,IfLog,IfThisLog,ThisLog,ToSymbol,FromSymbol</contextFilters>
>
>  <generateXml>true</generateXml>
>
>  <generateHtml>true</generateHtml>
>
>  <reportDescriptor>${clover.config.file}</reportDescriptor>
>
>  <generateHistorical>true</generateHistorical>
>
>  <historyDir>${clover.historyDir}</historyDir>
>                                                </configuration>
>                                        </plugin>
>                                </plugins>
>                        </reporting>
>                </profile>
> </profiles>
>
> When I run mvn -DrunClover=true clean clover2:instrument clover2:clover, my
> clover configuration is found, a clover report is generated and I see that
> my contextFilters are respected (setters and getters, etc are ignored).
>
> However, when I run: mvn -DrunClover=true clean install sonar:sonar, I'm
> noticing that sonar does recognize my license file, but it doesn't seem to
> use my contextFilter settings.
>
> Is there something I need to do specifically to get this to work?
>
> Thanks!
> --
> View this message in context:
> http://www.nabble.com/Clover-ContextFilters-tp25930142p25930142.html
> Sent from the Sonar user mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>
sonar-pom.xml

Re: Clover ContextFilters

by Freddy Mallet :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Leo,

Moving the <contextFilters> node from the <reporting> section to the <build><plugins><plugin> section in the Clover <profile> should fix your issue.

Hope it helps,
Freddy

On Sun, Oct 18, 2009 at 8:55 PM, leojhartiv <leo.hart@...> wrote:

Here it is.  Thanks!


Freddy Mallet wrote:
>
> Hi Leo,
>
> Could you please send the content of the file target/sonar/sonar-pom.xml
> which is generated once the Maven Sonar plugin has been launched (mvn
> -DrunClover=true clean install sonar:sonar) ?
>
> Thanks
> Freddy
>
>
> On Fri, Oct 16, 2009 at 8:26 PM, leojhartiv <leo.hart@...> wrote:
>
>>
>> I'm trying to figure out if there's anything special I need to do in
>> order
>> to
>> enable context filters in Sonar->Clover?
>>
>> I have the following configuration in my POM:
>>
>> <profiles>
>>                <profile>
>>                        <!--
>>                                This profile adds Clover test coverage
>> reporting. Because of a
>>                                conflict between Atlassian and Maven, the
>> clover process is
>>                                excessively long and at times, buggy.
>> We'll
>> disable it until the
>>                                bugs are resolved
>>                        -->
>>                        <id>clover</id>
>>                        <activation>
>>                                <property>
>>                                        <name>runClover</name>
>>                                        <value>true</value>
>>                                </property>
>>                        </activation>
>>                        <build>
>>                                <plugins>
>>                                        <plugin>
>>                                                <groupId>
>>
>>  com.atlassian.maven.plugins
>>                                                </groupId>
>>                                                <artifactId>
>>
>> maven-clover2-plugin
>>                                                </artifactId>
>>
>>  <version>${clover.version}</version>
>>                                                <dependencies>
>>                                                        <dependency>
>>                                                                <groupId>
>>
>>  com.fidelity.shares
>>                                                                </groupId>
>>
>> <artifactId>
>>
>>  shares-build
>>
>>  </artifactId>
>>
>>  <version>${shares.version}</version>
>>                                                        </dependency>
>>                                                </dependencies>
>>                                                <configuration>
>>
>> <statementContexts>
>>
>>  <Log>^(log|LOG)\..*</Log>
>>                                                                <IfLog>^if
>> \((log|LOG)\.is.*</IfLog>
>>
>>  <IfThisLog>^if \(this\.log\.is.*</IfThisLog>
>>
>>  <ThisLog>^this\.log\..*</ThisLog>
>>
>> </statementContexts>
>>                                                        <methodContexts>
>>
>>  <ToSymbol>(.* )?public String toSymbol\(\).*</ToSymbol>
>>
>>  <FromSymbol><![CDATA[(.* )?public static final [a-zA-Z0-9]*
>> fromSymbol\((final )?String symbol\).*]]></FromSymbol>
>>                                                        </methodContexts>
>>
>>  <failOnViolation>false</failOnViolation>
>>                                                        <licenseLocation>
>>
>>  com/fidelity/shares/build/clover.license
>>                                                        </licenseLocation>
>>                                                        <jdk>1.5</jdk>
>>
>>  <targetPercentage>${clover.targetPercentage}</targetPercentage>
>>                                                </configuration>
>>                                        </plugin>
>>                                </plugins>
>>                        </build>
>>                        <reporting>
>>                                <plugins>
>>                                        <plugin>
>>                                                <groupId>
>>
>>  com.atlassian.maven.plugins
>>                                                </groupId>
>>                                                <artifactId>
>>
>> maven-clover2-plugin
>>                                                </artifactId>
>>
>>  <version>${clover.version}</version>
>>                                                <configuration>
>>
>>
>> <contextFilters>property,constructor,Log,IfLog,IfThisLog,ThisLog,ToSymbol,FromSymbol</contextFilters>
>>
>>  <generateXml>true</generateXml>
>>
>>  <generateHtml>true</generateHtml>
>>
>>  <reportDescriptor>${clover.config.file}</reportDescriptor>
>>
>>  <generateHistorical>true</generateHistorical>
>>
>>  <historyDir>${clover.historyDir}</historyDir>
>>                                                </configuration>
>>                                        </plugin>
>>                                </plugins>
>>                        </reporting>
>>                </profile>
>> </profiles>
>>
>> When I run mvn -DrunClover=true clean clover2:instrument clover2:clover,
>> my
>> clover configuration is found, a clover report is generated and I see
>> that
>> my contextFilters are respected (setters and getters, etc are ignored).
>>
>> However, when I run: mvn -DrunClover=true clean install sonar:sonar, I'm
>> noticing that sonar does recognize my license file, but it doesn't seem
>> to
>> use my contextFilter settings.
>>
>> Is there something I need to do specifically to get this to work?
>>
>> Thanks!
>> --
>> View this message in context:
>> http://www.nabble.com/Clover-ContextFilters-tp25930142p25930142.html
>> Sent from the Sonar user mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>    http://xircles.codehaus.org/manage_email
>>
>>
>>
>
>
http://www.nabble.com/file/p25949342/sonar-pom.xml sonar-pom.xml
--
View this message in context: http://www.nabble.com/Clover-ContextFilters-tp25930142p25949342.html
Sent from the Sonar user mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email




Re: Clover ContextFilters

by leojhartiv :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

That did the trick!  Thanks!

Freddy Mallet wrote:
Hi Leo,

Moving the <contextFilters> node from the <reporting> section to the
<build><plugins><plugin> section in the Clover <profile> should fix your
issue.

Hope it helps,
Freddy

On Sun, Oct 18, 2009 at 8:55 PM, leojhartiv <leo.hart@gmail.com> wrote:

>
> Here it is.  Thanks!
>
>
> Freddy Mallet wrote:
> >
> > Hi Leo,
> >
> > Could you please send the content of the file target/sonar/sonar-pom.xml
> > which is generated once the Maven Sonar plugin has been launched (mvn
> > -DrunClover=true clean install sonar:sonar) ?
> >
> > Thanks
> > Freddy
> >
> >
> > On Fri, Oct 16, 2009 at 8:26 PM, leojhartiv <leo.hart@gmail.com> wrote:
> >
> >>
> >> I'm trying to figure out if there's anything special I need to do in
> >> order
> >> to
> >> enable context filters in Sonar->Clover?
> >>
> >> I have the following configuration in my POM:
> >>
> >> <profiles>
> >>                <profile>
> >>                        <!--
> >>                                This profile adds Clover test coverage
> >> reporting. Because of a
> >>                                conflict between Atlassian and Maven, the
> >> clover process is
> >>                                excessively long and at times, buggy.
> >> We'll
> >> disable it until the
> >>                                bugs are resolved
> >>                        -->
> >>                        <id>clover</id>
> >>                        <activation>
> >>                                <property>
> >>                                        <name>runClover</name>
> >>                                        <value>true</value>
> >>                                </property>
> >>                        </activation>
> >>                        <build>
> >>                                <plugins>
> >>                                        <plugin>
> >>                                                <groupId>
> >>
> >>  com.atlassian.maven.plugins
> >>                                                </groupId>
> >>                                                <artifactId>
> >>
> >> maven-clover2-plugin
> >>                                                </artifactId>
> >>
> >>  <version>${clover.version}</version>
> >>                                                <dependencies>
> >>                                                        <dependency>
> >>                                                                <groupId>
> >>
> >>  com.fidelity.shares
> >>
>  </groupId>
> >>
> >> <artifactId>
> >>
> >>  shares-build
> >>
> >>  </artifactId>
> >>
> >>  <version>${shares.version}</version>
> >>                                                        </dependency>
> >>                                                </dependencies>
> >>                                                <configuration>
> >>
> >> <statementContexts>
> >>
> >>  <Log>^(log|LOG)\..*</Log>
> >>
>  <IfLog>^if
> >> \((log|LOG)\.is.*</IfLog>
> >>
> >>  <IfThisLog>^if \(this\.log\.is.*</IfThisLog>
> >>
> >>  <ThisLog>^this\.log\..*</ThisLog>
> >>
> >> </statementContexts>
> >>                                                        <methodContexts>
> >>
> >>  <ToSymbol>(.* )?public String toSymbol\(\).*</ToSymbol>
> >>
> >>  <FromSymbol><![CDATA[(.* )?public static final [a-zA-Z0-9]*
> >> fromSymbol\((final )?String symbol\).*]]></FromSymbol>
> >>                                                        </methodContexts>
> >>
> >>  <failOnViolation>false</failOnViolation>
> >>                                                        <licenseLocation>
> >>
> >>  com/fidelity/shares/build/clover.license
> >>
>  </licenseLocation>
> >>                                                        <jdk>1.5</jdk>
> >>
> >>  <targetPercentage>${clover.targetPercentage}</targetPercentage>
> >>                                                </configuration>
> >>                                        </plugin>
> >>                                </plugins>
> >>                        </build>
> >>                        <reporting>
> >>                                <plugins>
> >>                                        <plugin>
> >>                                                <groupId>
> >>
> >>  com.atlassian.maven.plugins
> >>                                                </groupId>
> >>                                                <artifactId>
> >>
> >> maven-clover2-plugin
> >>                                                </artifactId>
> >>
> >>  <version>${clover.version}</version>
> >>                                                <configuration>
> >>
> >>
> >>
> <contextFilters>property,constructor,Log,IfLog,IfThisLog,ThisLog,ToSymbol,FromSymbol</contextFilters>
> >>
> >>  <generateXml>true</generateXml>
> >>
> >>  <generateHtml>true</generateHtml>
> >>
> >>  <reportDescriptor>${clover.config.file}</reportDescriptor>
> >>
> >>  <generateHistorical>true</generateHistorical>
> >>
> >>  <historyDir>${clover.historyDir}</historyDir>
> >>                                                </configuration>
> >>                                        </plugin>
> >>                                </plugins>
> >>                        </reporting>
> >>                </profile>
> >> </profiles>
> >>
> >> When I run mvn -DrunClover=true clean clover2:instrument clover2:clover,
> >> my
> >> clover configuration is found, a clover report is generated and I see
> >> that
> >> my contextFilters are respected (setters and getters, etc are ignored).
> >>
> >> However, when I run: mvn -DrunClover=true clean install sonar:sonar, I'm
> >> noticing that sonar does recognize my license file, but it doesn't seem
> >> to
> >> use my contextFilter settings.
> >>
> >> Is there something I need to do specifically to get this to work?
> >>
> >> Thanks!
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Clover-ContextFilters-tp25930142p25930142.html
> >> Sent from the Sonar user mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe from this list, please visit:
> >>
> >>    http://xircles.codehaus.org/manage_email
> >>
> >>
> >>
> >
> >
> http://www.nabble.com/file/p25949342/sonar-pom.xml sonar-pom.xml
> --
> View this message in context:
> http://www.nabble.com/Clover-ContextFilters-tp25930142p25949342.html
> Sent from the Sonar user mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>