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

Support container targeted deployments

    Details

    • Type: Feature Request
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 2.0.0.Beta1
    • Component/s: None
    • Labels:
      None

      Description

      in some cases it is useful to be able to define different @Deployments pr target container.

      e.g. Container X needs a different defined deployment descriptor to work etc..

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            aslak Aslak Knutsen added a comment -

            Some form of @Deployment targeting is needed to support multiple containers in same run

            Show
            aslak Aslak Knutsen added a comment - Some form of @Deployment targeting is needed to support multiple containers in same run
            Hide
            dan.j.allen Dan Allen added a comment - - edited

            Note my recommendation here: https://community.jboss.org/message/561762#561762

            One way to accomplish this would be to inject a container identifier into the @Deployment method. Another would be to allow multiple @Deployment methods, each annotated with an execution environment qualifier (and perhaps one without a qualifier that's the fallback). Arquillian would then select the appropriate @Deployment method according to which container I am targeting. ( See Proposal: Filtering out tests not compatible with target container => http://community.jboss.org/thread/156500 ).

            For example:

            @Deployment @JBossAS6Container
            public static Archive<?> createDeploymentForJBossAS()

            { // prepare for JBoss AS 6 }

            @Deployment @GlassFishV3Container
            public static Archive<?> createDeploymentForGlassFish()

            { // prepare for GlassFish V3 }
            Show
            dan.j.allen Dan Allen added a comment - - edited Note my recommendation here: https://community.jboss.org/message/561762#561762 One way to accomplish this would be to inject a container identifier into the @Deployment method. Another would be to allow multiple @Deployment methods, each annotated with an execution environment qualifier (and perhaps one without a qualifier that's the fallback). Arquillian would then select the appropriate @Deployment method according to which container I am targeting. ( See Proposal: Filtering out tests not compatible with target container => http://community.jboss.org/thread/156500 ). For example: @Deployment @JBossAS6Container public static Archive<?> createDeploymentForJBossAS() { // prepare for JBoss AS 6 } @Deployment @GlassFishV3Container public static Archive<?> createDeploymentForGlassFish() { // prepare for GlassFish V3 }
            Hide
            mkouba Martin Kouba added a comment -

            Although the second way (multiple @Deployment methods) looks a little bit more correct/clean, the first one (passing some org.jboss.arquillian.container.spi.Container metadata as a deployment method param) would be a bit more practical imho. Mainly because of the test archives will mostly not differ a lot and the second way would require duplicate information or additional util method creating archive base.

            Show
            mkouba Martin Kouba added a comment - Although the second way (multiple @Deployment methods) looks a little bit more correct/clean, the first one (passing some org.jboss.arquillian.container.spi.Container metadata as a deployment method param) would be a bit more practical imho. Mainly because of the test archives will mostly not differ a lot and the second way would require duplicate information or additional util method creating archive base.
            Hide
            aslak Aslak Knutsen added a comment -
            Show
            aslak Aslak Knutsen added a comment - Some thoughts from Andy Gibbons a while back: http://www.andygibson.net/blog/braindrop/do-we-need-to-giftwrap-shrinkwrap/
            Hide
            mkouba Martin Kouba added a comment -

            I like the idea of profiles and conditional archive elements/parts. However this might require a lot of API changes. I think even the ugly if-else + Container metadata would be great atm...

            Show
            mkouba Martin Kouba added a comment - I like the idea of profiles and conditional archive elements/parts. However this might require a lot of API changes. I think even the ugly if-else + Container metadata would be great atm...

              People

              • Assignee:
                Unassigned
                Reporter:
                aslak Aslak Knutsen
              • Votes:
                2 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Development