Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[JENKINS-10911] xUnit not detecting Ignored MSTest and NUnit Tests
Support skipped testcase for MSTest using Inconclusive value for outcome attribute of the UnitTestResult XML element.
- Loading branch information
Showing
14 changed files
with
311 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
89 changes: 45 additions & 44 deletions
89
src/test/java/org/jenkinsci/plugins/xunit/types/MSTestTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,57 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2010 Thales Corporate Services SAS * | ||
* Author : Gregory Boissinot * | ||
* * | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy * | ||
* of this software and associated documentation files (the "Software"), to deal* | ||
* in the Software without restriction, including without limitation the rights * | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * | ||
* copies of the Software, and to permit persons to whom the Software is * | ||
* furnished to do so, subject to the following conditions: * | ||
* * | ||
* The above copyright notice and this permission notice shall be included in * | ||
* all copies or substantial portions of the Software. * | ||
* * | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,* | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * | ||
* THE SOFTWARE. * | ||
*******************************************************************************/ | ||
|
||
/* | ||
* The MIT License (MIT) | ||
* | ||
* Copyright (c) 2014, Gregory Boissinot, Falco Nikolas | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
* THE SOFTWARE. | ||
*/ | ||
package org.jenkinsci.plugins.xunit.types; | ||
|
||
import org.junit.Test; | ||
import java.util.Arrays; | ||
import java.util.Collection; | ||
|
||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.junit.runners.Parameterized; | ||
import org.junit.runners.Parameterized.Parameters; | ||
|
||
@RunWith(Parameterized.class) | ||
public class MSTestTest extends AbstractTest { | ||
|
||
@Test | ||
public void testTransformationCase1() throws Exception { | ||
convertAndValidate(MSTest.class, "mstest/mstest_2_tests_1_class.trx", "mstest/junit_mstest_2_tests_1_class.xml"); | ||
} | ||
|
||
@Test | ||
public void testTransformationCase2() throws Exception { | ||
convertAndValidate(MSTest.class, "mstest/mstest_2_tests_from_different_assemblies.trx", "mstest/junit_mstest_2_tests_from_different_assemblies.xml"); | ||
} | ||
|
||
@Test | ||
public void testTransformationCase3() throws Exception { | ||
convertAndValidate(MSTest.class, "mstest/mstest_4_tests_2_classes.trx", "mstest/junit_mstest_4_tests_2_classes.xml"); | ||
@Parameters(name = "testcase{1}: {0}") | ||
public static Collection<Object[]> data() { | ||
return Arrays.asList(new Object[][] { { "mstest_2_tests_1_class", 1 }, // | ||
{ "mstest_2_tests_from_different_assemblies", 2 }, // | ||
{ "mstest_4_tests_2_classes", 3 }, // | ||
{ "mstest_vs_2010", 4 }, // | ||
{ "mstest_more_than_one_minute_test", 5 }, // | ||
{ "JENKINS-10911", 6 } // | ||
}); | ||
} | ||
|
||
@Test | ||
public void testTransformationCase4() throws Exception { | ||
convertAndValidate(MSTest.class, "mstest/mstest_vs_2010.trx", "mstest/junit_mstest_vs_2010.xml"); | ||
public MSTestTest(String testName, int testNumber) { | ||
super(MSTest.class, resolveInput("mstest", testNumber), resolveOutput("mstest", testNumber)); | ||
} | ||
|
||
@Override | ||
@Test | ||
public void testTransformationCase5() throws Exception { | ||
convertAndValidate(MSTest.class, "mstest/mstest_more_than_one_minute_test.trx", "mstest/junit_mstest_more_than-one_minute_test.xml"); | ||
public void verifyXSLT() throws Exception { | ||
super.verifyXSLT(); | ||
} | ||
} | ||
|
||
} |
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
...s/mstest/junit_mstest_2_tests_1_class.xml → ...s/xunit/types/mstest/testcase1/result.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.