1 Reply Latest reply on Apr 26, 2013 3:30 AM by Bartosz Majsak

    EJB Tests in embedded container?

    toddmerrill Newbie

      Hello all,


      I have to get a working example of Arquillian completed as a smoke test for our environment for early next week (if possible).  We have a bunch of stateless EJBs that are being tested with a full Ear-build and round trip to the server and I was hoping to cut each bean test down to the bare minimum and run them locally in an embedded container to save the developers (considerable) time and effort.  After running through the getting started guide, I moved to ''getting started: rinse and repeat".   Then, half-way through the guide I read:


      "The test we’ve written uses both CDI and EJB. That combination pushes the boundaries of what an embedded runtime (like Weld Embedded or OpenEJB Embedded) can provide."


      I'm sorry, but WHAT?  That's a huge chunk of surprising and disappointing info there.  Is that so? 


      If not, does anyone have an actual working example of a non-trivial stateless EJB test that runs in an embedded container?  Yes, I can start an external server and use it, but really, if the embedded approach is ineffective for EJBs in Arquillian, you should probably let people know that up front.


      Best regards,


      - Todd

        • 1. Re: EJB Tests in embedded container?
          Bartosz Majsak Master

          Hi Todd,


          I think you are overreacting You misinterpreted this statement I believe. For my understanding this sentence says that embedded containers might be a bit limited. Consider the example that you have EJB and CDI mixed together within your integration test. You can't really use both Weld Embedded and OpenEJB at the same time (or at least ain't that easy). On the other hand you can still use embedded Glassfish, which provides both.


          I can't agree with you saying that embedded approach is not effective with Arquillian, it's more that embedded approach might not be the most effective approach in general. Based on my experience, integration tests for Arquillian Persistence Extension run slightly faster on AS7 managed comparing to GF 3.1 embedded.


          For the reference which container provides which technologies please have to the reference documentation