Search in sources :

Example 21 with OSGiManifestBuilder

use of org.jboss.osgi.metadata.OSGiManifestBuilder in project fabric8 by jboss-fuse.

the class ExtendedCreateChildContainerTest method deployment.

@Deployment
@StartLevelAware(autostart = true)
public static Archive<?> deployment() {
    final JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "extended-child-container-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);
            builder.addImportPackages(CuratorFramework.class, ZooKeeperUtils.class, ZkPath.class);
            return builder.openStream();
        }
    });
    return archive;
}
Also used : Action(org.apache.felix.gogo.commands.Action) ServiceTracker(org.osgi.util.tracker.ServiceTracker) InputStream(java.io.InputStream) AbstractCommand(org.apache.felix.gogo.commands.basic.AbstractCommand) ZooKeeperUtils(io.fabric8.zookeeper.utils.ZooKeeperUtils) ZkPath(io.fabric8.zookeeper.ZkPath) Logger(org.slf4j.Logger) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) ServiceLocator(io.fabric8.api.gravia.ServiceLocator) CuratorFramework(org.apache.curator.framework.CuratorFramework) FabricService(io.fabric8.api.FabricService) OSGiManifestBuilder(org.jboss.osgi.metadata.OSGiManifestBuilder) Asset(org.jboss.shrinkwrap.api.asset.Asset) ConfigurationAdmin(org.osgi.service.cm.ConfigurationAdmin) CommandSupport(io.fabric8.itests.support.CommandSupport) StartLevelAware(org.jboss.arquillian.osgi.StartLevelAware) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 22 with OSGiManifestBuilder

use of org.jboss.osgi.metadata.OSGiManifestBuilder in project fabric8 by jboss-fuse.

the class BootstrapServiceTest method deployment.

@Deployment
@StartLevelAware(autostart = true)
public static Archive<?> deployment() {
    final JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "bootstrap-service-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);
            return builder.openStream();
        }
    });
    return archive;
}
Also used : ServiceLocator(io.fabric8.api.gravia.ServiceLocator) InputStream(java.io.InputStream) FabricService(io.fabric8.api.FabricService) OSGiManifestBuilder(org.jboss.osgi.metadata.OSGiManifestBuilder) Asset(org.jboss.shrinkwrap.api.asset.Asset) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) CommandSupport(io.fabric8.itests.support.CommandSupport) StartLevelAware(org.jboss.arquillian.osgi.StartLevelAware) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 23 with OSGiManifestBuilder

use of org.jboss.osgi.metadata.OSGiManifestBuilder in project fabric8 by jboss-fuse.

the class ContainerStartupTest method deployment.

@Deployment
@StartLevelAware(autostart = true)
public static Archive<?> deployment() {
    final JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "container-startup-test.jar");
    archive.addClasses(PasswordEncoder.class, Base64Encoder.class);
    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(ConfigurationAdmin.class, ServiceTracker.class, Logger.class);
            return builder.openStream();
        }
    });
    return archive;
}
Also used : ServiceLocator(io.fabric8.api.gravia.ServiceLocator) ServiceTracker(org.osgi.util.tracker.ServiceTracker) InputStream(java.io.InputStream) FabricService(io.fabric8.api.FabricService) OSGiManifestBuilder(org.jboss.osgi.metadata.OSGiManifestBuilder) Asset(org.jboss.shrinkwrap.api.asset.Asset) Logger(org.slf4j.Logger) ConfigurationAdmin(org.osgi.service.cm.ConfigurationAdmin) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) CommandSupport(io.fabric8.itests.support.CommandSupport) StartLevelAware(org.jboss.arquillian.osgi.StartLevelAware) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 24 with OSGiManifestBuilder

use of org.jboss.osgi.metadata.OSGiManifestBuilder in project fabric8 by jboss-fuse.

the class FabricCreateCommandTest method deployment.

@Deployment
@StartLevelAware(autostart = true)
public static Archive<?> deployment() {
    final JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "create-command-test.jar");
    archive.addClasses(PasswordEncoder.class, Base64Encoder.class);
    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;
}
Also used : Action(org.apache.felix.gogo.commands.Action) ServiceTracker(org.osgi.util.tracker.ServiceTracker) InputStream(java.io.InputStream) AbstractCommand(org.apache.felix.gogo.commands.basic.AbstractCommand) Logger(org.slf4j.Logger) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) ServiceLocator(io.fabric8.api.gravia.ServiceLocator) FabricService(io.fabric8.api.FabricService) OSGiManifestBuilder(org.jboss.osgi.metadata.OSGiManifestBuilder) Asset(org.jboss.shrinkwrap.api.asset.Asset) ConfigurationAdmin(org.osgi.service.cm.ConfigurationAdmin) CommandSupport(io.fabric8.itests.support.CommandSupport) StartLevelAware(org.jboss.arquillian.osgi.StartLevelAware) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 25 with OSGiManifestBuilder

use of org.jboss.osgi.metadata.OSGiManifestBuilder in project fabric8 by jboss-fuse.

the class PatchApplyTest 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");
            builder.addBundleVersion(version);
            return builder.openStream();
        }
    });
    return archive;
}
Also used : ByteArrayInputStream(java.io.ByteArrayInputStream) InputStream(java.io.InputStream) OSGiManifestBuilder(org.jboss.osgi.metadata.OSGiManifestBuilder) Asset(org.jboss.shrinkwrap.api.asset.Asset) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive)

Aggregations

OSGiManifestBuilder (org.jboss.osgi.metadata.OSGiManifestBuilder)26 Asset (org.jboss.shrinkwrap.api.asset.Asset)26 JavaArchive (org.jboss.shrinkwrap.api.spec.JavaArchive)26 InputStream (java.io.InputStream)25 Deployment (org.jboss.arquillian.container.test.api.Deployment)22 ServiceTracker (org.osgi.util.tracker.ServiceTracker)20 CommandSupport (io.fabric8.itests.support.CommandSupport)18 Logger (org.slf4j.Logger)17 FabricService (io.fabric8.api.FabricService)16 ServiceLocator (io.fabric8.api.gravia.ServiceLocator)16 Action (org.apache.felix.gogo.commands.Action)16 AbstractCommand (org.apache.felix.gogo.commands.basic.AbstractCommand)16 StartLevelAware (org.jboss.arquillian.osgi.StartLevelAware)16 ConfigurationAdmin (org.osgi.service.cm.ConfigurationAdmin)15 Validatable (io.fabric8.api.scr.Validatable)5 Bundle (org.osgi.framework.Bundle)5 Service (io.fabric8.patch.Service)3 PatchManagement (io.fabric8.patch.management.PatchManagement)3 ZooKeeperUtils (io.fabric8.zookeeper.utils.ZooKeeperUtils)3 ByteArrayInputStream (java.io.ByteArrayInputStream)3