Skip to content

Commit

Permalink
Add integration-test for Product with included JustJ JRE
Browse files Browse the repository at this point in the history
  • Loading branch information
HannesWell committed Mar 24, 2023
1 parent 672552e commit d5fd4d4
Show file tree
Hide file tree
Showing 13 changed files with 161 additions and 0 deletions.
1 change: 1 addition & 0 deletions tycho-its/projects/resolver.justjJRE/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.polyglot.*
8 changes: 8 additions & 0 deletions tycho-its/projects/resolver.justjJRE/.mvn/extensions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<extensions>
<extension>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-build</artifactId>
<version>${tycho-version}</version>
</extension>
</extensions>
1 change: 1 addition & 0 deletions tycho-its/projects/resolver.justjJRE/.mvn/maven.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-Dtycho-version=4.0.0-SNAPSHOT
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: simple.bundle1
Bundle-Version: 1.0.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-11
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bin.includes = META-INF/
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: simple.bundle2
Bundle-Version: 1.0.0.qualifier
Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=11))"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bin.includes = META-INF/
74 changes: 74 additions & 0 deletions tycho-its/projects/resolver.justjJRE/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>foo</groupId>
<artifactId>bar</artifactId>
<version>4.0.0-SNAPSHOT</version>
<packaging>pom</packaging>

<modules>
<module>bundles</module>
<module>simple.feature</module>
<module>simple.product</module>
<module>simple.target</module>
</modules>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>11</java.version><!-- Java version must not match version of JVM running the build, otherwise the intended parts are not tested -->
</properties>

<build>
<pluginManagement>
<plugins>

<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-compiler-plugin</artifactId>
<version>${tycho-version}</version>
</plugin>

<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-p2-director-plugin</artifactId>
<version>${tycho-version}</version>
</plugin>

<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-p2-publisher-plugin</artifactId>
<version>${tycho-version}</version>
<configuration>
<profiles>JavaSE-${java.version}</profiles>
</configuration>
</plugin>

</plugins>
</pluginManagement>

<plugins>

<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>${tycho-version}</version>
<extensions>true</extensions>
</plugin>

<!-- Target-Platform configuration -->
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho-version}</version>
<configuration>
<!--The execution environment must match the include jre, see https://www.eclipse.org/justj/?page=documentation -->
<executionEnvironment>org.eclipse.justj.openjdk.hotspot.jre.full-${java.version}</executionEnvironment>
<target>
<file>${maven.multiModuleProjectDirectory}/simple.target/simple.target</file>
</target>
</configuration>
</plugin>

</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bin.includes = feature.xml
10 changes: 10 additions & 0 deletions tycho-its/projects/resolver.justjJRE/simple.feature/feature.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<feature
id="simple.feature"
version="1.0.0.qualifier">

<plugin
id="simple.bundle2"
version="0.0.0" />

</feature>
21 changes: 21 additions & 0 deletions tycho-its/projects/resolver.justjJRE/simple.product/simple.product
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<?pde version="3.5"?>

<product uid="simple" id="org.eclipse.platform.ide" application="org.eclipse.ui.ide.workbench" version="1.0.0.qualifier" type="mixed" includeLaunchers="true" autoIncludeRequirements="true">

<vm>
<linux include="true">org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11</linux>
<macos include="true">org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11</macos>
<windows include="true">org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11</windows>
</vm>

<plugins>
<plugin id="simple.bundle1"/>
</plugins>

<features>
<feature id="org.eclipse.justj.openjdk.hotspot.jre.full"/>
<feature id="simple.feature"/>
</features>

</product>
15 changes: 15 additions & 0 deletions tycho-its/projects/resolver.justjJRE/simple.target/simple.target
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?>
<target name="simple">
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/releases/2022-12/"/>
<unit id="org.eclipse.osgi" version="0.0.0"/>
<unit id="org.eclipse.equinox.executable.feature.group" version="0.0.0"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<repository location="https://download.eclipse.org/justj/jres/11/updates/release/latest"/>
<unit id="org.eclipse.justj.openjdk.hotspot.jre.full.feature.group" version="0.0.0"/>
</location>
</locations>
</target>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package org.eclipse.tycho.test.resolver;

import java.util.List;

import org.apache.maven.it.Verifier;
import org.eclipse.tycho.test.AbstractTychoIntegrationTest;
import org.junit.Test;

public class JustJJRETest extends AbstractTychoIntegrationTest {

@Test
public void testProductWithJustJJREdifferentToRunningJVM() throws Exception {
Verifier verifier = getVerifier("resolver.justjJRE");
verifier.executeGoals(List.of("clean", "verify"));
verifier.verifyErrorFreeLog();
}

}

0 comments on commit d5fd4d4

Please sign in to comment.