Permalink
Browse files

Rename methods in Test Kit

This commit renames methods in ExecutionResults for consistency.
  • Loading branch information...
sbrannen committed Oct 20, 2018
1 parent 86bc1c9 commit 629f02d332bd7c8ca470906559036b3420a3ec5d
Showing with 463 additions and 480 deletions.
  1. +3 −3 junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/AtypicalJvmMethodNameTests.java
  2. +2 −2 ...er-engine/src/test/java/org/junit/jupiter/engine/BeforeAllAndAfterAllComposedAnnotationTests.java
  3. +2 −2 ...-engine/src/test/java/org/junit/jupiter/engine/BeforeEachAndAfterEachComposedAnnotationTests.java
  4. +15 −15 junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/DefaultMethodTests.java
  5. +6 −6 junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/DisabledTests.java
  6. +36 −36 junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/DynamicNodeGenerationTests.java
  7. +15 −15 junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/ExceptionHandlingTests.java
  8. +4 −4 junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/FailedAssumptionsTests.java
  9. +6 −6 ...piter-engine/src/test/java/org/junit/jupiter/engine/InvalidLifecycleMethodConfigurationTests.java
  10. +15 −15 junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/NestedTestClassesTests.java
  11. +12 −12 junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/OverloadedTestMethodTests.java
  12. +4 −4 junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/ReportingTests.java
  13. +21 −21 junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/StandardTestClassTests.java
  14. +25 −25 junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/TestClassInheritanceTests.java
  15. +5 −5 ...upiter-engine/src/test/java/org/junit/jupiter/engine/TestInstanceLifecycleConfigurationTests.java
  16. +2 −2 junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/TestInstanceLifecycleKotlinTests.java
  17. +4 −4 junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/TestInstanceLifecycleTests.java
  18. +1 −1 junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/bridge/BridgeMethodTests.java
  19. +3 −3 ...est/java/org/junit/jupiter/engine/execution/UniqueIdParsingForArrayParameterIntegrationTests.java
  20. +2 −2 junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/BeforeAndAfterAllTests.java
  21. +40 −40 junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/BeforeAndAfterEachTests.java
  22. +35 −35 ...ne/src/test/java/org/junit/jupiter/engine/extension/BeforeAndAfterTestExecutionCallbackTests.java
  23. +12 −12 junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/ExecutionConditionTests.java
  24. +1 −1 ...piter-engine/src/test/java/org/junit/jupiter/engine/extension/ExtensionContextExecutionTests.java
  25. +49 −49 junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/ParameterResolverTests.java
  26. +5 −5 ...gine/src/test/java/org/junit/jupiter/engine/extension/ProgrammaticExtensionRegistrationTests.java
  27. +4 −4 ...upiter-engine/src/test/java/org/junit/jupiter/engine/extension/ScriptExecutionConditionTests.java
  28. +32 −32 junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/extension/TestInstanceFactoryTests.java
  29. +4 −4 ...piter-engine/src/test/java/org/junit/jupiter/engine/extension/TestInstancePostProcessorTests.java
  30. +12 −13 ...support/src/test/java/org/junit/jupiter/migrationsupport/rules/ExpectedExceptionSupportTests.java
  31. +8 −8 ...t/java/org/junit/jupiter/migrationsupport/rules/LauncherBasedEnableRuleMigrationSupportTests.java
  32. +78 −94 junit-platform-testkit/src/main/java/org/junit/platform/testkit/ExecutionResults.java
@@ -33,14 +33,14 @@
void kotlinTestWithMethodNameContainingSpecialCharacters() {
ExecutionResults executionResults = executeTestsForClass(
ArbitraryNamingKotlinTestCase.class).getExecutionResults();
assertThat(executionResults.getTestStartedCount()).isEqualTo(2);
assertThat(executionResults.getTestsStartedCount()).isEqualTo(2);
TestDescriptor testDescriptor1 = executionResults.getSuccessfulTestFinishedEvents().get(0).getTestDescriptor();
TestDescriptor testDescriptor1 = executionResults.getTestsSuccessfulEvents().get(0).getTestDescriptor();
assertAll(//
() -> assertEquals(METHOD_NAME + "()", testDescriptor1.getDisplayName()), //
() -> assertEquals(METHOD_NAME + "()", testDescriptor1.getLegacyReportingName()));
TestDescriptor testDescriptor2 = executionResults.getSuccessfulTestFinishedEvents().get(1).getTestDescriptor();
TestDescriptor testDescriptor2 = executionResults.getTestsSuccessfulEvents().get(1).getTestDescriptor();
assertAll(//
() -> assertEquals("test name ends with parentheses()()", testDescriptor2.getDisplayName()), //
() -> assertEquals("test name ends with parentheses()()", testDescriptor2.getLegacyReportingName()));
@@ -38,8 +38,8 @@
void beforeAllAndAfterAllAsMetaAnnotations() {
ExecutionResults executionResults = executeTestsForClass(TestCase.class).getExecutionResults();
assertEquals(1, executionResults.getTestStartedCount(), "# tests started");
assertEquals(1, executionResults.getTestSuccessfulCount(), "# tests succeeded");
assertEquals(1, executionResults.getTestsStartedCount(), "# tests started");
assertEquals(1, executionResults.getTestsSuccessfulCount(), "# tests succeeded");
assertEquals(asList("beforeAll", "test", "afterAll"), methodsInvoked);
}
@@ -38,8 +38,8 @@
void beforeEachAndAfterEachAsMetaAnnotations() {
ExecutionResults executionResults = executeTestsForClass(TestCase.class).getExecutionResults();
assertEquals(1, executionResults.getTestStartedCount(), "# tests started");
assertEquals(1, executionResults.getTestSuccessfulCount(), "# tests succeeded");
assertEquals(1, executionResults.getTestsStartedCount(), "# tests started");
assertEquals(1, executionResults.getTestsSuccessfulCount(), "# tests succeeded");
assertEquals(asList("beforeEach", "test", "afterEach"), methodsInvoked);
}
@@ -65,9 +65,9 @@ void executeTestCaseWithDefaultMethodFromInterfaceSelectedByFullyQualifedMethodN
() -> assertTrue(beforeAllInvoked, "@BeforeAll static method invoked from interface"),
() -> assertTrue(afterAllInvoked, "@AfterAll static method invoked from interface"),
() -> assertTrue(defaultMethodInvoked, "default @Test method invoked from interface"),
() -> assertEquals(1, executionResults.getTestStartedCount(), "# tests started"),
() -> assertEquals(1, executionResults.getTestSuccessfulCount(), "# tests succeeded"),
() -> assertEquals(0, executionResults.getTestFailedCount(), "# tests failed")
() -> assertEquals(1, executionResults.getTestsStartedCount(), "# tests started"),
() -> assertEquals(1, executionResults.getTestsSuccessfulCount(), "# tests succeeded"),
() -> assertEquals(0, executionResults.getTestsFailedCount(), "# tests failed")
);
// @formatter:on
}
@@ -84,9 +84,9 @@ void executeTestCaseWithDefaultMethodFromGenericInterfaceSelectedByFullyQualifed
() -> assertTrue(afterAllInvoked, "@AfterAll default method invoked from interface"),
() -> assertTrue(defaultMethodInvoked, "default @Test method invoked from interface"),
() -> assertFalse(localMethodInvoked, "local @Test method should not have been invoked from class"),
() -> assertEquals(1, executionResults.getTestStartedCount(), "# tests started"),
() -> assertEquals(1, executionResults.getTestSuccessfulCount(), "# tests succeeded"),
() -> assertEquals(0, executionResults.getTestFailedCount(), "# tests failed")
() -> assertEquals(1, executionResults.getTestsStartedCount(), "# tests started"),
() -> assertEquals(1, executionResults.getTestsSuccessfulCount(), "# tests succeeded"),
() -> assertEquals(0, executionResults.getTestsFailedCount(), "# tests failed")
);
// @formatter:on
}
@@ -104,9 +104,9 @@ void executeTestCaseWithOverloadedMethodNextToGenericDefaultMethodSelectedByFull
() -> assertTrue(afterAllInvoked, "@AfterAll default method invoked from interface"),
() -> assertFalse(defaultMethodInvoked, "default @Test method should not have been invoked from interface"),
() -> assertTrue(localMethodInvoked, "local @Test method invoked from class"),
() -> assertEquals(1, executionResults.getTestStartedCount(), "# tests started"),
() -> assertEquals(1, executionResults.getTestSuccessfulCount(), "# tests succeeded"),
() -> assertEquals(0, executionResults.getTestFailedCount(), "# tests failed")
() -> assertEquals(1, executionResults.getTestsStartedCount(), "# tests started"),
() -> assertEquals(1, executionResults.getTestsSuccessfulCount(), "# tests succeeded"),
() -> assertEquals(0, executionResults.getTestsFailedCount(), "# tests failed")
);
// @formatter:on
}
@@ -123,9 +123,9 @@ void executeTestCaseWithOverloadedMethodNextToGenericDefaultMethodSelectedByClas
() -> assertTrue(afterAllInvoked, "@AfterAll default method invoked from interface"),
() -> assertTrue(defaultMethodInvoked, "default @Test method invoked from interface"),
() -> assertTrue(localMethodInvoked, "local @Test method invoked from class"),
() -> assertEquals(2, executionResults.getTestStartedCount(), "# tests started"),
() -> assertEquals(2, executionResults.getTestSuccessfulCount(), "# tests succeeded"),
() -> assertEquals(0, executionResults.getTestFailedCount(), "# tests failed")
() -> assertEquals(2, executionResults.getTestsStartedCount(), "# tests started"),
() -> assertEquals(2, executionResults.getTestsSuccessfulCount(), "# tests succeeded"),
() -> assertEquals(0, executionResults.getTestsFailedCount(), "# tests failed")
);
// @formatter:on
}
@@ -147,9 +147,9 @@ void executeTestCaseWithOverriddenGenericDefaultMethodSelectedByClass() {
// 3 instead of 2, that means that the overriding method gets invoked
// twice: once as itself and a second time "as" the default method which
// should not have been "discovered" since it is overridden.
() -> assertEquals(2, executionResults.getTestStartedCount(), "# tests started"),
() -> assertEquals(2, executionResults.getTestSuccessfulCount(), "# tests succeeded"),
() -> assertEquals(0, executionResults.getTestFailedCount(), "# tests failed")
() -> assertEquals(2, executionResults.getTestsStartedCount(), "# tests started"),
() -> assertEquals(2, executionResults.getTestsSuccessfulCount(), "# tests succeeded"),
() -> assertEquals(0, executionResults.getTestsFailedCount(), "# tests failed")
);
// @formatter:on
}
@@ -32,21 +32,21 @@ void executeTestsWithDisabledTestClass() {
LauncherDiscoveryRequest request = request().selectors(selectClass(DisabledTestClassTestCase.class)).build();
ExecutionResults executionResults = executeTests(request).getExecutionResults();
assertEquals(1, executionResults.getContainerSkippedCount(), "# container skipped");
assertEquals(0, executionResults.getTestStartedCount(), "# tests started");
assertEquals(1, executionResults.getContainersSkippedCount(), "# container skipped");
assertEquals(0, executionResults.getTestsStartedCount(), "# tests started");
}
@Test
void executeTestsWithDisabledTestMethods() throws Exception {
LauncherDiscoveryRequest request = request().selectors(selectClass(DisabledTestMethodsTestCase.class)).build();
ExecutionResults executionResults = executeTests(request).getExecutionResults();
assertEquals(1, executionResults.getTestStartedCount(), "# tests started");
assertEquals(1, executionResults.getTestSuccessfulCount(), "# tests succeeded");
assertEquals(1, executionResults.getTestSkippedCount(), "# tests skipped");
assertEquals(1, executionResults.getTestsStartedCount(), "# tests started");
assertEquals(1, executionResults.getTestsSuccessfulCount(), "# tests succeeded");
assertEquals(1, executionResults.getTestsSkippedCount(), "# tests skipped");
String method = DisabledTestMethodsTestCase.class.getDeclaredMethod("disabledTest").toString();
String reason = executionResults.getSkippedTestEvents().get(0).getPayload(String.class).get();
String reason = executionResults.getTestsSkippedEvents().get(0).getPayload(String.class).get();
assertEquals(method + " is @Disabled", reason);
}
@@ -109,12 +109,12 @@ void dynamicTestsAreExecutedFromCollection() {
ExecutionResults executionResults = executeTests(request).getExecutionResults();
assertAll( //
() -> assertEquals(3, executionResults.getContainerStartedCount(), "# container started"),
() -> assertEquals(2, executionResults.getDynamicTestRegisteredCount(), "# dynamic registered"),
() -> assertEquals(2, executionResults.getTestStartedCount(), "# tests started"),
() -> assertEquals(1, executionResults.getTestSuccessfulCount(), "# tests succeeded"),
() -> assertEquals(1, executionResults.getTestFailedCount(), "# tests failed"),
() -> assertEquals(3, executionResults.getContainerFinishedCount(), "# container finished"));
() -> assertEquals(3, executionResults.getContainersStartedCount(), "# container started"),
() -> assertEquals(2, executionResults.getDynamicTestRegistrationCount(), "# dynamic registered"),
() -> assertEquals(2, executionResults.getTestsStartedCount(), "# tests started"),
() -> assertEquals(1, executionResults.getTestsSuccessfulCount(), "# tests succeeded"),
() -> assertEquals(1, executionResults.getTestsFailedCount(), "# tests failed"),
() -> assertEquals(3, executionResults.getContainersFinishedCount(), "# container finished"));
}
@Test
@@ -125,12 +125,12 @@ void dynamicTestsAreExecutedFromIterator() {
ExecutionResults executionResults = executeTests(request).getExecutionResults();
assertAll( //
() -> assertEquals(3, executionResults.getContainerStartedCount(), "# container started"),
() -> assertEquals(2, executionResults.getDynamicTestRegisteredCount(), "# dynamic registered"),
() -> assertEquals(2, executionResults.getTestStartedCount(), "# tests started"),
() -> assertEquals(1, executionResults.getTestSuccessfulCount(), "# tests succeeded"),
() -> assertEquals(1, executionResults.getTestFailedCount(), "# tests failed"),
() -> assertEquals(3, executionResults.getContainerFinishedCount(), "# container finished"));
() -> assertEquals(3, executionResults.getContainersStartedCount(), "# container started"),
() -> assertEquals(2, executionResults.getDynamicTestRegistrationCount(), "# dynamic registered"),
() -> assertEquals(2, executionResults.getTestsStartedCount(), "# tests started"),
() -> assertEquals(1, executionResults.getTestsSuccessfulCount(), "# tests succeeded"),
() -> assertEquals(1, executionResults.getTestsFailedCount(), "# tests failed"),
() -> assertEquals(3, executionResults.getContainersFinishedCount(), "# container finished"));
}
@Test
@@ -142,12 +142,12 @@ void dynamicTestsAreExecutedFromIterable() {
// @TestFactory methods are counted as both container and test
assertAll( //
() -> assertEquals(3, executionResults.getContainerStartedCount(), "# container started"),
() -> assertEquals(2, executionResults.getDynamicTestRegisteredCount(), "# dynamic registered"),
() -> assertEquals(2, executionResults.getTestStartedCount(), "# tests started"),
() -> assertEquals(1, executionResults.getTestSuccessfulCount(), "# tests succeeded"),
() -> assertEquals(1, executionResults.getTestFailedCount(), "# tests failed"),
() -> assertEquals(3, executionResults.getContainerFinishedCount(), "# container finished"));
() -> assertEquals(3, executionResults.getContainersStartedCount(), "# container started"),
() -> assertEquals(2, executionResults.getDynamicTestRegistrationCount(), "# dynamic registered"),
() -> assertEquals(2, executionResults.getTestsStartedCount(), "# tests started"),
() -> assertEquals(1, executionResults.getTestsSuccessfulCount(), "# tests succeeded"),
() -> assertEquals(1, executionResults.getTestsFailedCount(), "# tests failed"),
() -> assertEquals(3, executionResults.getContainersFinishedCount(), "# container finished"));
}
@Test
@@ -194,12 +194,12 @@ void dynamicContainersAreExecutedFromIterable() {
event(engine(), finishedSuccessfully()));
assertAll( //
() -> assertEquals(4, executionResults.getContainerStartedCount(), "# container started"),
() -> assertEquals(3, executionResults.getDynamicTestRegisteredCount(), "# dynamic tests registered"),
() -> assertEquals(2, executionResults.getTestStartedCount(), "# tests started"),
() -> assertEquals(1, executionResults.getTestSuccessfulCount(), "# tests succeeded"),
() -> assertEquals(1, executionResults.getTestFailedCount(), "# tests failed"),
() -> assertEquals(4, executionResults.getContainerFinishedCount(), "# container finished"));
() -> assertEquals(4, executionResults.getContainersStartedCount(), "# container started"),
() -> assertEquals(3, executionResults.getDynamicTestRegistrationCount(), "# dynamic tests registered"),
() -> assertEquals(2, executionResults.getTestsStartedCount(), "# tests started"),
() -> assertEquals(1, executionResults.getTestsSuccessfulCount(), "# tests succeeded"),
() -> assertEquals(1, executionResults.getTestsFailedCount(), "# tests failed"),
() -> assertEquals(4, executionResults.getContainersFinishedCount(), "# container finished"));
}
@Test
@@ -286,12 +286,12 @@ void nestedDynamicContainersAreExecuted() {
event(engine(), finishedSuccessfully()));
assertAll( //
() -> assertEquals(5, executionResults.getContainerStartedCount(), "# container started"),
() -> assertEquals(4, executionResults.getDynamicTestRegisteredCount(), "# dynamic tests registered"),
() -> assertEquals(2, executionResults.getTestStartedCount(), "# tests started"),
() -> assertEquals(1, executionResults.getTestSuccessfulCount(), "# tests succeeded"),
() -> assertEquals(1, executionResults.getTestFailedCount(), "# tests failed"),
() -> assertEquals(5, executionResults.getContainerFinishedCount(), "# container finished"));
() -> assertEquals(5, executionResults.getContainersStartedCount(), "# container started"),
() -> assertEquals(4, executionResults.getDynamicTestRegistrationCount(), "# dynamic tests registered"),
() -> assertEquals(2, executionResults.getTestsStartedCount(), "# tests started"),
() -> assertEquals(1, executionResults.getTestsSuccessfulCount(), "# tests succeeded"),
() -> assertEquals(1, executionResults.getTestsFailedCount(), "# tests failed"),
() -> assertEquals(5, executionResults.getContainersFinishedCount(), "# container finished"));
}
@Test
@@ -339,12 +339,12 @@ void dynamicContainersAreExecutedFromExceptionThrowingStream() {
event(engine(), finishedSuccessfully()));
assertAll( //
() -> assertEquals(4, executionResults.getContainerStartedCount(), "# container started"),
() -> assertEquals(3, executionResults.getDynamicTestRegisteredCount(), "# dynamic tests registered"),
() -> assertEquals(2, executionResults.getTestStartedCount(), "# tests started"),
() -> assertEquals(1, executionResults.getTestSuccessfulCount(), "# tests succeeded"),
() -> assertEquals(1, executionResults.getTestFailedCount(), "# tests failed"),
() -> assertEquals(4, executionResults.getContainerFinishedCount(), "# container finished"));
() -> assertEquals(4, executionResults.getContainersStartedCount(), "# container started"),
() -> assertEquals(3, executionResults.getDynamicTestRegistrationCount(), "# dynamic tests registered"),
() -> assertEquals(2, executionResults.getTestsStartedCount(), "# tests started"),
() -> assertEquals(1, executionResults.getTestsSuccessfulCount(), "# tests succeeded"),
() -> assertEquals(1, executionResults.getTestsFailedCount(), "# tests failed"),
() -> assertEquals(4, executionResults.getContainersFinishedCount(), "# container finished"));
}
@Test
Oops, something went wrong.

0 comments on commit 629f02d

Please sign in to comment.