From 794471119fe2640bce56be04f8b1d404de223e6a Mon Sep 17 00:00:00 2001 From: Heiko Klare Date: Mon, 8 Jan 2024 21:31:50 +0100 Subject: [PATCH] Provide a session test framework for JUnit 5 A first draft for realizing session tests with JUnit 5. It uses an extension that intercepts test methods calls to start a separate Eclipse session in which the tests are executed. The results are evaluated in the intercepted method execution in way they were evaluated for existing JUnit-3-based session tests. Functionality is demonstrated in a manually executed sample session test as well as by application to the session test in the runtime tests project. Since JUnit 5 test suites are not yet supported, the project is adapted to execute tests without suites. In order to get the session test running with Tycho, an adaptation of the test application provided via PDE is necessary, because a faulty class loader is currently used for the test engines during remote execution. --- pom.xml | 8 + .../META-INF/MANIFEST.MF | 18 +- .../harness/session/SessionShouldError.java | 27 ++ .../harness/session/SessionTestExtension.java | 350 ++++++++++++++++++ .../session/samples/SampleSessionTests.java | 82 ++++ .../ConfigurationSessionTestSuite.java | 11 + .../META-INF/MANIFEST.MF | 5 +- .../build.properties | 3 +- .../preferences/AllPreferenceTests.java | 12 +- .../runtime/AllInternalRuntimeTests.java | 8 +- .../core/tests/runtime/AllRuntimeTests.java | 8 +- .../tests/runtime/AutomatedRuntimeTests.java | 8 +- .../core/tests/runtime/jobs/AllJobTests.java | 14 +- .../core/tests/runtime/jobs/Bug_412138.java | 48 ++- 14 files changed, 555 insertions(+), 47 deletions(-) create mode 100644 runtime/tests/org.eclipse.core.tests.harness/src/org/eclipse/core/tests/harness/session/SessionShouldError.java create mode 100644 runtime/tests/org.eclipse.core.tests.harness/src/org/eclipse/core/tests/harness/session/SessionTestExtension.java create mode 100644 runtime/tests/org.eclipse.core.tests.harness/src/org/eclipse/core/tests/harness/session/samples/SampleSessionTests.java diff --git a/pom.xml b/pom.xml index cf9b5e87a63..db2df2348d8 100644 --- a/pom.xml +++ b/pom.xml @@ -26,6 +26,8 @@ scm:git:https://github.com/eclipse-platform/eclipse.platform.git ${project.build.outputDirectory} + +