From d24b06045290067342e408be14f0c0629fbb1a35 Mon Sep 17 00:00:00 2001 From: John Arthorne Date: Fri, 28 Jun 2013 11:43:28 -0400 Subject: Fixed simple configurator test to allow running against framework in workspace --- .../simpleconfigurator/AbstractSimpleConfiguratorTest.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'bundles/org.eclipse.equinox.p2.tests') diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/AbstractSimpleConfiguratorTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/AbstractSimpleConfiguratorTest.java index 736bbd671..2c1da14f2 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/AbstractSimpleConfiguratorTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/simpleconfigurator/AbstractSimpleConfiguratorTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2009 IBM Corporation and others. + * Copyright (c) 2007, 2013 IBM Corporation 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 @@ -79,6 +79,11 @@ public abstract class AbstractSimpleConfiguratorTest extends AbstractProvisionin File installarea = TestActivator.context.getDataFile(getName() + "/eclipse"); File configarea = new File(installarea, "configuration"); URL osgiBundle = osgiBundleLoc.toURI().toURL(); + //if we have framework in workspace need to add the bin directory + URL osgiBundleDevPath = null; + if (!osgiBundle.getPath().endsWith(".jar")) { + osgiBundleDevPath = new URL(osgiBundle, "bin/"); + } Map frameworkProperties = new HashMap(); // note that any properties you do not want to be inherited from the hosting Equinox will need @@ -96,7 +101,8 @@ public abstract class AbstractSimpleConfiguratorTest extends AbstractProvisionin frameworkProperties.put("org.eclipse.equinox.simpleconfigurator.configUrl", bundleInfo.toURL().toExternalForm()); frameworkProperties.put("osgi.dev", "bin/"); - equinox = new EmbeddedEquinox(frameworkProperties, new String[] {}, new URL[] {osgiBundle}); + URL[] osgiPath = osgiBundleDevPath == null ? new URL[] {osgiBundle} : new URL[] {osgiBundle, osgiBundleDevPath}; + equinox = new EmbeddedEquinox(frameworkProperties, new String[] {}, osgiPath); return equinox.startFramework(); } catch (MalformedURLException e) { return null; -- cgit v1.2.3