[
http://jira.codehaus.org/browse/MCOBERTURA-52?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_117205
]
Trond Andersen commented on MCOBERTURA-52:
------------------------------------------
I took a look at the code for this plugin with regards to the issue here. There
is
[InstrumentTaskTest|http://svn.codehaus.org/mojo/tags/cobertura-maven-plugin-2.2/src/test/java/org/codehaus/mojo/cobertura/tasks/InstrumentTaskTest.java]
which has very limited tests for configuration.
I tried to add the following to the testConfig method so that it now looks like
this:
{code:title=InstrumentTaskTest}
public void testConfig() throws Exception
{
ConfigInstrumentation config = new ConfigInstrumentation();
String demoIgnore = "org.codehaus.mojo.cobertura.demo.*";
String moreIgnore = "org.codehaus.mojo.cobertura.moredemo.*";
config.addIgnore(demoIgnore);
config.addIgnore(moreIgnore);
task.setConfig( config );
assertEquals( config, task.getConfig() );
task.execute();
assertFalse(task.getCmdLineArgs().getArgs().isEmpty());
assertEquals("--ignore", task.getCmdLineArgs().getArgs().get(0));
assertEquals(demoIgnore, task.getCmdLineArgs().getArgs().get(1));
assertEquals("--ignore", task.getCmdLineArgs().getArgs().get(2));
assertEquals(moreIgnore, task.getCmdLineArgs().getArgs().get(3));
}
{code}
As you see from the test that this plugin will add a new {{--ignore}} for each
ignore configuration that is included. Can anyone say something with regards to
if this is correct or not?
> Ignores and Excludes do nothing
> -------------------------------
>
> Key: MCOBERTURA-52
> URL: http://jira.codehaus.org/browse/MCOBERTURA-52
> Project: Maven 2.x Cobertura Plugin
> Issue Type: Bug
> Affects Versions: 2.0
> Environment: Windows
> Reporter: Jim Wilson
>
> After adding this to the POM:
> <build>
> <plugins>
> <plugin>
> <groupId>org.codehaus.mojo</groupId>
> <artifactId>cobertura-maven-plugin</artifactId>
> <configuration>
> <instrumentation>
> <excludes>
> <exclude>org/example/**/*Test.class</exclude>
> <exclude>${basedir}</exclude>
> </excludes>
> </instrumentation>
> <check>
> <haltOnFailure>false</haltOnFailure>
> </check>
> </configuration>
> <executions>
> <execution>
> <goals>
> <goal>clean</goal>
> </goals>
> </execution>
> </executions>
> </plugin>
> </plugins>
> </build>
> Cobertura still reports on all classes.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email