use of org.jboss.osgi.metadata.OSGiManifestBuilder in project fabric8 by jboss-fuse.
the class ContainerUpgradeAndRollbackTest method deployment.
@Deployment
@StartLevelAware(autostart = true)
public static Archive<?> deployment() {
final JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "container-upgrade-rollback-test.jar");
archive.addPackage(CommandSupport.class.getPackage());
archive.setManifest(new Asset() {
@Override
public InputStream openStream() {
OSGiManifestBuilder builder = OSGiManifestBuilder.newInstance();
builder.addBundleManifestVersion(2);
builder.addBundleSymbolicName(archive.getName());
builder.addBundleVersion("1.0.0");
builder.addImportPackages(ServiceLocator.class, FabricService.class);
builder.addImportPackages("io.fabric8.git");
builder.addImportPackages(AbstractCommand.class, Action.class);
builder.addImportPackage("org.apache.felix.service.command;status=provisional");
builder.addImportPackages(ConfigurationAdmin.class, ServiceTracker.class, Logger.class);
return builder.openStream();
}
});
return archive;
}
use of org.jboss.osgi.metadata.OSGiManifestBuilder in project narayana by jbosstm.
the class OSGiJTATest method createTestArchive.
@Deployment
public static JavaArchive createTestArchive() {
final JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "test.jar");
archive.addClass(OSGiJTATest.class);
archive.addPackage("org.osgi.util.tracker");
archive.setManifest(new Asset() {
public InputStream openStream() {
OSGiManifestBuilder builder = OSGiManifestBuilder.newInstance();
builder.addBundleSymbolicName(archive.getName());
builder.addBundleManifestVersion(2);
builder.addImportPackages("javax.transaction");
return builder.openStream();
}
});
return archive;
}
use of org.jboss.osgi.metadata.OSGiManifestBuilder in project fabric8 by jboss-fuse.
the class PatchBundlesCommandIntegrationTest method createdeployment.
@Deployment
public static JavaArchive createdeployment() {
final JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "test.jar");
archive.addClass(ServiceLocator.class);
archive.addClass(IOHelpers.class);
archive.addPackage(ServiceTracker.class.getPackage());
archive.addPackages(true, OSGiManifestBuilder.class.getPackage());
archive.addPackage(CommandSupport.class.getPackage());
archive.setManifest(new Asset() {
public InputStream openStream() {
OSGiManifestBuilder builder = OSGiManifestBuilder.newInstance();
builder.addBundleSymbolicName(archive.getName());
builder.addBundleManifestVersion(2);
builder.addImportPackages(Bundle.class, Logger.class);
builder.addImportPackages(AbstractCommand.class, Action.class, Function.class, Validatable.class);
builder.addImportPackages(InvalidComponentException.class);
builder.addImportPackage("org.apache.felix.service.command;status=provisional");
return builder.openStream();
}
});
// add the original bundle as well as the patch zip files as resources
archive.add(createPatchableBundle("1.0.0"), "/bundles", ZipExporter.class);
archive.add(createPatchZipFile("patch-01"), "/patches", ZipExporter.class);
archive.add(createPatchZipFile("patch-02"), "/patches", ZipExporter.class);
archive.add(createPatchZipFile("patch-02-without-range"), "/patches", ZipExporter.class);
return archive;
}
use of org.jboss.osgi.metadata.OSGiManifestBuilder in project fabric8 by jboss-fuse.
the class PatchBundlesCommandIntegrationTest method createPatchableBundle.
// Create a 'patchable' bundle with the specified version
private static JavaArchive createPatchableBundle(final String version) {
final JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "patchable-" + version + ".jar");
archive.setManifest(new Asset() {
public InputStream openStream() {
OSGiManifestBuilder builder = OSGiManifestBuilder.newInstance();
builder.addBundleManifestVersion(2);
builder.addBundleSymbolicName(PATCHABLE_BSN);
builder.addBundleVersion(version);
return builder.openStream();
}
});
return archive;
}
use of org.jboss.osgi.metadata.OSGiManifestBuilder in project fabric8 by jboss-fuse.
the class PatchMigratorTest method createMigratorBundle.
// Create a 'patchable' bundle with the specified version
private static JavaArchive createMigratorBundle(final String version) {
final JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "migrator-1.0.1.jar");
archive.setManifest(new Asset() {
public InputStream openStream() {
OSGiManifestBuilder builder = OSGiManifestBuilder.newInstance();
builder.addBundleManifestVersion(2);
builder.addBundleSymbolicName("migrator");
builder.addBundleVersion(version);
builder.addImportPackages("org.osgi.framework");
builder.addBundleActivator(ExampleMigrator.class);
return builder.openStream();
}
});
archive.addClass(ExampleMigrator.class);
return archive;
}
Aggregations