Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable the birt-runtime-test of birt-runtime-osgi #1772

Merged
merged 1 commit into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@
package org.eclipse.birt.sdk;

import java.io.File;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;
import java.lang.reflect.Field;
import java.lang.reflect.Method;

@SuppressWarnings("javadoc")
// TODO This works locally for me on Windows but fails on the Linux build machines.
// One must first do a full Maven build for these artifacts to be available in the target folder.
public abstract class RuntimeOSGiTest extends BaseTestTemplate {
public class RuntimeOSGiTest extends BaseTestTemplate {
public int run(String[] args) throws Exception {
System.setProperty("BIRT_HOME",
new File("./target/birt-runtime-osgi/ReportEngine/platform/").getAbsolutePath());
Expand All @@ -26,7 +27,13 @@ public int run(String[] args) throws Exception {

// Start the Platform to start the Equinox framework.
Class<?> platformClass = loader.loadClass("org.eclipse.birt.core.framework.Platform"); //$NON-NLS-1$
platformClass.getMethod("startup").invoke(null);
MethodHandle startup = MethodHandles.publicLookup().findStatic(platformClass, "startup",
MethodType.methodType(void.class));
try {
startup.invoke();
} catch (Throwable e) {
throw new Exception(e);
}

// Get the launcher from the started Platform.
Field launcherField = platformClass.getDeclaredField("launcher");
Expand Down
2 changes: 2 additions & 0 deletions build/org.eclipse.birt.api/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@
<include name="org.eclipse.emf.common_*.jar" />
<include name="org.eclipse.emf.ecore.xmi_*.jar" />
<include name="org.eclipse.emf.ecore_*.jar" />
<!--
<include name="org.eclipse.equinox.common_*.jar" />
-->
<include name="org.w3c.css.sac_*.jar" />
<include name="com.ibm.icu_*.jar" />
<include name="javax*.jar" />
Expand Down
Loading