2 Replies Latest reply on May 3, 2012 6:34 AM by bosschaert

    Can Arquillian be configured not to enhance OSGi @Deployments?

    bosschaert

      I noticed that if you return an OSGi bundle in an arquillian @Deployment annotated method, that it gets enhanced with additional classes and additional imports and exports. For my test this is undesirable (specifically, some of the generated imports are not needed on the OSGi side and do not resolve). Is there a way to let Arquillian simply leave the returned bundle the way it is?

        • 1. Re: Can Arquillian be configured not to enhance OSGi @Deployments?
          thomas.diesler

          The ARQ deployment is always enhanced - this is because it needs (at least) the test case that it runs.

          In the case of an OSGi deployment we also need a boat load of imports to make that work.

           

          If you need more control you can use the Deployer API - have a look at SimpleArquillianDeployerTestCase

          1 of 1 people found this helpful
          • 2. Re: Can Arquillian be configured not to enhance OSGi @Deployments?
            bosschaert

            Thanks Thomas, that helped. In my case the test is actually one that drives the management API, so the test itself is not run from within OSGi, hence I don't need the test enhancement for ones that do. The test simply needs to be able to do a remote deployment of an OSGi bundle as-is.

            I found that decorating the annotation with 'testable = false' does the job, i.e. like this:

             

             

            {code:java}

                @Deployment(name = "test-bundle", managed = false, testable = false)

                public static JavaArchive createTestBundle() {

                    return ... the archive ...

                }{code}