Uploaded image for project: 'Arquillian'
  1. Arquillian
  2. ARQ-193

Create auxillary OSGi test bundle

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Done
    • Icon: Major Major
    • 1.0.0.Beta1
    • None
    • OSGi Containers
    • None

      Currently the test bundle must contain the test case and a number of Import-Package statemetns related to the test infrastructure

      @Deployment
      public static JavaArchive createdeployment()
      {
      final JavaArchive archive = ShrinkWrap.create("test.jar", JavaArchive.class);
      archive.setManifest(new Asset()
      {
      public InputStream openStream()

      { OSGiManifestBuilder builder = OSGiManifestBuilder.newInstance(); builder.addBundleSymbolicName(archive.getName()); builder.addBundleManifestVersion(2); builder.addBundleActivator(SimpleActivator.class.getName()); // [TODO] generate a separate bundle the contains the test case builder.addExportPackages(OSGiEmbeddedFrameworkTestCase.class); builder.addImportPackages("org.jboss.arquillian.junit", "org.jboss.shrinkwrap.api", "org.jboss.shrinkwrap.api.spec"); builder.addImportPackages("javax.inject", "org.junit", "org.junit.runner"); return builder.openStream(); }

      });
      archive.addClasses(SimpleActivator.class, SimpleService.class);
      archive.addClasses(OSGiEmbeddedFrameworkTestCase.class);
      return archive;
      }

      There test bundle should not need to contain the test case nor these additional imports. An auxillary bundle that contains the test case should be generated and installed

              tdiesler@redhat.com Thomas Diesler
              tdiesler@redhat.com Thomas Diesler
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: