You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bu...@apache.org on 2014/03/23 21:52:03 UTC

[Bug 56305] New: AntUnitSuite using AntUnitTestCase as class name in XML reports instead of actual classname

https://issues.apache.org/bugzilla/show_bug.cgi?id=56305

            Bug ID: 56305
           Summary: AntUnitSuite using AntUnitTestCase as class name in
                    XML reports instead of actual classname
           Product: Ant
           Version: 1.9.3
          Hardware: Macintosh
            Status: NEW
          Severity: normal
          Priority: P2
         Component: AntUnit
          Assignee: notifications@ant.apache.org
          Reporter: viper2843@gmail.com

When I use the AntUnitSuite in conjunction with the <junit> task in an ant
build the resulting report XML uses "AntUnitTestCase" instead of the custom
class name 
where the AntUnitSuite is run from. Below is an example of a test I ran. This
causes parsers like Jenkins junit report to report incorrect packages outside
the scope of the project being tested.

Input Java code:
package com.example.ant;
@RunWith(AntUnitSuiteRunner.class)
public class ExampleTaskTest {
    public static TestSuite suite() throws URISyntaxException {
        URL resource =
ExampleTaskTest.class.getResource("/com/example/ant/ExampleTaskTest.xml");
        File file = new File(resource.toURI());
        return new AntUnitSuite(file, ExampleTaskTest.class);
    }
}

Actual result:
<testcase classname="org.apache.ant.antunit.junit3.AntUnitTestCase"
name="testMissingDestDir
[/Users/foo/dev/project/example/build/testresources/com/example/ant/ExampleTaskTest.xml
   ]" time="0.437" />

Desired result:
<testcase classname="com.example.ant.ExampleTaskTest" name="testMissingDestDir
[/Users/foo/dev/project/example/build/testresources/com/example/ant/ExampleTaskTest.xml
   ]" time="0.437" />

I also ran this test against the Maven Surefire plugin and it did give me the
desired result.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 56305] AntUnitSuite using AntUnitTestCase as class name in XML reports instead of actual classname

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56305

Stefan Bodewig <bo...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All

--- Comment #2 from Stefan Bodewig <bo...@apache.org> ---
(In reply to freeweb14 from comment #1)
> Created attachment 31430 [details]
> freeweb14@gmail.com freeweb14@gmail.com

Hi freeweb14 - I'm afraid you've attached your description to the wrong bug
ticket.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 56305] AntUnitSuite using AntUnitTestCase as class name in XML reports instead of actual classname

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56305

viper2843@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW

--- Comment #5 from viper2843@gmail.com ---
Correct. This is when I run AntUnit tests from the <junit> task. I have
confirmed that Surefire does produce correct XML reports whereas the
<junitreport> task does not.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 56305] AntUnitSuite using AntUnitTestCase as class name in XML reports instead of actual classname

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56305

Stefan Bodewig <bo...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #4 from Stefan Bodewig <bo...@apache.org> ---
this is about AntUnit tests you run via the <junit> task?  And surefire gets
things right.  Is this correct?

If so this is not a bug in AntUnit - since Surefire works - but in Ant's
optional tasks creating the report.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 56305] AntUnitSuite using AntUnitTestCase as class name in XML reports instead of actual classname

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56305

Stefan Bodewig <bo...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|AntUnit                     |Optional Tasks

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 56305] AntUnitSuite using AntUnitTestCase as class name in XML reports instead of actual classname

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56305

Antoine Levy-Lambert <an...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|1.9.3                       |1.9.4

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 56305] AntUnitSuite using AntUnitTestCase as class name in XML reports instead of actual classname

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56305

Stefan Bodewig <bo...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #31430|0                           |1
        is obsolete|                            |

--- Comment #3 from Stefan Bodewig <bo...@apache.org> ---
Comment on attachment 31430
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=31430
freeweb14@gmail.com freeweb14@gmail.com

not related to this issue at all

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 56305] AntUnitSuite using AntUnitTestCase as class name in XML reports instead of actual classname

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56305

freeweb14 <fr...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |freeweb14@gmail.com

--- Comment #1 from freeweb14 <fr...@gmail.com> ---
Created attachment 31430
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=31430&action=edit
freeweb14@gmail.com freeweb14@gmail.com

For example ca mycafile.pem becomes
<ca>
-----BEGIN CERTIFICATE-----
MIIHPTCCBSWgAwIBAgIBADANBgkqhkiG9w0BAQQFADB5MRAwDgYDVQQKEwdSb290
[...]
-----END CERTIFICATE-----
</ca>

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 56305] AntUnitSuite using AntUnitTestCase as class name in XML reports instead of actual classname

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=56305

--- Comment #6 from viper2843@gmail.com <vi...@gmail.com> ---
Created attachment 31808
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=31808&action=edit
Zip file of demonstration of the issue

In an effort to get this issue fixed, I have created a small example Java
project that demonstrates the issue. I have both an Ant file and Maven file
that runs two test classes: one traditional Java unit test and one AntUnit
test. The build files build the XML files that can be compared to see the
differences in the classname attribute.

-- 
You are receiving this mail because:
You are the assignee for the bug.