1 Reply Latest reply on Jan 22, 2014 3:43 PM by robert.panzer

    What component type is the Arquillian test class run as?

    martin.andersson

      The reference guide says that an Arquillian test "executes inside the container". Knowing what component type the test class will be transformed into is most relevant and needed information. After all, we're doing real tests with Arguillian. All the details matter. I believe that it could be that the Arquillian runtime is declared to be a @Startup @Singleton with TransactionAttributeType.NOT_SUPPORTED? Furthermore, may I annotate my test class as a @Stateful? Knowing more technical details how Arquillian works makes all the difference. But I cannot find this information anywhere.

        • 1. Re: What component type is the Arquillian test class run as?
          robert.panzer

          The simple answer is: It depends!

           

          If you use the servlet protocol (org.jboss.arquillian.protocol:arquillian-protocol-servlet:1.1.2.Final) with a managed or remote container adapter the tests are run in the context of a web application.

          Arquillian will either add itself to the only web module of an ear or add a new one if there is none or you can designate the one to be used.

           

          I am not sure about the context when using an embedded container as I am working with JBoss AS 7 & WebSphere for the most part and these containers don't have embedded container adapters.

           

          When using the JMX protocol I don't know the context either but it is not an the context of some EJB but probably the JMX adapter of the AppServer. So it is rather no context at all. I also had lots of trouble with that when working with multiple deployments in one container that use the same classes.

           

          So I would recommend using the Servlet protocol (2.5 or 3.0). Then you have a well defined context being either your web module or the one created by Arquillian that you can adjust appropriately by adding required refs etc.

           

          Kind regards,

          Robert

          1 of 1 people found this helpful