Skip to content

Commit

Permalink
Add IT to reproduce missing launcher
Browse files Browse the repository at this point in the history
  • Loading branch information
henryju committed Jan 31, 2024
1 parent 87563c6 commit b2cc639
Show file tree
Hide file tree
Showing 11 changed files with 142 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,12 @@
install-size="0"
version="0.0.0"
unpack="false"/>

<plugin
id="spir.example-plugin"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>

</feature>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: spir.example-plugin
Bundle-Version: 1.0.0
Export-Package: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-11
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
bin.includes = META-INF/,\
.,\
plugin.xml
output.. = target/classes/
source.. = src/
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2013 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
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>tycho-its-project.surefire.p2InstalledRuntime</groupId>
<artifactId>provisionedApplicationParent</artifactId>
<version>1.0.0</version>
</parent>

<artifactId>spir.example-plugin</artifactId>
<packaging>eclipse-plugin</packaging>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package plugin;

public class MyPlugin {

public String sayHello() {
return "Hello";
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: spir.pluginTest
Bundle-Version: 1.0.0
Require-Bundle: org.junit,
org.eclipse.core.runtime,
spir.example-plugin
Bundle-RequiredExecutionEnvironment: JavaSE-11
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.
46 changes: 46 additions & 0 deletions tycho-its/projects/surefire.p2InstalledRuntime/pluginTest/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
Copyright (c) 2013 Red Hat Inc. 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:
Mickael Istria (Red Hat JBoss) - example produce
-->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>tycho-its-project.surefire.p2InstalledRuntime</groupId>
<artifactId>provisionedApplicationParent</artifactId>
<version>1.0.0</version>
</parent>

<artifactId>spir.pluginTest</artifactId>

<packaging>eclipse-test-plugin</packaging>

<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<version>${tycho-version}</version>
<configuration>
<testRuntime>p2Installed</testRuntime>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-compiler-plugin</artifactId>
<version>${tycho-version}</version>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package testPlugin;

import java.io.File;

import junit.framework.TestCase;

import plugin.MyPlugin;

public class PluginTest extends TestCase {

public void testPlugin() throws Exception {
MyPlugin underTest = new MyPlugin();
assertEquals("Hello", underTest.sayHello());
}

}
8 changes: 8 additions & 0 deletions tycho-its/projects/surefire.p2InstalledRuntime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
</repositories>

<modules>
<module>example-plugin</module>
<module>example-feature</module>
<module>example-product</module>
</modules>
Expand Down Expand Up @@ -67,5 +68,12 @@
<module>extProductTestDirector</module>
</modules>
</profile>
<profile>
<!-- scenario 4: run tests on a feature -->
<id>noProduct</id>
<modules>
<module>pluginTest</module>
</modules>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
package org.eclipse.tycho.test.surefire;

import java.util.List;

import org.apache.maven.it.Verifier;
import org.eclipse.tycho.TargetEnvironment;
import org.eclipse.tycho.test.AbstractTychoIntegrationTest;
Expand Down Expand Up @@ -62,6 +61,14 @@ public void testDifferentHarnessVersions() throws Exception {
verifier.verifyErrorFreeLog();
}

@Test
public void testNoProduct() throws Exception {
Verifier verifier = getVerifier("surefire.p2InstalledRuntime");
verifier.addCliOption("-PnoProduct");
verifier.executeGoals(List.of("clean", "integration-test"));
verifier.verifyErrorFreeLog();
}

private static String getProductClassifier() {
TargetEnvironment currentEnv = TargetEnvironment.getRunningEnvironment();
return String.join(".", currentEnv.getOs(), currentEnv.getWs(), currentEnv.getArch());
Expand Down

0 comments on commit b2cc639

Please sign in to comment.