From 53191417481c97057e249a48d62d20628618d1ec Mon Sep 17 00:00:00 2001 From: ivumwd Date: Fri, 1 Mar 2024 16:08:50 +0100 Subject: [PATCH 1/2] reproduced #2983 --- .../helloworld.feature/build.properties | 11 ++++ .../helloworld.feature/feature.xml | 33 +++++++++++ .../helloworld.feature/pom.xml | 14 +++++ .../helloworld.updatesite/category.xml | 5 ++ .../helloworld.updatesite/pom.xml | 45 ++++++++++++++ .../helloworld/META-INF/MANIFEST.MF | 6 ++ .../helloworld/build.properties | 14 +++++ .../helloworld/plugin.properties | 2 + .../helloworld/pom.xml | 14 +++++ .../src/helloworld/MessageProvider.java | 25 ++++++++ .../TYCHO2983siteWithPubishedFeatures/pom.xml | 58 +++++++++++++++++++ .../TYCHO2983siteWithPubishedFeatures.java | 49 ++++++++++++++++ 12 files changed, 276 insertions(+) create mode 100644 tycho-its/projects/TYCHO2983siteWithPubishedFeatures/helloworld.feature/build.properties create mode 100644 tycho-its/projects/TYCHO2983siteWithPubishedFeatures/helloworld.feature/feature.xml create mode 100644 tycho-its/projects/TYCHO2983siteWithPubishedFeatures/helloworld.feature/pom.xml create mode 100644 tycho-its/projects/TYCHO2983siteWithPubishedFeatures/helloworld.updatesite/category.xml create mode 100644 tycho-its/projects/TYCHO2983siteWithPubishedFeatures/helloworld.updatesite/pom.xml create mode 100644 tycho-its/projects/TYCHO2983siteWithPubishedFeatures/helloworld/META-INF/MANIFEST.MF create mode 100644 tycho-its/projects/TYCHO2983siteWithPubishedFeatures/helloworld/build.properties create mode 100644 tycho-its/projects/TYCHO2983siteWithPubishedFeatures/helloworld/plugin.properties create mode 100644 tycho-its/projects/TYCHO2983siteWithPubishedFeatures/helloworld/pom.xml create mode 100644 tycho-its/projects/TYCHO2983siteWithPubishedFeatures/helloworld/src/helloworld/MessageProvider.java create mode 100644 tycho-its/projects/TYCHO2983siteWithPubishedFeatures/pom.xml create mode 100644 tycho-its/src/test/java/org/eclipse/tycho/test/TYCHO2983siteWithPubishedFeatures/TYCHO2983siteWithPubishedFeatures.java diff --git a/tycho-its/projects/TYCHO2983siteWithPubishedFeatures/helloworld.feature/build.properties b/tycho-its/projects/TYCHO2983siteWithPubishedFeatures/helloworld.feature/build.properties new file mode 100644 index 0000000000..0b6dc2b511 --- /dev/null +++ b/tycho-its/projects/TYCHO2983siteWithPubishedFeatures/helloworld.feature/build.properties @@ -0,0 +1,11 @@ +############################################################################### +# Copyright (c) 2010, 2011 SAP AG and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# https://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# SAP AG - initial API and implementation +############################################################################### +bin.includes = feature.xml diff --git a/tycho-its/projects/TYCHO2983siteWithPubishedFeatures/helloworld.feature/feature.xml b/tycho-its/projects/TYCHO2983siteWithPubishedFeatures/helloworld.feature/feature.xml new file mode 100644 index 0000000000..da7e9188d1 --- /dev/null +++ b/tycho-its/projects/TYCHO2983siteWithPubishedFeatures/helloworld.feature/feature.xml @@ -0,0 +1,33 @@ + + + + + [Enter Feature Description here.] + + + + [Enter Copyright Description here.] + + + + [Enter License Description here.] + + + + + + + diff --git a/tycho-its/projects/TYCHO2983siteWithPubishedFeatures/helloworld.feature/pom.xml b/tycho-its/projects/TYCHO2983siteWithPubishedFeatures/helloworld.feature/pom.xml new file mode 100644 index 0000000000..b52b0de8a5 --- /dev/null +++ b/tycho-its/projects/TYCHO2983siteWithPubishedFeatures/helloworld.feature/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + + helloworld.feature + eclipse-feature + + + helloworld.parent + helloworld + 0.1.0-SNAPSHOT + + diff --git a/tycho-its/projects/TYCHO2983siteWithPubishedFeatures/helloworld.updatesite/category.xml b/tycho-its/projects/TYCHO2983siteWithPubishedFeatures/helloworld.updatesite/category.xml new file mode 100644 index 0000000000..9eab8a743e --- /dev/null +++ b/tycho-its/projects/TYCHO2983siteWithPubishedFeatures/helloworld.updatesite/category.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/tycho-its/projects/TYCHO2983siteWithPubishedFeatures/helloworld.updatesite/pom.xml b/tycho-its/projects/TYCHO2983siteWithPubishedFeatures/helloworld.updatesite/pom.xml new file mode 100644 index 0000000000..3d6eb08beb --- /dev/null +++ b/tycho-its/projects/TYCHO2983siteWithPubishedFeatures/helloworld.updatesite/pom.xml @@ -0,0 +1,45 @@ + + + 4.0.0 + + helloworld.updatesite + eclipse-repository + + + helloworld.parent + helloworld + 0.1.0-SNAPSHOT + + + + + eclipse-indigo + https://download.eclipse.org/releases/2024-03 + p2 + + + + + + + io.spring.javaformat + io.spring.javaformat.eclipse.feature + 0.0.41 + + + io.spring.javaformat + io.spring.javaformat.eclipse.feature + 0.0.41 + p2metadata + xml + + + io.spring.javaformat + io.spring.javaformat.eclipse.feature + 0.0.41 + p2artifacts + xml + + + diff --git a/tycho-its/projects/TYCHO2983siteWithPubishedFeatures/helloworld/META-INF/MANIFEST.MF b/tycho-its/projects/TYCHO2983siteWithPubishedFeatures/helloworld/META-INF/MANIFEST.MF new file mode 100644 index 0000000000..ab8feb1f61 --- /dev/null +++ b/tycho-its/projects/TYCHO2983siteWithPubishedFeatures/helloworld/META-INF/MANIFEST.MF @@ -0,0 +1,6 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-SymbolicName: helloworld +Bundle-Version: 0.1.0.qualifier +Bundle-Name: %pluginName +Bundle-Vendor: %pluginVendor \ No newline at end of file diff --git a/tycho-its/projects/TYCHO2983siteWithPubishedFeatures/helloworld/build.properties b/tycho-its/projects/TYCHO2983siteWithPubishedFeatures/helloworld/build.properties new file mode 100644 index 0000000000..d398a02404 --- /dev/null +++ b/tycho-its/projects/TYCHO2983siteWithPubishedFeatures/helloworld/build.properties @@ -0,0 +1,14 @@ +############################################################################### +# Copyright (c) 2010, 2011 SAP AG and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# https://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# SAP AG - initial API and implementation +############################################################################### +source.. = src/ +output.. = target/classes +bin.includes = META-INF/,\ + . diff --git a/tycho-its/projects/TYCHO2983siteWithPubishedFeatures/helloworld/plugin.properties b/tycho-its/projects/TYCHO2983siteWithPubishedFeatures/helloworld/plugin.properties new file mode 100644 index 0000000000..c68d29ff15 --- /dev/null +++ b/tycho-its/projects/TYCHO2983siteWithPubishedFeatures/helloworld/plugin.properties @@ -0,0 +1,2 @@ +pluginName=Hello Plugin +pluginVendor=Hello Vendor \ No newline at end of file diff --git a/tycho-its/projects/TYCHO2983siteWithPubishedFeatures/helloworld/pom.xml b/tycho-its/projects/TYCHO2983siteWithPubishedFeatures/helloworld/pom.xml new file mode 100644 index 0000000000..7176da3f67 --- /dev/null +++ b/tycho-its/projects/TYCHO2983siteWithPubishedFeatures/helloworld/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + + helloworld + eclipse-plugin + + + helloworld.parent + helloworld + 0.1.0-SNAPSHOT + + diff --git a/tycho-its/projects/TYCHO2983siteWithPubishedFeatures/helloworld/src/helloworld/MessageProvider.java b/tycho-its/projects/TYCHO2983siteWithPubishedFeatures/helloworld/src/helloworld/MessageProvider.java new file mode 100644 index 0000000000..3aa1119c2b --- /dev/null +++ b/tycho-its/projects/TYCHO2983siteWithPubishedFeatures/helloworld/src/helloworld/MessageProvider.java @@ -0,0 +1,25 @@ +/******************************************************************************* + * Copyright (c) 2010, 2011 SAP AG 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 + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * SAP AG - initial API and implementation + *******************************************************************************/ +package helloworld; + +public class MessageProvider { + + public String getGreeting() { + return getGreeting("World"); + } + + public String getGreeting(String receiver) { + return "Hello " + receiver + "!!"; + } + +} diff --git a/tycho-its/projects/TYCHO2983siteWithPubishedFeatures/pom.xml b/tycho-its/projects/TYCHO2983siteWithPubishedFeatures/pom.xml new file mode 100644 index 0000000000..60a785aade --- /dev/null +++ b/tycho-its/projects/TYCHO2983siteWithPubishedFeatures/pom.xml @@ -0,0 +1,58 @@ + + + 4.0.0 + + helloworld + helloworld.parent + 0.1.0-SNAPSHOT + pom + + + helloworld + helloworld.feature + helloworld.updatesite + + + + + + org.eclipse.tycho + tycho-maven-plugin + ${tycho-version} + true + + + org.eclipse.tycho + target-platform-configuration + ${tycho-version} + + p2 + + + + org.eclipse.tycho + tycho-packaging-plugin + ${tycho-version} + + true + + + + org.eclipse.tycho + tycho-source-plugin + ${tycho-version} + + + plugin-source + + plugin-source + + + + + + + + diff --git a/tycho-its/src/test/java/org/eclipse/tycho/test/TYCHO2983siteWithPubishedFeatures/TYCHO2983siteWithPubishedFeatures.java b/tycho-its/src/test/java/org/eclipse/tycho/test/TYCHO2983siteWithPubishedFeatures/TYCHO2983siteWithPubishedFeatures.java new file mode 100644 index 0000000000..a7787a3218 --- /dev/null +++ b/tycho-its/src/test/java/org/eclipse/tycho/test/TYCHO2983siteWithPubishedFeatures/TYCHO2983siteWithPubishedFeatures.java @@ -0,0 +1,49 @@ +/******************************************************************************* + * Copyright (c) 2010, 2023 SAP AG 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 + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * - initial API and implementation + *******************************************************************************/ + +package org.eclipse.tycho.test.TYCHO2983siteWithPubishedFeatures; + +import org.apache.maven.it.Verifier; +import org.eclipse.tycho.TychoConstants; +import org.eclipse.tycho.test.AbstractTychoIntegrationTest; +import org.eclipse.tycho.test.util.XMLTool; +import org.junit.Test; + +import java.io.File; +import java.util.Arrays; + +import static org.junit.Assert.*; + +public class TYCHO2983siteWithPubishedFeatures extends AbstractTychoIntegrationTest { + + @Test + public void testCheckSiteFeatures() throws Exception { + Verifier verifier = getVerifier("/TYCHO2983siteWithPubishedFeatures", false); + verifier.executeGoal("verify"); + verifier.verifyErrorFreeLog(); + + File siteFeaturesFolder = new File(verifier.getBasedir(), "helloworld.updatesite/target/repository/features"); + + assertTrue(siteFeaturesFolder.exists()); + assertNotNull(Arrays.stream(siteFeaturesFolder.listFiles()).filter( + file -> file.getName().startsWith("helloworld.feature")) + .findAny() + .orElse(null) + ); + assertNotNull(Arrays.stream(siteFeaturesFolder.listFiles()).filter( + file -> file.getName().startsWith("io.spring.javaformat.eclipse.feature")) + .findAny() + .orElse(null) + ); + } +} \ No newline at end of file From 1f75cb490c9f0f2abc8c6c2f50d5ae435dc350ef Mon Sep 17 00:00:00 2001 From: ivumwd Date: Wed, 27 Mar 2024 16:23:01 +0100 Subject: [PATCH 2/2] renamed test class --- ...ava => TYCHO2983siteWithPubishedFeaturesTest.java} | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) rename tycho-its/src/test/java/org/eclipse/tycho/test/TYCHO2983siteWithPubishedFeatures/{TYCHO2983siteWithPubishedFeatures.java => TYCHO2983siteWithPubishedFeaturesTest.java} (82%) diff --git a/tycho-its/src/test/java/org/eclipse/tycho/test/TYCHO2983siteWithPubishedFeatures/TYCHO2983siteWithPubishedFeatures.java b/tycho-its/src/test/java/org/eclipse/tycho/test/TYCHO2983siteWithPubishedFeatures/TYCHO2983siteWithPubishedFeaturesTest.java similarity index 82% rename from tycho-its/src/test/java/org/eclipse/tycho/test/TYCHO2983siteWithPubishedFeatures/TYCHO2983siteWithPubishedFeatures.java rename to tycho-its/src/test/java/org/eclipse/tycho/test/TYCHO2983siteWithPubishedFeatures/TYCHO2983siteWithPubishedFeaturesTest.java index a7787a3218..fc84cbe7e0 100644 --- a/tycho-its/src/test/java/org/eclipse/tycho/test/TYCHO2983siteWithPubishedFeatures/TYCHO2983siteWithPubishedFeatures.java +++ b/tycho-its/src/test/java/org/eclipse/tycho/test/TYCHO2983siteWithPubishedFeatures/TYCHO2983siteWithPubishedFeaturesTest.java @@ -14,17 +14,16 @@ package org.eclipse.tycho.test.TYCHO2983siteWithPubishedFeatures; import org.apache.maven.it.Verifier; -import org.eclipse.tycho.TychoConstants; import org.eclipse.tycho.test.AbstractTychoIntegrationTest; -import org.eclipse.tycho.test.util.XMLTool; import org.junit.Test; import java.io.File; import java.util.Arrays; +import java.util.Objects; import static org.junit.Assert.*; -public class TYCHO2983siteWithPubishedFeatures extends AbstractTychoIntegrationTest { +public class TYCHO2983siteWithPubishedFeaturesTest extends AbstractTychoIntegrationTest { @Test public void testCheckSiteFeatures() throws Exception { @@ -35,15 +34,15 @@ public void testCheckSiteFeatures() throws Exception { File siteFeaturesFolder = new File(verifier.getBasedir(), "helloworld.updatesite/target/repository/features"); assertTrue(siteFeaturesFolder.exists()); - assertNotNull(Arrays.stream(siteFeaturesFolder.listFiles()).filter( + assertNotNull(Arrays.stream(Objects.requireNonNull(siteFeaturesFolder.listFiles())).filter( file -> file.getName().startsWith("helloworld.feature")) .findAny() .orElse(null) ); - assertNotNull(Arrays.stream(siteFeaturesFolder.listFiles()).filter( + assertNotNull(Arrays.stream(Objects.requireNonNull(siteFeaturesFolder.listFiles())).filter( file -> file.getName().startsWith("io.spring.javaformat.eclipse.feature")) .findAny() .orElse(null) ); } -} \ No newline at end of file +}