[jboss-osgi-issues] [JBoss JIRA] Created: (JBOSGI-382) Migrate shrinkwrap test bundles

Thomas Diesler (JIRA) jira-events at lists.jboss.org
Thu Aug 12 03:47:49 EDT 2010


Migrate shrinkwrap test bundles 
--------------------------------

                 Key: JBOSGI-382
                 URL: https://jira.jboss.org/browse/JBOSGI-382
             Project: JBoss OSGi
          Issue Type: Task
      Security Level: Public (Everyone can see)
          Components: Other
            Reporter: Thomas Diesler
             Fix For:  JBossOSGi 1.0.x


Currently we use a rather verbose syntax like 

      // Bundle-SymbolicName: simple-fragA
      // Export-Package: org.jboss.test.osgi.fragments.fragA
      // Fragment-Host: simple-hostA
      final JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "simple-hostA");
      archive.addClasses(FragBeanA.class);
      archive.addResource(getResourceFile("fragments/resource.txt"));
      archive.setManifest(new Asset()
      {
         public InputStream openStream()
         {
            OSGiManifestBuilder builder = OSGiManifestBuilder.newInstance();
            builder.addBundleManifestVersion(2);
            builder.addBundleSymbolicName(archive.getName());
            builder.addExportPackages(FragBeanA.class);
            builder.addFragmentHost("simple-hostA");
            return builder.openStream();
         }
      });
      Bundle fragA = installBundle(archive);
      assertBundleState(Bundle.INSTALLED, fragA.getState());

This should be supported natively by Shrinkwrap

      // Bundle-SymbolicName: simple-fragA
      // Export-Package: org.jboss.test.osgi.fragments.fragA
      // Fragment-Host: simple-hostA
      final BundleArchive archive = ShrinkWrap.create(BundleArchive.class, "simple-hostA");
      archive.addClasses(FragBeanA.class);
      archive.addResource(getResourceFile("fragments/resource.txt"));
      archive.addBundleManifestVersion(2);
      archive.addBundleSymbolicName(archive.getName());
      archive.addExportPackages(FragBeanA.class);
      archive.addFragmentHost("simple-hostA");

      Bundle fragA = installBundle(archive);
      assertBundleState(Bundle.INSTALLED, fragA.getState());

or simmilar

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-osgi-issues mailing list