Surefire report includes other testcases in TEST-XXX.xml files
--------------------------------------------------------------

                 Key: SUREFIRE-312
                 URL: http://jira.codehaus.org/browse/SUREFIRE-312
             Project: Maven Surefire
          Issue Type: Bug
          Components: report plugin
    Affects Versions: 2.3
         Environment: Windows XP, JUnit
            Reporter: Claus Ibsen
            Priority: Minor
         Attachments: surefire-bug.JPG

I am a comitter on WebWork/XWork and we have changed to maven.

I have some strange behaviour using maven and running the unit tests using 
surefire.

I have discovered that surefire reports more testcases in it's TEST-XXX.xml 
files than there actually are testXXX methods for within the JUnit testcase.

As an example is this JUnit test file that has 13 methods for testing.

<testsuite errors="0" skipped="0" tests="13" time="0.015" failures="0" 
name="com.opensymphony.xwork2.interceptor.TimerInterceptorTest">

But in the bottom of the 
TEST-com.opensymphony.xwork2.interceptor.TimerInterceptorTest.xml file there 
are much more testcases listed (the 13 from the bottom is the correct tests):

  <testcase time="0.109" name="testModelDrivenGetsPushedOntoStack"/>
  <testcase time="0" name="testStackNotModifedForNormalAction"/>
  <testcase time="0.015" name="testInterception1"/>
  <testcase time="0" name="testInterception3"/>
  <testcase time="0" name="testInterception2"/>
  <testcase time="0" name="testBasicBlocked"/>
  <testcase time="0" name="testBasicAllowed"/>
  <testcase time="0" name="testAllSubpropertiesAllowed"/>
  <testcase time="0" name="testEnsureOnlyPropsBlocked"/>
  <testcase time="0" name="testAllSubpropertiesBlocked"/>
  <testcase time="0" name="testBasicBlockAll"/>
  <testcase time="0" name="testTreeBlocking"/>
  <testcase time="0" name="testIncludesAndExcludesMethodWithExcludeWildcard"/>
  <testcase time="0" name="testExcludesMethodWithWildCard"/>
  <testcase time="0" name="testInvokesActionInvocationIfNoErrors"/>
  <testcase time="0" 
name="testIncludesAndExcludesMethodWithIncludeWildcardAndNoMatches"/>
  <testcase time="0" name="testIncludesAndExcludesMethodAllWildCarded"/>
  <testcase time="0" name="testIncludesAndExcludesMethodWithIncludeWildcard"/>
  <testcase time="0" name="testIncludesMethod"/>
  <testcase time="0" name="testIncludesAndExcludesMethod"/>
  <testcase time="0.015" name="testNoValidateAction"/>
  <testcase time="0" name="testIncludesMethodWithWildcard"/>
  <testcase time="0" name="testExcludesMethod"/>
  <testcase time="0" name="testReturnsInputWithoutExecutingIfHasErrors"/>
  <testcase time="0" name="testErrorLevel"/>
  <testcase time="0" name="testInfoLevel"/>
  <testcase time="0" name="testInputMethod"/>
  <testcase time="0" name="testLogCategoryLevel"/>
  <testcase time="0" name="testDebugLevel"/>
  <testcase time="0" name="testWarnLevel"/>
  <testcase time="0" name="testFatalLevel"/>
  <testcase time="0" name="testLogCategory"/>
  <testcase time="0" name="testTraceLevel"/>
  <testcase time="0" name="testDefault"/>
  <testcase time="0" name="testNoNamespace"/>
  <testcase time="0" name="testTimerInterceptor"/>
  <testcase time="0" name="testInvalidLogLevel"/>

So when you generate the surefire report using: mvn surefire-report:report
The HTML report is wrong as it would list to many testcases when you browse 
each junit test class.


It can be tested by checking out the source code from XWork and run: mvn test.
URL: https://svn.opensymphony.com/svn/xwork/trunk

Se the attached image.

-- 
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

        

Reply via email to