5 Replies Latest reply on Jan 16, 2013 7:30 AM by Karel Piwko

    Getting Resource URL in Multi-Deployment Tests

    Bryan Saunders Newbie

      We are trying to code some functional tests for our application and are running in to some issues developing the test. Essentially we have an application with several SOAP endpoints and we want to be able to deploy two or more of these Servers and have them communicate via the SOAP endpoints. We are able to create two deployments inside the test class, without a problem. Lets call them Deployment A and B. From inside our test case for Deployment A we are able to get the URL for Deployment A and call its SOAP endpoints, however, we can not figure our how to get the URL for Deployment B inside our test case that is written to operate on Deployment A. The reason we need the URL for B in the test case for A is because we need to pass it to our SOAP endpoint on Deployment A.

       

      I do not have our actual code with me, but here is some psuedo code of what we are trying to do.

       

      {code}

      @RunWith(Arquillian.class)

      public class TestClass {

               

                @Deployment(order = 1, name = "serverA")

                public static WebArchive createTestDeployment() { }


           @Deployment(order = 2, name = "serverB")

           public static WebArchive createTestDeployment2() { }


           @Test

                @OperateOnDeployment("serverA")

           @RunAsClient

                public void callServerA(@ArquillianResource serverAUrl) throws Exception {

                     // Call SOAP Endpoint

                     // Need the URL for serverB Here

           }

       

           @Test

                @OperateOnDeployment("serverB")

                @RunAsClient

                public void callActive1() throws Exception { }

      }

      {code}