Skip to content
Permalink
Browse files

[JENKINS-51481] Parse error occur when NUnit report have categories

Improve testcase name when trim testsuite name.
  • Loading branch information...
nfalco79 committed May 27, 2018
1 parent b45f561 commit d714f7ad991531302aa2d70dce00d90b9ee74ea2

This file was deleted.

@@ -145,11 +145,11 @@ THE SOFTWARE.
<xsl:for-each select="*/test-case">
<xsl:variable name="testName">
<xsl:choose>
<xsl:when test="contains(@name, concat($suiteName, '.'))">
<xsl:when test="starts-with(@name, concat($suiteName, '.'))">
<xsl:value-of select="substring(@name, string-length($suiteName) + 2)"/>
</xsl:when>
<xsl:when test="contains(@name, $suiteName)">
<xsl:value-of select="substring-after(@name, $suiteName)"/>
<xsl:when test="starts-with(@name, $suiteName)">
<xsl:value-of select="substring(@name, string-length($suiteName) + 1)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@name"/>
@@ -102,7 +102,12 @@ protected void convertAndValidate(Class<? extends InputMetric> metricClass, Stri
inputMetric.convert(inputXMLFile, outputXMLFile);
XMLUnit.setIgnoreWhitespace(true);
Diff myDiff = new Diff(readXmlAsString(outputXMLFile), readXmlAsString(new File(this.getClass().getResource(expectedResultPath).toURI())));
try {
Assert.assertTrue("XSL transformation did not work " + myDiff, myDiff.similar());
} catch (Error e) {
System.err.println(readXmlAsString(outputXMLFile));
throw e;
}

//The generated output file must be valid
boolean outputResult = inputMetric.validateOutputFile(outputXMLFile);
@@ -45,7 +45,9 @@
{ "JENKINS-10911 skipped are ignored when failure is present before", 7 }, //
{ "Sample provided by http://nunit.org/files/testresult_25.txt", 8 }, //
{ "Sample provided by the 2.4.8 distribution", 9 }, //
{ "JENKINS-51481 report produced by DUnit to NUnit logger", 10 }
{ "JENKINS-51481 report produced by DUnit to NUnit logger", 10 }, //
{ "JENKINS-JENKINS-51556 works", 11 }, //
{ "JENKINS-JENKINS-51556 cause JEP-200 issue", 12 } //
});
}

0 comments on commit d714f7a

Please sign in to comment.
You can’t perform that action at this time.