use of org.osgi.framework.Version in project aries by apache.
the class BundleRequiredExecutionEnvironmentHeaderTest method testExecutionEnvironment2.
@Test
public void testExecutionEnvironment2() {
String name = "bar";
Version version = Version.parseVersion("2.0.0.qualifier");
ExecutionEnvironment ee = new ExecutionEnvironment(name, version);
assertExecutionEnvironmentName(ee, name);
assertExecutionEnvironmentVersion(ee, version);
}
use of org.osgi.framework.Version in project aries by apache.
the class FragmentHostHeaderTest method testSymbolicName.
@Test
public void testSymbolicName() {
String headerStr = "org.foo";
FragmentHostHeader header = new FragmentHostHeader(headerStr);
assertClauses(header, 1);
assertSymbolicName(header.getClauses().iterator().next(), headerStr);
assertBundleVersionAttribute(header.getClauses().iterator().next(), new VersionRange(VersionRange.LEFT_CLOSED, new Version("0"), null, VersionRange.RIGHT_OPEN));
}
use of org.osgi.framework.Version in project aries by apache.
the class EBAInstaller method uninstall.
public void uninstall(File applicationLocation) throws Exception {
AriesApplicationContext context = appContexts.get(applicationLocation);
String appSymName = context.getApplication().getApplicationMetadata().getApplicationSymbolicName();
Version appVersion = context.getApplication().getApplicationMetadata().getApplicationVersion();
LOGGER.debug("uninstalling {} {} ", new Object[] { appSymName, appVersion });
if (context != null) {
context.stop();
applicationManager.uninstall(context);
}
appContexts.remove(applicationLocation);
LOGGER.debug("uninstalled {} {} state: {}", new Object[] { appSymName, appVersion, context.getApplicationState() });
}
use of org.osgi.framework.Version in project aries by apache.
the class EBAInstaller method install.
public void install(File applicationLocation) throws Exception {
AriesApplication app = applicationManager.createApplication(FileSystem.getFSRoot(applicationLocation));
String appSymName = app.getApplicationMetadata().getApplicationSymbolicName();
Version appVersion = app.getApplicationMetadata().getApplicationVersion();
LOGGER.debug("created app from {} : {} {} with contents {}", new Object[] { applicationLocation.getName(), appSymName, appVersion, app.getApplicationMetadata().getApplicationContents() });
AriesApplicationContext context = applicationManager.install(app);
LOGGER.debug("installed app {} {} state: {}", new Object[] { appSymName, appVersion, context.getApplicationState() });
context.start();
LOGGER.debug("started app {} {} state: {}", new Object[] { appSymName, appVersion, context.getApplicationState() });
// Store the application context away because it is the application context we need
// to pass to the application manager if we're later asked to uninstall the application
appContexts.put(applicationLocation, context);
}
use of org.osgi.framework.Version in project aries by apache.
the class DeploymentGeneratorTest method setup.
@Before
public void setup() throws Exception {
appMetadata = Skeleton.newMock(ApplicationMetadata.class);
Skeleton.getSkeleton(appMetadata).setReturnValue(new MethodCall(ApplicationMetadata.class, "getApplicationSymbolicName"), "aries.test");
Skeleton.getSkeleton(appMetadata).setReturnValue(new MethodCall(ApplicationMetadata.class, "getApplicationVersion"), new Version("1.0.0"));
Skeleton.getSkeleton(appMetadata).setReturnValue(new MethodCall(ApplicationMetadata.class, "getUseBundles"), Collections.EMPTY_LIST);
app = Skeleton.newMock(AriesApplication.class);
Skeleton.getSkeleton(app).setReturnValue(new MethodCall(AriesApplication.class, "getApplicationMetadata"), appMetadata);
deplMFMgr = new DeploymentManifestManagerImpl();
deplMFMgr.setResolver(_resolver);
deplMFMgr.setLocalPlatform(localPlatform);
deplMFMgr.setModellingManager(modellingManager);
deplMFMgr.setModellingHelper(modellingHelper);
deplMFMgr.setPreResolveHooks(new ArrayList<PreResolveHook>());
}
Aggregations