From ffd328a47229fda116fd50f9a46a3c60d142eca2 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: Tue, 17 Dec 2024 18:12:27 +0200 Subject: [PATCH 1/4] Run verification build with Java 21 --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index ef2d9528f..0c292c691 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -10,7 +10,7 @@ pipeline { } tools { maven 'apache-maven-latest' - jdk 'temurin-jdk17-latest' + jdk 'temurin-jdk21-latest' } stages { stage('Build') { From fcfadb40d9636c0dc9edc2bf5710629b79157198 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: Tue, 17 Dec 2024 18:14:21 +0200 Subject: [PATCH 2/4] Update tycho-build to 4.0.10 --- .mvn/extensions.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mvn/extensions.xml b/.mvn/extensions.xml index 916d3db10..e26500780 100644 --- a/.mvn/extensions.xml +++ b/.mvn/extensions.xml @@ -3,6 +3,6 @@ org.eclipse.tycho tycho-build - 4.0.7 + 4.0.10 \ No newline at end of file From f4ab206c6699f983fafc420e1c47b40e17654e2a 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: Tue, 17 Dec 2024 18:37:15 +0200 Subject: [PATCH 3/4] Sanitize SharedInstallTestsProfileSpoofEnabledConfigured test Failed in https://download.eclipse.org/eclipse/downloads/drops4/I20241217-0630/testresults/html/org.eclipse.equinox.p2.tests_ep435I-unit-linux-x86_64-java23_linux.gtk.x86_64_23.html with really no message: ``` N/A junit.framework.AssertionFailedError at junit.framework.Assert.fail(Assert.java:55) at junit.framework.Assert.assertTrue(Assert.java:22) at junit.framework.Assert.assertFalse(Assert.java:39) at junit.framework.Assert.assertFalse(Assert.java:47) at junit.framework.TestCase.assertFalse(TestCase.java:216) at org.eclipse.equinox.p2.tests.reconciler.dropins.SharedInstallTestsProfileSpoofEnabledConfigured.testUserDropinsStartup(SharedInstallTestsProfileSpoofEnabledConfigured.java:215) at java.base/java.lang.reflect.Method.invoke(Method.java:580) at junit.framework.TestCase.runTest(TestCase.java:177) at org.eclipse.equinox.p2.tests.AbstractProvisioningTest.runTest(AbstractProvisioningTest.java:968) at junit.framework.TestCase.runBare(TestCase.java:142) at junit.framework.TestResult$1.protect(TestResult.java:122) at junit.framework.TestResult.runProtected(TestResult.java:142) at junit.framework.TestResult.run(TestResult.java:125) at junit.framework.TestCase.run(TestCase.java:130) at junit.framework.TestSuite.runTest(TestSuite.java:241) at org.eclipse.equinox.p2.tests.reconciler.dropins.ReconcilerTestSuite.run(ReconcilerTestSuite.java:87) at junit.framework.TestSuite.runTest(TestSuite.java:241) at junit.framework.TestSuite.run(TestSuite.java:236) ``` This PR removes insane assert messages and some other changes to make code slightly easier on the eyes. --- .../META-INF/MANIFEST.MF | 2 +- .../p2/tests/reconciler/dropins/AllTests.java | 12 +++-- ...allTestsProfileSpoofEnabledConfigured.java | 49 +++++++------------ 3 files changed, 27 insertions(+), 36 deletions(-) diff --git a/bundles/org.eclipse.equinox.p2.tests/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.tests/META-INF/MANIFEST.MF index 0be133d9b..20e4989a4 100644 --- a/bundles/org.eclipse.equinox.p2.tests/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.p2.tests/META-INF/MANIFEST.MF @@ -23,7 +23,7 @@ Export-Package: org.eclipse.equinox.p2.tests;version="2.0.0", Require-Bundle: org.eclipse.equinox.frameworkadmin, org.eclipse.equinox.common, org.eclipse.core.tests.harness;bundle-version="3.4.0", - org.eclipse.core.runtime;bundle-version="3.29.0", + org.eclipse.core.runtime;bundle-version="3.30.0", org.eclipse.equinox.p2.publisher;bundle-version="1.0.0", org.eclipse.equinox.frameworkadmin.test;bundle-version="1.0.0", org.junit;bundle-version="4.8.0", diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/AllTests.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/AllTests.java index 7604f7012..6842ea302 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/AllTests.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/AllTests.java @@ -1,27 +1,29 @@ /******************************************************************************* * Copyright (c) 2008, 2013 IBM Corporation and others. * - * This program and the accompanying materials + * 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 * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 - * + * * Contributors: * IBM Corporation - initial API and implementation * Red Hat, Inc. - Fragment support added. *******************************************************************************/ package org.eclipse.equinox.p2.tests.reconciler.dropins; -import junit.framework.*; +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; import org.eclipse.equinox.p2.tests.sharedinstall.AbstractSharedInstallTest; /** * To run the reconciler tests, you must perform some manual setup steps: * 1) Download the platform runtime binary zip (latest build or the one you want to test). * 2) Set the following system property to the file system path of the binary zip. For example: - * + * * -Dorg.eclipse.equinox.p2.reconciler.tests.platform.archive=c:/tmp/eclipse-platform-3.4-win32.zip */ public class AllTests extends TestCase { @@ -34,7 +36,7 @@ public static Test suite() { suite.addTest(SharedInstallTests.suite()); suite.addTest(SharedInstallTestsProfileSpoofEnabled.suite()); if (!AbstractSharedInstallTest.WINDOWS) { - suite.addTest(SharedInstallTestsProfileSpoofEnabledConfigured.suite()); + suite.addTestSuite(SharedInstallTestsProfileSpoofEnabledConfigured.class); } suite.addTest(Bug362692.suite()); return suite; diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/SharedInstallTestsProfileSpoofEnabledConfigured.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/SharedInstallTestsProfileSpoofEnabledConfigured.java index dcd61d1d5..c5321e0c9 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/SharedInstallTestsProfileSpoofEnabledConfigured.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/SharedInstallTestsProfileSpoofEnabledConfigured.java @@ -19,8 +19,6 @@ import java.io.IOException; import java.io.InputStream; import java.util.Properties; -import junit.framework.Test; -import junit.framework.TestSuite; import org.eclipse.core.runtime.Platform; import org.eclipse.equinox.internal.p2.updatesite.Activator; import org.eclipse.equinox.p2.tests.sharedinstall.AbstractSharedInstallTest; @@ -29,15 +27,6 @@ public class SharedInstallTestsProfileSpoofEnabledConfigured extends SharedInsta private File extensions; - public static Test suite() { - TestSuite suite = new ReconcilerTestSuite(); - suite.setName(SharedInstallTestsProfileSpoofEnabledConfigured.class.getName()); - suite.addTest(new SharedInstallTestsProfileSpoofEnabledConfigured("testBasicStartup")); - suite.addTest(new SharedInstallTestsProfileSpoofEnabledConfigured("testReadOnlyDropinsStartup")); - suite.addTest(new SharedInstallTestsProfileSpoofEnabledConfigured("testUserDropinsStartup")); - return suite; - } - /* * Constructor for the class. */ @@ -98,18 +87,18 @@ public void testBasicStartup() throws IOException { try { File userBundlesInfo = new File(userBase, "configuration/org.eclipse.equinox.simpleconfigurator/bundles.info"); File userConfigIni = new File(userBase, "configuration/config.ini"); - assertFalse("0.1", userBundlesInfo.exists()); - assertFalse("0.2", userConfigIni.exists()); - reconcileReadOnly("0.21", extensions); - assertFalse("0.3", userBundlesInfo.exists()); - assertTrue("0.4", userConfigIni.exists()); + assertFalse(userBundlesInfo.exists()); + assertFalse(userConfigIni.exists()); + reconcileReadOnly("", extensions); + assertFalse(userBundlesInfo.exists()); + assertTrue(userConfigIni.exists()); Properties props = new Properties(); try (InputStream is = new BufferedInputStream(new FileInputStream(userConfigIni))) { props.load(is); } - assertTrue("0.5", props.containsKey("osgi.sharedConfiguration.area")); - assertTrue("0.6", props.size() == 1); + assertTrue(props.containsKey("osgi.sharedConfiguration.area")); + assertEquals(1, props.size()); } finally { cleanupReadOnlyInstall(); } @@ -117,7 +106,7 @@ public void testBasicStartup() throws IOException { @Override public void testReadOnlyDropinsStartup() throws IOException { - if (Platform.getOS().equals(Platform.OS_MACOSX)) + if (Platform.OS.isMac()) return; assertInitialized(); @@ -128,13 +117,13 @@ public void testReadOnlyDropinsStartup() throws IOException { try { File userBundlesInfo = new File(userBase, "configuration/org.eclipse.equinox.simpleconfigurator/bundles.info"); File userConfigIni = new File(userBase, "configuration/config.ini"); - assertFalse("0.1", userBundlesInfo.exists()); - assertFalse("0.2", userConfigIni.exists()); + assertFalse(userBundlesInfo.exists()); + assertFalse(userConfigIni.exists()); reconcileReadOnly("0.21", extensions); - assertTrue("0.3", userBundlesInfo.exists()); - assertTrue("0.4", userConfigIni.exists()); + assertTrue(userBundlesInfo.exists()); + assertTrue(userConfigIni.exists()); assertTrue(isInBundlesInfo(userBundlesInfo, "myBundle", null)); assertTrue(isInBundlesInfo(userBundlesInfo, "zzz", null)); @@ -142,7 +131,7 @@ public void testReadOnlyDropinsStartup() throws IOException { // remove the bundle from the dropins and reconcile setReadOnly(readOnlyBase, false); AbstractSharedInstallTest.removeReallyReadOnly(readOnlyBase); - assertTrue("0.7", readOnlyBase.canWrite()); + assertTrue(readOnlyBase.canWrite()); remove("1.0", "dropins", "myBundle_1.0.0.jar"); setReadOnly(readOnlyBase, true); AbstractSharedInstallTest.reallyReadOnly(readOnlyBase); @@ -164,7 +153,7 @@ public void testReadOnlyDropinsStartup() throws IOException { // new, up-to-date bundles.info setReadOnly(readOnlyBase, false); AbstractSharedInstallTest.removeReallyReadOnly(readOnlyBase); - assertTrue("0.7", readOnlyBase.canWrite()); + assertTrue(readOnlyBase.canWrite()); add("0.211", "dropins", jar); setReadOnly(readOnlyBase, true); AbstractSharedInstallTest.reallyReadOnly(readOnlyBase); @@ -183,7 +172,7 @@ public void testReadOnlyDropinsStartup() throws IOException { @Override public void testUserDropinsStartup() throws IOException { - if (Platform.getOS().equals(Platform.OS_MACOSX)) + if (Platform.OS.isMac()) return; assertInitialized(); @@ -198,13 +187,13 @@ public void testUserDropinsStartup() throws IOException { File userBundlesInfo = new File(userBase, "configuration/org.eclipse.equinox.simpleconfigurator/bundles.info"); File userConfigIni = new File(userBase, "configuration/config.ini"); - assertFalse("0.1", userBundlesInfo.exists()); - assertFalse("0.2", userConfigIni.exists()); + assertFalse(userBundlesInfo.exists()); + assertFalse(userConfigIni.exists()); reconcileReadOnly("0.21", extensions); - assertTrue("0.3", userBundlesInfo.exists()); - assertTrue("0.4", userConfigIni.exists()); + assertTrue(userBundlesInfo.exists()); + assertTrue(userConfigIni.exists()); assertTrue(isInBundlesInfo(userBundlesInfo, "myBundle", null)); assertTrue(isInBundlesInfo(userBundlesInfo, "zzz", null)); From e6995cc7cb77fe7af164ea8db862c3580dc29fd6 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: Tue, 17 Dec 2024 22:06:54 +0200 Subject: [PATCH 4/4] Restore SharedInstallTestsProfileSpoofEnabledConfigured.suite() A bigger change will be needed to get rid of this suite methods thus reverting it. --- .../p2/tests/reconciler/dropins/AllTests.java | 12 +++++------- ...redInstallTestsProfileSpoofEnabledConfigured.java | 11 +++++++++++ .../META-INF/MANIFEST.MF | 1 + 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/AllTests.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/AllTests.java index 6842ea302..7604f7012 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/AllTests.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/AllTests.java @@ -1,29 +1,27 @@ /******************************************************************************* * Copyright (c) 2008, 2013 IBM Corporation and others. * - * This program and the accompanying materials + * 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 * https://www.eclipse.org/legal/epl-2.0/ * * SPDX-License-Identifier: EPL-2.0 - * + * * Contributors: * IBM Corporation - initial API and implementation * Red Hat, Inc. - Fragment support added. *******************************************************************************/ package org.eclipse.equinox.p2.tests.reconciler.dropins; -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; +import junit.framework.*; import org.eclipse.equinox.p2.tests.sharedinstall.AbstractSharedInstallTest; /** * To run the reconciler tests, you must perform some manual setup steps: * 1) Download the platform runtime binary zip (latest build or the one you want to test). * 2) Set the following system property to the file system path of the binary zip. For example: - * + * * -Dorg.eclipse.equinox.p2.reconciler.tests.platform.archive=c:/tmp/eclipse-platform-3.4-win32.zip */ public class AllTests extends TestCase { @@ -36,7 +34,7 @@ public static Test suite() { suite.addTest(SharedInstallTests.suite()); suite.addTest(SharedInstallTestsProfileSpoofEnabled.suite()); if (!AbstractSharedInstallTest.WINDOWS) { - suite.addTestSuite(SharedInstallTestsProfileSpoofEnabledConfigured.class); + suite.addTest(SharedInstallTestsProfileSpoofEnabledConfigured.suite()); } suite.addTest(Bug362692.suite()); return suite; diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/SharedInstallTestsProfileSpoofEnabledConfigured.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/SharedInstallTestsProfileSpoofEnabledConfigured.java index c5321e0c9..ae0ff3861 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/SharedInstallTestsProfileSpoofEnabledConfigured.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/reconciler/dropins/SharedInstallTestsProfileSpoofEnabledConfigured.java @@ -19,6 +19,8 @@ import java.io.IOException; import java.io.InputStream; import java.util.Properties; +import junit.framework.Test; +import junit.framework.TestSuite; import org.eclipse.core.runtime.Platform; import org.eclipse.equinox.internal.p2.updatesite.Activator; import org.eclipse.equinox.p2.tests.sharedinstall.AbstractSharedInstallTest; @@ -27,6 +29,15 @@ public class SharedInstallTestsProfileSpoofEnabledConfigured extends SharedInsta private File extensions; + public static Test suite() { + TestSuite suite = new ReconcilerTestSuite(); + suite.setName(SharedInstallTestsProfileSpoofEnabledConfigured.class.getName()); + suite.addTest(new SharedInstallTestsProfileSpoofEnabledConfigured("testBasicStartup")); + suite.addTest(new SharedInstallTestsProfileSpoofEnabledConfigured("testReadOnlyDropinsStartup")); + suite.addTest(new SharedInstallTestsProfileSpoofEnabledConfigured("testUserDropinsStartup")); + return suite; + } + /* * Constructor for the class. */ diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.discovery/META-INF/MANIFEST.MF b/examples/org.eclipse.equinox.p2.examples.rcp.discovery/META-INF/MANIFEST.MF index ec92b2cb8..a48ce8ffc 100644 --- a/examples/org.eclipse.equinox.p2.examples.rcp.discovery/META-INF/MANIFEST.MF +++ b/examples/org.eclipse.equinox.p2.examples.rcp.discovery/META-INF/MANIFEST.MF @@ -5,6 +5,7 @@ Bundle-SymbolicName: org.eclipse.equinox.p2.examples.rcp.discovery;singleton:=tr Bundle-Version: 2.3.100.qualifier Bundle-Activator: org.eclipse.equinox.p2.examples.rcp.cloud.Activator Bundle-Localization: plugin +Bundle-Vendor: Eclipse.org - Equinox Require-Bundle: org.eclipse.ui;bundle-version="3.6.0", org.eclipse.core.runtime, org.eclipse.equinox.p2.operations;bundle-version="2.0.0",