diff --git a/pom.xml b/pom.xml index 58bb92c..b21f9ec 100755 --- a/pom.xml +++ b/pom.xml @@ -20,10 +20,10 @@ 1.8 1.8 3.14.0 - 1.8.0 - 5.8.0 + 1.8.2 + 5.8.2 2.7.6 - 1.4.11 + 1.9.0 5.0.0 diff --git a/src/main/java/org/pitest/junit5/JUnit5TestUnit.java b/src/main/java/org/pitest/junit5/JUnit5TestUnit.java index 8ca7c61..10eefec 100755 --- a/src/main/java/org/pitest/junit5/JUnit5TestUnit.java +++ b/src/main/java/org/pitest/junit5/JUnit5TestUnit.java @@ -26,13 +26,14 @@ import org.junit.platform.launcher.core.LauncherFactory; import org.pitest.testapi.AbstractTestUnit; import org.pitest.testapi.Description; +import org.pitest.testapi.ExecutedInDiscovery; import org.pitest.testapi.ResultCollector; /** * * @author Tobias Stadler */ -public class JUnit5TestUnit extends AbstractTestUnit { +public class JUnit5TestUnit extends AbstractTestUnit implements ExecutedInDiscovery { private final Class testClass; @@ -92,4 +93,9 @@ public void executionFinished(TestIdentifier testIdentifier, TestExecutionResult launcher.execute(launcherDiscoveryRequest); } + + @Override + public String toString() { + return "JUnit5TestUnit[" + testIdentifier.getUniqueId() + "]"; + } } diff --git a/src/main/java/org/pitest/junit5/JUnit5TestUnitFinder.java b/src/main/java/org/pitest/junit5/JUnit5TestUnitFinder.java index 5dac1ef..94cd9d4 100755 --- a/src/main/java/org/pitest/junit5/JUnit5TestUnitFinder.java +++ b/src/main/java/org/pitest/junit5/JUnit5TestUnitFinder.java @@ -26,7 +26,6 @@ import org.junit.platform.engine.Filter; import org.junit.platform.engine.TestExecutionResult; import org.junit.platform.engine.discovery.DiscoverySelectors; -import org.junit.platform.engine.support.descriptor.ClassSource; import org.junit.platform.engine.support.descriptor.MethodSource; import org.junit.platform.launcher.Launcher; import org.junit.platform.launcher.TagFilter; @@ -34,8 +33,10 @@ import org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder; import org.junit.platform.launcher.core.LauncherFactory; import org.junit.platform.launcher.listeners.SummaryGeneratingListener; +import org.pitest.testapi.Description; import org.pitest.testapi.TestGroupConfig; import org.pitest.testapi.TestUnit; +import org.pitest.testapi.TestUnitExecutionListener; import org.pitest.testapi.TestUnitFinder; /** @@ -57,7 +58,7 @@ public JUnit5TestUnitFinder(TestGroupConfig testGroupConfig, Collection } @Override - public List findTestUnits(Class clazz) { + public List findTestUnits(Class clazz, TestUnitExecutionListener executionListener) { if(clazz.getEnclosingClass() != null) { return emptyList(); } @@ -77,7 +78,8 @@ public List findTestUnits(Class clazz) { throw new IllegalArgumentException("Error creating tag filter", e); } - TestIdentifierListener listener = new TestIdentifierListener(); + TestIdentifierListener listener = new TestIdentifierListener(clazz, executionListener); + launcher.execute(LauncherDiscoveryRequestBuilder .request() .selectors(DiscoverySelectors.selectClass(clazz)) @@ -91,25 +93,33 @@ public List findTestUnits(Class clazz) { } private class TestIdentifierListener extends SummaryGeneratingListener { - private final List identifiers = new ArrayList<>(); - - List getIdentifiers() { - return unmodifiableList(identifiers); - } - - @Override - public void executionStarted(TestIdentifier testIdentifier) { - if (testIdentifier.isTest()) { - // filter out testMethods - if (includedTestMethods != null && !includedTestMethods.isEmpty() - && testIdentifier.getSource().isPresent() - && testIdentifier.getSource().get() instanceof MethodSource - && !includedTestMethods.contains(((MethodSource)testIdentifier.getSource().get()).getMethodName())) { - return; - } - identifiers.add(testIdentifier); - } - } + private final Class testClass; + private final TestUnitExecutionListener l; + private final List identifiers = new ArrayList<>(); + + public TestIdentifierListener(Class testClass, TestUnitExecutionListener l) { + this.testClass = testClass; + this.l = l; + } + + List getIdentifiers() { + return unmodifiableList(identifiers); + } + + @Override + public void executionStarted(TestIdentifier testIdentifier) { + if (testIdentifier.isTest()) { + // filter out testMethods + if (includedTestMethods != null && !includedTestMethods.isEmpty() + && testIdentifier.getSource().isPresent() + && testIdentifier.getSource().get() instanceof MethodSource + && !includedTestMethods.contains(((MethodSource)testIdentifier.getSource().get()).getMethodName())) { + return; + } + l.executionStarted(new Description(testIdentifier.getUniqueId(), testClass)); + identifiers.add(testIdentifier); + } + } @Override @@ -119,6 +129,9 @@ public void executionFinished(TestIdentifier testIdentifier, TestExecutionResult if (!identifiers.contains(testIdentifier)) { identifiers.add(testIdentifier); } + l.executionFinished(new Description(testIdentifier.getUniqueId(), testClass), false); + } else if (testIdentifier.isTest()) { + l.executionFinished(new Description(testIdentifier.getUniqueId(), testClass), true); } } diff --git a/src/test/java/org/pitest/junit5/JUnit5TestUnitFinderTest.java b/src/test/java/org/pitest/junit5/JUnit5TestUnitFinderTest.java index 6db12c3..25e9eac 100644 --- a/src/test/java/org/pitest/junit5/JUnit5TestUnitFinderTest.java +++ b/src/test/java/org/pitest/junit5/JUnit5TestUnitFinderTest.java @@ -17,10 +17,14 @@ import static java.util.Collections.emptyList; import static java.util.Collections.singletonList; import static org.assertj.core.api.Assertions.assertThat; + import org.junit.jupiter.api.Test; import org.pitest.junit5.cucumber.RunCucumberTest; +import org.pitest.junit5.repository.TestClassWithFailingTest; import org.pitest.junit5.repository.TestClassWithIncludedTestMethod; import org.pitest.junit5.repository.TestClassWithInheritedTestMethod; +import org.pitest.junit5.repository.TestClassWithMixedPassAndFail; +import org.pitest.junit5.repository.TestClassWithMultiplePassingTests; import org.pitest.junit5.repository.TestClassWithNestedAnnotationAndNestedTestAnnotation; import org.pitest.junit5.repository.TestClassWithNestedAnnotationAndNestedTestFactoryAnnotation; import org.pitest.junit5.repository.TestClassWithNestedAnnotationWithNestedAnnotationAndNestedTestAnnotation; @@ -34,106 +38,214 @@ import org.pitest.junit5.repository.TestClassWithTestFactoryAnnotation; import org.pitest.junit5.repository.TestClassWithTestTemplateAnnotation; import org.pitest.junit5.repository.TestClassWithoutAnnotations; +import org.pitest.testapi.Description; +import org.pitest.testapi.ExecutedInDiscovery; +import org.pitest.testapi.NullExecutionListener; import org.pitest.testapi.TestGroupConfig; +import org.pitest.testapi.TestUnit; +import org.pitest.testapi.TestUnitExecutionListener; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; /** - * * @author Tobias Stadler */ -public class JUnit5TestUnitFinderTest { +class JUnit5TestUnitFinderTest { + + @Test + void findsAndRunsBasicJupiterTests() { + findsAndRunsNTests(1, TestClassWithTestAnnotation.class); + } + + @Test + void findsAndRunsBasicJupiterTestsWhenMultiplePresent() { + findsAndRunsNTests(3, TestClassWithMultiplePassingTests.class); + } + + @Test + void descriptionsOfTestsRunDuringDiscoveryMatchThoseOfDiscoveredTests() { + JUnit5TestUnitFinder underTest = basicConfig(); + List runInDiscovery = run(underTest, TestClassWithMultiplePassingTests.class).started; + List discovered = underTest.findTestUnits(TestClassWithMultiplePassingTests.class, new NullExecutionListener()) + .stream() + .map(tu -> tu.getDescription()) + .collect(Collectors.toList()); + + assertThat(runInDiscovery).containsExactlyInAnyOrderElementsOf(discovered); + } + + @Test + void discoveredTestsAreMarkedAsExecuted() { + JUnit5TestUnitFinder underTest = basicConfig(); + List discovered = underTest.findTestUnits(TestClassWithMultiplePassingTests.class, + new NullExecutionListener()); + + assertThat(discovered).allMatch(tu -> tu instanceof ExecutedInDiscovery); + } - public JUnit5TestUnitFinderTest() { + @Test + void detectsFailingTests() { + findsAndRunsNTests(1, TestClassWithFailingTest.class); + nTestsFails(1, TestClassWithFailingTest.class); } @Test - public void testTestClassWithParameterizedTestAnnotation() { - assertThat(new JUnit5TestUnitFinder(new TestGroupConfig(), emptyList()).findTestUnits(TestClassWithParameterizedTestAnnotation.class)).hasSize(1); + void detectsErroringTestsWhenPassingTestsPresent() { + nTestsPass(2, TestClassWithMixedPassAndFail.class); + nTestsFails(2, TestClassWithMixedPassAndFail.class); } + @Test - public void testTestClassWithRepeatedTestAnnotation() { - assertThat(new JUnit5TestUnitFinder(new TestGroupConfig(), emptyList()).findTestUnits(TestClassWithRepeatedTestAnnotation.class)).hasSize(1); + void findsAndRunsParameterizedTests() { + findsAndRunsNTests(1, TestClassWithParameterizedTestAnnotation.class); } @Test - public void testTestClassWithTestAnnotation() { - assertThat(new JUnit5TestUnitFinder(new TestGroupConfig(), emptyList()).findTestUnits(TestClassWithTestAnnotation.class)).hasSize(1); + void findsAndRunsTestsWithRepeatedATestAnnotation() { + findsAndRunsNTests(1, TestClassWithRepeatedTestAnnotation.class); } @Test - public void testTestClassWithTestFactoryAnnotation() { - assertThat(new JUnit5TestUnitFinder(new TestGroupConfig(), emptyList()).findTestUnits(TestClassWithTestFactoryAnnotation.class)).hasSize(1); + void findsAndRunsTestsFromTestFactoryAnnotation() { + findsAndRunsNTests(1, TestClassWithTestFactoryAnnotation.class); } @Test - public void testTestClassWithTestTemplateAnnotation() { - assertThat(new JUnit5TestUnitFinder(new TestGroupConfig(), emptyList()).findTestUnits(TestClassWithTestTemplateAnnotation.class)).hasSize(1); + void findsAndRunsTestsFromTestTemplateAnnotation() { + findsAndRunsNTests(1, TestClassWithTestTemplateAnnotation.class); } @Test - public void testTestClassWithNestedAnnotationAndNestedTestAnnotation() { - assertThat(new JUnit5TestUnitFinder(new TestGroupConfig(), emptyList()).findTestUnits(TestClassWithNestedAnnotationAndNestedTestAnnotation.class)).hasSize(1); - assertThat(new JUnit5TestUnitFinder(new TestGroupConfig(), emptyList()).findTestUnits(TestClassWithNestedAnnotationAndNestedTestAnnotation.NestedClass.class)).isEmpty(); + void findsAndRunsTestsFromClassWithNestedAnnotationAndNestedTestAnnotation() { + findsAndRunsNTests(1, TestClassWithNestedAnnotationAndNestedTestAnnotation.class); + findsAndRunsNTests(0, TestClassWithNestedAnnotationAndNestedTestAnnotation.NestedClass.class); } @Test - public void testTestClassWithNestedAnnotationAndNestedTestFactoryAnnotation() { - assertThat(new JUnit5TestUnitFinder(new TestGroupConfig(), emptyList()).findTestUnits(TestClassWithNestedAnnotationAndNestedTestFactoryAnnotation.class)).hasSize(1); - assertThat(new JUnit5TestUnitFinder(new TestGroupConfig(), emptyList()).findTestUnits(TestClassWithNestedAnnotationAndNestedTestFactoryAnnotation.NestedClass.class)).isEmpty(); + void findsAndRunsTestsFromClassWithNestedAnnotationAndNestedTestFactoryAnnotation() { + findsAndRunsNTests(1, TestClassWithNestedAnnotationAndNestedTestFactoryAnnotation.class); + findsAndRunsNTests(0, TestClassWithNestedAnnotationAndNestedTestFactoryAnnotation.NestedClass.class); } @Test - public void testTestClassWithNestedAnnotationWithNestedAnnotationAndNestedTestAnnotation() { - assertThat(new JUnit5TestUnitFinder(new TestGroupConfig(), emptyList()).findTestUnits(TestClassWithNestedAnnotationWithNestedAnnotationAndNestedTestAnnotation.class)).hasSize(1); - assertThat(new JUnit5TestUnitFinder(new TestGroupConfig(), emptyList()).findTestUnits(TestClassWithNestedAnnotationWithNestedAnnotationAndNestedTestAnnotation.NestedClass.class)).isEmpty(); - assertThat(new JUnit5TestUnitFinder(new TestGroupConfig(), emptyList()).findTestUnits(TestClassWithNestedAnnotationWithNestedAnnotationAndNestedTestAnnotation.NestedClass.NestedNestedClass.class)).isEmpty(); + void findsAndRunsTestsWhenMultipleNesting() { + findsAndRunsNTests(1, TestClassWithNestedAnnotationWithNestedAnnotationAndNestedTestAnnotation.class); + findsAndRunsNTests(0, TestClassWithNestedAnnotationWithNestedAnnotationAndNestedTestAnnotation.NestedClass.class); + findsAndRunsNTests(0, TestClassWithNestedAnnotationWithNestedAnnotationAndNestedTestAnnotation.NestedClass.NestedNestedClass.class); } @Test - public void testTestClassWithNestedAnnotationWithNestedAnnotationAndNestedTestFactoryAnnotation() { - assertThat(new JUnit5TestUnitFinder(new TestGroupConfig(), emptyList()).findTestUnits(TestClassWithNestedAnnotationWithNestedAnnotationAndNestedTestFactoryAnnotation.class)).hasSize(1); - assertThat(new JUnit5TestUnitFinder(new TestGroupConfig(), emptyList()).findTestUnits(TestClassWithNestedAnnotationWithNestedAnnotationAndNestedTestFactoryAnnotation.NestedClass.class)).isEmpty(); - assertThat(new JUnit5TestUnitFinder(new TestGroupConfig(), emptyList()).findTestUnits(TestClassWithNestedAnnotationWithNestedAnnotationAndNestedTestFactoryAnnotation.NestedClass.NestedNestedClass.class)).isEmpty(); + void findsAndRunsTestsWhenMultipleNestingWithTestFactories() { + findsAndRunsNTests(1, TestClassWithNestedAnnotationWithNestedAnnotationAndNestedTestFactoryAnnotation.class); + findsAndRunsNTests(0, TestClassWithNestedAnnotationWithNestedAnnotationAndNestedTestFactoryAnnotation.NestedClass.class); + findsAndRunsNTests(0, TestClassWithNestedAnnotationWithNestedAnnotationAndNestedTestFactoryAnnotation.NestedClass.NestedNestedClass.class); } @Test - public void testTestClassWithoutAnnotations() { - assertThat(new JUnit5TestUnitFinder(new TestGroupConfig(), emptyList()).findTestUnits(TestClassWithoutAnnotations.class)).isEmpty(); + void findsNoTestsWhenNoTestAnnotations() { + findsAndRunsNTests(0, TestClassWithoutAnnotations.class); } @Test - public void testTestClassWithNestedClassWithNestedAnnotationAndNestedTestAnnotation() { - assertThat(new JUnit5TestUnitFinder(new TestGroupConfig(), emptyList()).findTestUnits(TestClassWithNestedClassWithNestedAnnotationAndNestedTestAnnotation.class)).isEmpty(); + void findsNoTestsInOuterClassWhenNestedAnnotationPresent() { + findsAndRunsNTests(0, TestClassWithNestedClassWithNestedAnnotationAndNestedTestAnnotation.class); } @Test - public void testTestClassWithNestedClassWithNestedAnnotationAndNestedTestFactoryAnnotation() { - assertThat(new JUnit5TestUnitFinder(new TestGroupConfig(), emptyList()).findTestUnits(TestClassWithNestedClassWithNestedAnnotationAndNestedTestFactoryAnnotation.class)).isEmpty(); + void findsNoTestsInOuterClassWhenNestedAnnotationPresentForFactory() { + findsAndRunsNTests(0, TestClassWithNestedClassWithNestedAnnotationAndNestedTestFactoryAnnotation.class); } @Test - public void testTestClassWithInheritedTestMethod() { - assertThat(new JUnit5TestUnitFinder(new TestGroupConfig(), emptyList()).findTestUnits(TestClassWithInheritedTestMethod.class)).hasSize(1); + void findsInheritedTests() { + findsAndRunsNTests(1, TestClassWithInheritedTestMethod.class); } @Test - public void testTestClassWithIncludedTestMethod() { - assertThat(new JUnit5TestUnitFinder(new TestGroupConfig(), singletonList("included")).findTestUnits(TestClassWithIncludedTestMethod.class)).hasSize(1); + void findsTestsIncludedByMethodName() { + findsAndRunsNTests(1, new JUnit5TestUnitFinder(new TestGroupConfig(), singletonList("included")), TestClassWithIncludedTestMethod.class); } @Test - public void testTestClassWithExcludedTag() { - assertThat(new JUnit5TestUnitFinder(new TestGroupConfig().withExcludedGroups("excluded"), emptyList()).findTestUnits(TestClassWithTags.class)).hasSize(3); + void excludesTestsByTag() { + findsAndRunsNTests(3, new JUnit5TestUnitFinder(new TestGroupConfig().withExcludedGroups("excluded"), emptyList()), TestClassWithTags.class); } @Test - public void testTestClassWithIncludedTag() { - assertThat(new JUnit5TestUnitFinder(new TestGroupConfig().withIncludedGroups("included"), emptyList()).findTestUnits(TestClassWithTags.class)).hasSize(1); + void includesTestsByTag() { + findsAndRunsNTests(1, new JUnit5TestUnitFinder(new TestGroupConfig().withIncludedGroups("included"), emptyList()), TestClassWithTags.class); } @Test - public void testRunCucumberTest() { - assertThat(new JUnit5TestUnitFinder(new TestGroupConfig(), emptyList()).findTestUnits(RunCucumberTest.class)).hasSize(1); + void findsAndRunsCucumberTests() { + findsAndRunsNTests(1, RunCucumberTest.class); + } + + private void findsAndRunsNTests(int n, Class clazz) { + findsAndRunsNTests(n, basicConfig(), clazz); + } + + private void findsAndRunsNTests(int n, JUnit5TestUnitFinder underTest, Class clazz) { + RecordingListener l = run(underTest, clazz); + assertThat(l.started).hasSize(n); + } + + private void nTestsPass(int n, Class clazz) { + RecordingListener l = run(basicConfig(), clazz); + assertThat(l.passed).hasSize(n); + } + + private void nTestsFails(int n, Class clazz) { + RecordingListener l = run(basicConfig(), clazz); + assertThat(l.failed).hasSize(n); + } + + private RecordingListener run(JUnit5TestUnitFinder underTest, Class clazz) { + RecordingListener l = new RecordingListener(); + underTest.findTestUnits(clazz, l); + return l; + } + + private JUnit5TestUnitFinder basicConfig() { + return new JUnit5TestUnitFinder(new TestGroupConfig(), emptyList()); } } + +class RecordingListener implements TestUnitExecutionListener { + List started = new ArrayList<>(); + List failed = new ArrayList<>(); + List passed = new ArrayList<>(); + TestUnitExecutionListener l = new TestUnitExecutionListener() { + @Override + public void executionStarted(Description description) { + started.add(description); + } + + @Override + public void executionFinished(Description description, boolean pass) { + if (pass) { + passed.add(description); + } else { + failed.add(description); + } + } + }; + + @Override + public void executionStarted(Description description) { + started.add(description); + } + + @Override + public void executionFinished(Description description, boolean pass) { + if (pass) { + passed.add(description); + } else { + failed.add(description); + } + } +} \ No newline at end of file diff --git a/src/test/java/org/pitest/junit5/JUnit5TestUnitTest.java b/src/test/java/org/pitest/junit5/JUnit5TestUnitTest.java index 9dab4d5..4a500e9 100644 --- a/src/test/java/org/pitest/junit5/JUnit5TestUnitTest.java +++ b/src/test/java/org/pitest/junit5/JUnit5TestUnitTest.java @@ -23,7 +23,9 @@ import org.junit.jupiter.api.Test; import org.pitest.junit5.repository.TestClassWithAbortingTest; +import org.pitest.junit5.repository.TestClassWithAfterAll; import org.pitest.junit5.repository.TestClassWithBeforeAll; +import org.pitest.junit5.repository.TestClassWithFailingAfterAll; import org.pitest.junit5.repository.TestClassWithFailingBeforeAll; import org.pitest.junit5.repository.TestClassWithFailingTest; import org.pitest.junit5.repository.TestClassWithInheritedTestMethod; @@ -34,6 +36,7 @@ import org.pitest.junit5.repository.TestClassWithTestAnnotation; import org.pitest.junit5.repository.TestClassWithTestFactoryAnnotation; import org.pitest.testapi.Description; +import org.pitest.testapi.NullExecutionListener; import org.pitest.testapi.ResultCollector; import org.pitest.testapi.TestGroupConfig; @@ -150,10 +153,29 @@ void testFailsWhenBeforeAllFails() { assertThat(resultCollector.getFailure()).isPresent(); } - + @Test + void runsAfterAlls() { + TestResultCollector resultCollector = findTestsIn(TestClassWithAfterAll.class); + + assertThat(resultCollector.getSkipped()).isEmpty(); + assertThat(resultCollector.getStarted()).hasSize(2); + assertThat(resultCollector.getFailure()).isEmpty(); + } + + @Test + void testFailsWhenAfterAllFails() { + TestResultCollector resultCollector = findTestsIn(TestClassWithFailingAfterAll.class); + + assertThat(resultCollector.getSkipped()).isEmpty(); + // We get 4 start notifications, 1 for each test and again for the container. Not clear + // what consequence this has. + //assertThat(resultCollector.getStarted()).hasSize(2); + assertThat(resultCollector.getFailure()).isPresent(); + } + private TestResultCollector findTestsIn(Class clazz) { TestResultCollector resultCollector = new TestResultCollector(); - new JUnit5TestUnitFinder(new TestGroupConfig(), emptyList()).findTestUnits(clazz) + new JUnit5TestUnitFinder(new TestGroupConfig(), emptyList()).findTestUnits(clazz, new NullExecutionListener()) .stream() .forEach(testUnit -> testUnit.execute(resultCollector)); return resultCollector; diff --git a/src/test/java/org/pitest/junit5/repository/TestClassWithAfterAll.java b/src/test/java/org/pitest/junit5/repository/TestClassWithAfterAll.java new file mode 100644 index 0000000..058f375 --- /dev/null +++ b/src/test/java/org/pitest/junit5/repository/TestClassWithAfterAll.java @@ -0,0 +1,22 @@ +package org.pitest.junit5.repository; + +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.Test; + +public class TestClassWithAfterAll { + + @AfterAll + static void hello() { + + } + + @Test + void aTest() { + + } + + @Test + void anotherTest() { + + } +} diff --git a/src/test/java/org/pitest/junit5/repository/TestClassWithFailingAfterAll.java b/src/test/java/org/pitest/junit5/repository/TestClassWithFailingAfterAll.java new file mode 100644 index 0000000..bffd566 --- /dev/null +++ b/src/test/java/org/pitest/junit5/repository/TestClassWithFailingAfterAll.java @@ -0,0 +1,24 @@ +package org.pitest.junit5.repository; + +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.fail; + +public class TestClassWithFailingAfterAll { + + @AfterAll + static void oops() { + fail(); + } + + @Test + void aTest() { + + } + + @Test + void anotherTest() { + + } +} diff --git a/src/test/java/org/pitest/junit5/repository/TestClassWithMixedPassAndFail.java b/src/test/java/org/pitest/junit5/repository/TestClassWithMixedPassAndFail.java new file mode 100644 index 0000000..22cdf63 --- /dev/null +++ b/src/test/java/org/pitest/junit5/repository/TestClassWithMixedPassAndFail.java @@ -0,0 +1,28 @@ +package org.pitest.junit5.repository; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.fail; + +public class TestClassWithMixedPassAndFail { + + @Test + void passingTest() { + + } + + @Test + void passingTest2() { + + } + + @Test + void failingTest() { + fail(); + } + + @Test + void erroringTest() { + throw new RuntimeException(); + } +} diff --git a/src/test/java/org/pitest/junit5/repository/TestClassWithMultiplePassingTests.java b/src/test/java/org/pitest/junit5/repository/TestClassWithMultiplePassingTests.java new file mode 100644 index 0000000..e8c6197 --- /dev/null +++ b/src/test/java/org/pitest/junit5/repository/TestClassWithMultiplePassingTests.java @@ -0,0 +1,21 @@ +package org.pitest.junit5.repository; + +import org.junit.jupiter.api.Test; + +public class TestClassWithMultiplePassingTests { + + @Test + void testOne() { + + } + + @Test + void testTwo() { + + } + + @Test + void testThree() { + + } +}