From ae0b9923f1622a487047cb8ba4d16bf3dae90de1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=8A?= =?UTF-8?q?=D1=80=20=D0=9A=D1=83=D1=80=D1=82=D0=B0=D0=BA=D0=BE=D0=B2?= Date: Mon, 9 Oct 2023 17:51:30 +0300 Subject: [PATCH] Simplify JUnit5Test and make it always use ECLIPSE_LATEST p2 repo Changed the target-platform parameters to be the standard one so these settings could happen automatically. --- .../surefire.junit4and54/bundle.test/pom.xml | 2 +- .../surefire.junit5/bundle.test/pom.xml | 2 +- .../surefire.junit54/bundle.test/pom.xml | 2 +- .../surefire.junit56/bundle.test/pom.xml | 2 +- .../surefire.junit59/bundle.test/pom.xml | 2 +- .../tycho/test/surefire/JUnit5Test.java | 28 ++++++++----------- 6 files changed, 16 insertions(+), 22 deletions(-) diff --git a/tycho-its/projects/surefire.junit4and54/bundle.test/pom.xml b/tycho-its/projects/surefire.junit4and54/bundle.test/pom.xml index 26737600b6..5b94a063e0 100644 --- a/tycho-its/projects/surefire.junit4and54/bundle.test/pom.xml +++ b/tycho-its/projects/surefire.junit4and54/bundle.test/pom.xml @@ -10,7 +10,7 @@ eclipse201903 p2 - ${repo-2019-03} + ${target-platform} diff --git a/tycho-its/projects/surefire.junit5/bundle.test/pom.xml b/tycho-its/projects/surefire.junit5/bundle.test/pom.xml index 2bd18e0456..61e6eff6cc 100644 --- a/tycho-its/projects/surefire.junit5/bundle.test/pom.xml +++ b/tycho-its/projects/surefire.junit5/bundle.test/pom.xml @@ -10,7 +10,7 @@ oxygen p2 - ${oxygen-repo} + ${target-platform} diff --git a/tycho-its/projects/surefire.junit54/bundle.test/pom.xml b/tycho-its/projects/surefire.junit54/bundle.test/pom.xml index 6a82f5188a..100ddf9ad2 100644 --- a/tycho-its/projects/surefire.junit54/bundle.test/pom.xml +++ b/tycho-its/projects/surefire.junit54/bundle.test/pom.xml @@ -10,7 +10,7 @@ eclipse201903 p2 - ${repo-2019-03} + ${target-platform} diff --git a/tycho-its/projects/surefire.junit56/bundle.test/pom.xml b/tycho-its/projects/surefire.junit56/bundle.test/pom.xml index a1c41ce5b8..249934324e 100644 --- a/tycho-its/projects/surefire.junit56/bundle.test/pom.xml +++ b/tycho-its/projects/surefire.junit56/bundle.test/pom.xml @@ -10,7 +10,7 @@ eclipse202003 p2 - ${repo-2020-03} + ${target-platform} diff --git a/tycho-its/projects/surefire.junit59/bundle.test/pom.xml b/tycho-its/projects/surefire.junit59/bundle.test/pom.xml index ec551a6d4c..908d50a6ac 100644 --- a/tycho-its/projects/surefire.junit59/bundle.test/pom.xml +++ b/tycho-its/projects/surefire.junit59/bundle.test/pom.xml @@ -10,7 +10,7 @@ eclipse202003 p2 - ${repo-2020-03} + ${target-platform} diff --git a/tycho-its/src/test/java/org/eclipse/tycho/test/surefire/JUnit5Test.java b/tycho-its/src/test/java/org/eclipse/tycho/test/surefire/JUnit5Test.java index a38402f2c3..9adde2dfda 100644 --- a/tycho-its/src/test/java/org/eclipse/tycho/test/surefire/JUnit5Test.java +++ b/tycho-its/src/test/java/org/eclipse/tycho/test/surefire/JUnit5Test.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018 SAP SE and others. + * Copyright (c) 2018, 2023 SAP SE and others. * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at @@ -17,18 +17,16 @@ import org.apache.maven.it.Verifier; import org.eclipse.tycho.test.AbstractTychoIntegrationTest; -import org.eclipse.tycho.test.util.ResourceUtil.P2Repositories; import org.junit.Test; public class JUnit5Test extends AbstractTychoIntegrationTest { @Test public void testJUnit5Runner() throws Exception { - Verifier verifier = getVerifier("/surefire.junit5/bundle.test", false); - verifier.addCliOption("-Doxygen-repo=" + P2Repositories.ECLIPSE_OXYGEN.toString()); + final Verifier verifier = getVerifier("/surefire.junit5/bundle.test"); verifier.executeGoal("verify"); verifier.verifyErrorFreeLog(); - String projectBasedir = verifier.getBasedir(); + final String projectBasedir = verifier.getBasedir(); assertTestMethodWasSuccessfullyExecuted(projectBasedir, "bundle.test.JUnit5Test", "My 1st JUnit 5 test!"); assertTestMethodWasSuccessfullyExecuted(projectBasedir, "bundle.test.JUnit5Test", "parameterizedJUnit5Test(String)[1] one"); @@ -47,11 +45,10 @@ public void testJUnit5Runner() throws Exception { @Test public void testJUnit4and54Runner() throws Exception { - Verifier verifier = getVerifier("/surefire.junit4and54/bundle.test", false); - verifier.addCliOption("-Drepo-2019-03=" + P2Repositories.ECLIPSE_LATEST.toString()); + final Verifier verifier = getVerifier("/surefire.junit4and54/bundle.test"); verifier.executeGoal("verify"); verifier.verifyErrorFreeLog(); - String projectBasedir = verifier.getBasedir(); + final String projectBasedir = verifier.getBasedir(); assertTestMethodWasSuccessfullyExecuted(projectBasedir, "bundle.test.JUnit4Test", "testWithJUnit4"); assertTestMethodWasSuccessfullyExecuted(projectBasedir, "bundle.test.JUnit54Test", "My 1st JUnit 5.4 test!"); // make sure test tagged as 'slow' was skipped @@ -60,11 +57,10 @@ public void testJUnit4and54Runner() throws Exception { @Test public void testJUnit54Runner() throws Exception { - Verifier verifier = getVerifier("/surefire.junit54/bundle.test", false); - verifier.addCliOption("-Drepo-2019-03=" + P2Repositories.ECLIPSE_LATEST.toString()); + final Verifier verifier = getVerifier("/surefire.junit54/bundle.test"); verifier.executeGoal("verify"); verifier.verifyErrorFreeLog(); - String projectBasedir = verifier.getBasedir(); + final String projectBasedir = verifier.getBasedir(); assertTestMethodWasSuccessfullyExecuted(projectBasedir, "bundle.test.JUnit54Test", "My 1st JUnit 5.4 test!"); // make sure test tagged as 'slow' was skipped assertNumberOfSuccessfulTests(projectBasedir, "bundle.test.JUnit54Test", 1); @@ -72,11 +68,10 @@ public void testJUnit54Runner() throws Exception { @Test public void testJUnit56Runner() throws Exception { - Verifier verifier = getVerifier("/surefire.junit56/bundle.test", false); - verifier.addCliOption("-Drepo-2020-03=" + P2Repositories.ECLIPSE_LATEST.toString()); + final Verifier verifier = getVerifier("/surefire.junit56/bundle.test"); verifier.executeGoal("verify"); verifier.verifyErrorFreeLog(); - String projectBasedir = verifier.getBasedir(); + final String projectBasedir = verifier.getBasedir(); assertTestMethodWasSuccessfullyExecuted(projectBasedir, "bundle.test.JUnit56Test", "My 1st JUnit 5.6 test!"); // make sure test tagged as 'slow' was skipped assertNumberOfSuccessfulTests(projectBasedir, "bundle.test.JUnit56Test", 1); @@ -84,11 +79,10 @@ public void testJUnit56Runner() throws Exception { @Test public void testJUnit59Runner() throws Exception { - Verifier verifier = getVerifier("/surefire.junit59/bundle.test", false); - verifier.addCliOption("-Drepo-2020-03=" + P2Repositories.ECLIPSE_LATEST.toString()); + final Verifier verifier = getVerifier("/surefire.junit59/bundle.test"); verifier.executeGoal("verify"); verifier.verifyErrorFreeLog(); - String projectBasedir = verifier.getBasedir(); + final String projectBasedir = verifier.getBasedir(); assertTestMethodWasSuccessfullyExecuted(projectBasedir, "bundle.test.JUnit59Test", "My 1st JUnit 5.9 test!"); assertTestMethodWasSuccessfullyExecuted(projectBasedir, "bundle.test.JUnit59Test", "parameterizedJUnit59TestWithMethodSource(int, int, int)[1] 0, 5, 5");