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

Alexander Lehmann commented on JBEHAVE-655:
-------------------------------------------

The problem comes from the conversion of the jbehave xml to junit xml 
(jbehave-3.x-to-junit.xsl), this contains the following rule:

{quote}
        <xsl:variable name="storyTitle">
                <xsl:choose>
                        <xsl:when test="string(//story/@title)">
                                <xsl:value-of select="//story/@title" />
                        </xsl:when>
                        <xsl:otherwise>
                                <xsl:value-of select="//story/@path" />
                        </xsl:otherwise>
                </xsl:choose>
         </xsl:variable>
{quote}

this will put story/title into the testsuite/name attribute which usually 
contains the full classname of the test class (e.g. 
org.jbehave.core.steps.StepsBehaviour), this is evaluated in the xunit plugin 
as the package and classname of the test.

Now, if title contains a commment or description, the package is empty (i.e. 
(root)) and the classname is the complete string contained in the title 
attribute. If the title is empty however, the testsuite/name attribute contains 
the path of the story file (e.g. org/jbehave/stories/sometest.story), which 
looks ok in the xunit display.

I would suggest to always use the path attribute, but I'm not quite sure how 
the xsl rule was intended, maybe whoever wrote the xsl can comment on that.


                
> a comment before "Scenario" ends up as package name in jbehave-plugin-jenkins
> -----------------------------------------------------------------------------
>
>                 Key: JBEHAVE-655
>                 URL: https://jira.codehaus.org/browse/JBEHAVE-655
>             Project: JBehave
>          Issue Type: Bug
>          Components: Jenkins Support
>    Affects Versions: 3.5.4
>         Environment: jenkins 1.442, Jenkins xUnit plugin 1.32, JBehave 
> Jenkins Plugin 3.5.4
>            Reporter: Alexander Lehmann
>            Priority: Minor
>
> When I run a story that has a comment as the first line of the text, the 
> jbehave/xunit display in Jenkins takes the comment as test name and misses 
> the story file name.
> {{!-- comment
> Scenario: User visits home page
> !-- a very simple test
> Given user is on Home page
> Then Home page is shown
> }}
> the resulting path is then (root)/!-- comment/User visits home page

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

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to