From 8c7f53c15bf5b2dc64d96e1bee8b1f8cc632d48a Mon Sep 17 00:00:00 2001 From: rfeng Date: Tue, 9 Sep 2008 22:24:55 +0000 Subject: Use bundle.getResources to discover services Run the test case within OSGi git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@693637 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/tuscany/sca/node/equinox/launcher/EquinoxHost.java | 5 ++++- .../apache/tuscany/sca/node/equinox/launcher/NodeLauncherUtil.java | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'java/sca/modules/node-launcher-equinox/src/main') diff --git a/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxHost.java b/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxHost.java index 2a6e24f6e0..06bc1907b4 100644 --- a/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxHost.java +++ b/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxHost.java @@ -100,7 +100,7 @@ public class EquinoxHost { props.put("osgi.contextClassLoaderParent", "boot"); // Set the extension bundle - props.put("osgi.framework.extensions", "org.apache.tuscany.sca.extensibility.equinox"); + props.put("osgi.framework.extensions", "org.apache.tuscany.sca.node.launcher.equinox"); // Set startup properties props.put(EclipseStarter.PROP_CLEAN, "true"); @@ -205,6 +205,9 @@ public class EquinoxHost { * @throws IOException */ private static String getBundleName(File file) throws IOException { + if (!file.exists()) { + return null; + } String bundleName = null; if (file.isDirectory()) { File mf = new File(file, "META-INF/MANIFEST.MF"); diff --git a/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherUtil.java b/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherUtil.java index 07da404d12..b422651244 100644 --- a/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherUtil.java +++ b/java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherUtil.java @@ -250,6 +250,7 @@ final class NodeLauncherUtil { if (!entry.isDirectory() && entryName != null && entryName.length() > 0 && !entryName.startsWith(".") + && entryName.endsWith(".class") // Exclude resources from Export-Package && entryName.lastIndexOf("/") > 0) { String pkg = entryName.substring(0, entryName.lastIndexOf("/")).replace('/', '.') + version; packages.add(pkg); -- cgit v1.2.3