*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import org.eclipse.core.runtime.adaptor.EclipseStarter;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.eclipse.core.runtime.adaptor.EclipseStarter;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
/** Starts an Equinox runtime and provision it with OSGi boot. */
public class OsgiBootRuntimeTest extends TestCase {
protected OsgiBoot osgiBoot = null;
/** Starts an Equinox runtime and provision it with OSGi boot. */
public class OsgiBootRuntimeTest extends TestCase {
protected OsgiBoot osgiBoot = null;
osgiBoot.installUrls(osgiBoot.getBundlesUrls(OsgiBoot.DEFAULT_BASE_URL,
OsgiBootNoRuntimeTest.BUNDLES));
osgiBoot.installUrls(osgiBoot.getBundlesUrls(OsgiBoot.DEFAULT_BASE_URL,
OsgiBootNoRuntimeTest.BUNDLES));
for (Iterator keys = map.keySet().iterator(); keys.hasNext();) {
Object key = keys.next();
Bundle bundle = (Bundle) map.get(key);
for (Iterator keys = map.keySet().iterator(); keys.hasNext();) {
Object key = keys.next();
Bundle bundle = (Bundle) map.get(key);
osgiBoot.startBundles("org.argeo.osgi.boot.test.bundle2");
long begin = System.currentTimeMillis();
while (System.currentTimeMillis() - begin < 10000) {
osgiBoot.startBundles("org.argeo.osgi.boot.test.bundle2");
long begin = System.currentTimeMillis();
while (System.currentTimeMillis() - begin < 10000) {
Bundle bundle = (Bundle) mapBundles
.get("org.argeo.osgi.boot.test.bundle2");
if (bundle.getState() == Bundle.ACTIVE) {
Bundle bundle = (Bundle) mapBundles
.get("org.argeo.osgi.boot.test.bundle2");
if (bundle.getState() == Bundle.ACTIVE) {
BundleContext bundleContext = startRuntime();
osgiBoot = new OsgiBoot(bundleContext);
}
public void tearDown() throws Exception {
BundleContext bundleContext = startRuntime();
osgiBoot = new OsgiBoot(bundleContext);
}
public void tearDown() throws Exception {