git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[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
Previous: Imran M YousufNext: Shawn O. Pearce
Message 5 of 10 in “Issue 23: Resolve tag^0 as tag^{commit}”
  1. 1/2 Issue 23: Resolve tag^0 as tag^{commit}Jonas Fonseca, Sep 11, 2008
  2. Robin RosenbergSep 11, 2008
  3. Jonas FonsecaSep 12, 2008
  4. Imran M YousufSep 12, 2008
  5. Configure the maven surefire plugin to specifically include all testsJonas Fonseca, Sep 12, 2008
  6. Shawn O. PearceSep 12, 2008
  7. Robin RosenbergSep 12, 2008
  8. 1/3 Fix IncorrectObjectTypeException thrown for incorrect ^{blob}Jonas Fonseca, Sep 12, 2008
  9. 2/3 Fix off by one distance during resolving of commit~NJonas Fonseca, Sep 12, 2008
  10. 3/3 Tests and fixes for dereferencing tags in Repository.resolve()Jonas Fonseca, Sep 12, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.