[JGIT PATCH] Configure the maven surefire plugin to specifically include all tests
- From
Jonas Fonseca <fonseca@diku.dk>
- Date
- Sep 12, 2008, 08:40 UTC
- Message-ID
- <20080912084030.GA4964@diku.dk>
- In-Reply-To
- <9e85b2570809111851y756fdb3en2c17c69bf5ac444e@mail.gmail.com>
By default, the test cases named T000* were not included. With this patch maven reports that 508 tests have been run.
Signed-off-by: Jonas Fonseca <fonseca@diku.dk> --- jgit-maven/jgit/pom.xml | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-)
Imran M Yousuf <imran@smartitengineering.com> wrote Fri, Sep 12, 2008: > On Fri, Sep 12, 2008 at 6:00 AM, Jonas Fonseca <fonseca@diku.dk> wrote: > > When I run all the tests using maven (inside > > NetBeans or from the command line) it tells me: > > > > Tests run: 428, Failures: 0, Errors: 0, Skipped: 0 > > > > From the output it looks like the tests in the files named T000* are > > never run. However, where the breakage is (could be my setup) I don't > > know. Imran? > > > > Hmm, I will have to check it. Will come back with some feedback after > checking. Usually if a class is a TestCase then it should have run. I started looking for possible bug reports at jira.codehaus.org and found an issue for extendeding the default path patterns used for including and excluding tests. Maybe something like this patch is clean enough, at least it increases "my coverage" to 508 tests.
diff --git a/jgit-maven/jgit/pom.xml b/jgit-maven/jgit/pom.xml index a64f53c..a123470 100644 --- a/jgit-maven/jgit/pom.xml +++ b/jgit-maven/jgit/pom.xml @@ -158,6 +158,17 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. <encoding>UTF-8</encoding> </configuration> </plugin> + <plugin> + <artifactId>maven-surefire-plugin</artifactId> + <version>2.4.2</version> + <configuration> + <includes> + <include>**/*Test.java</include> + <include>**/*TestCase.java</include> + <include>**/T000*.java</include> + </includes> + </configuration> + </plugin> </plugins> </build> <dependencies>
-- 1.6.0.1.451.gc8d31 -- Jonas Fonseca