}});
ScriptEngineManagerFactory factory = new ScriptEngineManagerFactory();
factory.activate(componentCtx);
ScriptEngineManager first = factory.getScriptEngineManager();
assertNull(first.getEngineByName("dummy"));
final Bundle bundle = context.mock(Bundle.class);
final File factoryFile = createFactoryFile();
context.checking(new Expectations() {{
atLeast(1).of(bundle).getEntry("META-INF/services/javax.script.ScriptEngineFactory");
will(returnValue(factoryFile.toURI().toURL()));
atLeast(1).of(bundle).loadClass(SCRIPT_ENGINE_FACTORY.getName());
will(returnValue(SCRIPT_ENGINE_FACTORY));
}});
factory.bundleChanged(new BundleEvent(BundleEvent.STARTED, bundle));
ScriptEngineManager second = factory.getScriptEngineManager();
assertNotNull(second.getEngineByName("dummy"));
}