Skip to content
Permalink
Browse files

Add test for JENKINS-41134

  • Loading branch information...
slide committed Jan 25, 2017
1 parent 90e7ddb commit c0f470f994693d50d78491bde7deb938903ccd7e
@@ -150,6 +150,19 @@ public void testDuplicatedTestSuiteIsNotCounted() throws IOException, URISyntaxE
assertEquals("Wrong duration for test result", 1.0, testResult.getDuration(), 0.01);
}

@Issue("JENKINS-41134")
@Test
public void testMerge() throws IOException, URISyntaxException {
TestResult first = new TestResult();
TestResult second = new TestResult();

first.parse(getDataFile("JENKINS-41134/TestSuite_first.xml"));
second.parse(getDataFile("JENKINS-41134/TestSuite_second.xml"));
assertEquals("Fail count should be 0", 0, first.getFailCount());
first.merge(second);
assertEquals("Fail count should now be 1", 1, first.getFailCount());
}

private static final XStream XSTREAM = new XStream2();

static {
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuite name="TestSuite_first" tests="1" errors="0" failures="0" skip="0" timestamp="2012-04-05T10:50:00">
<testcase classname="TestFoo" name="bar" time="157.980" />
</testsuite>
</testsuites>
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuite name="TestSuite_second" tests="1" errors="0" failures="1" skip="0" timestamp="2012-04-05T10:50:00">
<testcase classname="TestFoo2" name="bar2" time="123.980">
<failure message="PROGRAM.cbl:2 Use a program name that matches the source file name" type="WARNING">
WARNING: Use a program name that matches the source file name
Category: COBOL Code Review – Naming Conventions
File: /project/PROGRAM.cbl
Line: 2
</failure>
</testcase>
</testsuite>
</testsuites>

0 comments on commit c0f470f

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