summaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--java/sca/modules/node-launcher-equinox/src/main/java/org/apache/tuscany/sca/node/equinox/launcher/EquinoxHost.java21
-rw-r--r--java/sca/modules/node-launcher-equinox/src/test/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherTestCase.java2
2 files changed, 17 insertions, 6 deletions
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 945e67cb3f..03c99a86c6 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
@@ -30,6 +30,7 @@ import static org.apache.tuscany.sca.node.equinox.launcher.NodeLauncherUtil.thir
import static org.apache.tuscany.sca.node.equinox.launcher.NodeLauncherUtil.thisBundleLocation;
import java.io.File;
+import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.net.MalformedURLException;
@@ -154,20 +155,28 @@ public class EquinoxHost {
logger.fine("Equinox location: " + root);
}
- put(props, LocationManager.PROP_INSTANCE_AREA, new File(root, "workspace").toURI().toString());
+ put(props, LocationManager.PROP_INSTANCE_AREA_DEFAULT, new File(root, "workspace").toURI().toString());
put(props, LocationManager.PROP_INSTALL_AREA, new File(root, "install").toURI().toString());
- put(props, LocationManager.PROP_CONFIG_AREA, new File(root, "config").toURI().toString());
- put(props, LocationManager.PROP_USER_AREA, new File(root, "user").toURI().toString());
+ put(props, LocationManager.PROP_CONFIG_AREA_DEFAULT, new File(root, "config").toURI().toString());
+ put(props, LocationManager.PROP_USER_AREA_DEFAULT, new File(root, "user").toURI().toString());
EclipseStarter.setInitialProperties(props);
// Test if the configuration/config.ini or osgi.bundles has been set
// If yes, try to avoid discovery of bundles
if (bundleLocations == null) {
- String config = props.getProperty(LocationManager.PROP_CONFIG_AREA);
- File ini = new File(config, "config.ini");
- if (ini.isFile() || props.getProperty("osgi.bundles") != null) {
+ if (props.getProperty("osgi.bundles") != null) {
bundleLocations = Collections.emptySet();
+ } else {
+ String config = props.getProperty(LocationManager.PROP_CONFIG_AREA);
+ File ini = new File(config, "config.ini");
+ if (ini.isFile()) {
+ Properties iniProps = new Properties();
+ iniProps.load(new FileInputStream(ini));
+ if (iniProps.getProperty("osgi.bundles") != null) {
+ bundleLocations = Collections.emptySet();
+ }
+ }
}
}
diff --git a/java/sca/modules/node-launcher-equinox/src/test/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherTestCase.java b/java/sca/modules/node-launcher-equinox/src/test/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherTestCase.java
index 6186b1799a..5cc40ca77f 100644
--- a/java/sca/modules/node-launcher-equinox/src/test/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherTestCase.java
+++ b/java/sca/modules/node-launcher-equinox/src/test/java/org/apache/tuscany/sca/node/equinox/launcher/NodeLauncherTestCase.java
@@ -33,6 +33,7 @@ public class NodeLauncherTestCase {
@BeforeClass
public static void setUp() {
+ System.setProperty("osgi.configuration.area", "target/equinox/configuration");
try {
launcher = NodeLauncher.newInstance();
} catch (Exception e) {
@@ -42,6 +43,7 @@ public class NodeLauncherTestCase {
@AfterClass
public static void tearDown() {
+ System.clearProperty("osgi.configuration.area");
if (launcher != null) {
launcher.destroy();
}