[ 
https://jira.codehaus.org/browse/SUREFIRE-984?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=324338#comment-324338
 ] 

Andreas Gudian commented on SUREFIRE-984:
-----------------------------------------

Well, you're not gonna like this. I did some digging into the code and the 
reason you see the different class name is in the implementation of the 
{{org.junit.internal.runners.SuiteMethod}} runner (part of the 
{{JUnit38ClassRunner}} hierarchy). It unfolds all the (possibly nested) 
TestSuites down to the single TestCases and only then starts to create the 
JUnit4 {{Description}} objects that contain class and test name:

{code:title=org.junit.internal.runners.JUnit38ClassRunner.OldTestClassAdaptingListener}
    private Description asDescription(Test test) {
        if (test instanceof Describable) {
            Describable facade = (Describable) test;
            return facade.getDescription();
        }
        return Description.createTestDescription(getEffectiveClass(test), 
getName(test));
    }
{code}

So, not much Surefire can do there... And I guess adapting the JUnit3 provider 
to reproduce that stuff wouldn't be that great, either.

What's left for you would be (a hack): let your JellyCheck and FailedTest 
classes implement {{Describable}} and pass the suite class as parameter to 
JellyTestSuiteBuilder. Then create a {{Description}} instance using the suite 
class as {{testClass}}.

Not pretty, but if it fits your needs... ;)
                
> Different reporting format for 3.x custom suites when JUnit 4.7 provider 
> enabled
> --------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-984
>                 URL: https://jira.codehaus.org/browse/SUREFIRE-984
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: Junit 4.7+ (parallel) support
>         Environment: JDK 7u17, Ubuntu. git://github.com/jenkinsci/jenkins.git 
> @94f781c
>            Reporter: Jesse Glick
>            Assignee: Andreas Gudian
>            Priority: Minor
>
> In Jenkins sources, prepare with e.g. {{mvn -am -pl test -DskipTests 
> install}} then run
> {code:none}
> mvn -f test/pom.xml -Dtest=CoreJellyTest clean test
> {code}
> You will see these files in {{test/target/surefire-reports}}:
> {code:none}
> CoreJellyTest-output.txt
> CoreJellyTest.txt
> TEST-CoreJellyTest.xml
> {code}
> as expected. Now run:
> {code:none}
> mvn -f test/pom.xml -Dtest=CoreJellyTest 
> -DexcludedGroups=hudson.ExtensionPoint clean test
> {code}
> (This exclusion does not change what tests are run, only which Surefire 
> provider is used to run them.) You will see:
> {code:none}
> null-output.txt
> org.jvnet.hudson.test.JellyTestSuiteBuilder$JellyCheck-output.txt
> org.jvnet.hudson.test.JellyTestSuiteBuilder$JellyCheck.txt
> org.jvnet.hudson.test.junit.FailedTest.txt
> TEST-org.jvnet.hudson.test.JellyTestSuiteBuilder$JellyCheck.xml
> TEST-org.jvnet.hudson.test.junit.FailedTest.xml
> {code}
> As mentioned at the end of SUREFIRE-974, normally {{TEST-*.xml}} is named 
> according to the class defining the {{suite}} method, with {{classname}} 
> specifying the class extending {{TestSuite}}. But with {{excludedGroups}} the 
> result file is named according to the suite class ({{classname}} also 
> specifying this), and there is no indication anywhere of the name of the 
> class defining {{suite}}.
> Tried to build 2.15-SNAPSHOT from sources to check behavior there, but failed 
> with
> {code:none}
> Could not resolve dependencies for project 
> org.apache.maven.surefire:surefire-api:jar:2.15-SNAPSHOT: Could not find 
> artifact org.apache.maven.shared:maven-shared-utils:jar:0.4
> {code}
> maybe related to mirror config.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to