2 Replies Latest reply on Mar 28, 2012 4:50 AM by reschifl

    integration test with Arquillian?

    reschifl

      Hello,

       

      I need to perform an integration test using two separate EARs to test remote calls of EJBs.

       

      Can this be done using Arquillian?

       

      Regards,

      Lars

        • 1. Re: integration test with Arquillian?
          aslak

          sure, soemthing like this should work:

           

           

          @RunWith(Arquillian.class)
          public class TestClass {
          
          
            @Deployment(name = "X")
            public static EnterpriseArchive back() {
              return ShrinkWrap.create(EnterpriseArchive.class)
                .addAsModule(ShrinkWrap.create(JavaArchive.class)
                  .addClass(MyEJB.class));
            }
          
          
            @Deployment(name = "Y")
            public static EnterpriseArchive client() {
              return ShrinkWrap.create(EnterpriseArchive.class)
                .addAsModule(ShrinkWrap.create(JavaArchive.class)
                  .addClass(MyEJB.class));
            }
            
            @EJB(mappedName="some-jndi-name")
            private MyEJB ejb;
            
            @Test @OperatedOnDeployment("Y")
            public void shouldBeAbleTo() throws Exception {
              Assert.assertNotNull(ejb);
            }
          }
          
          
          • 2. Re: integration test with Arquillian?
            reschifl

            Hello Aslak,

             

            thank you for you answer.

             

            This looks great easy and works fine except the error shows here:

            https://community.jboss.org/thread/196560

             

            Regards,

            Lars