1 Reply Latest reply on Dec 2, 2013 2:05 PM by Keith Babo

    Arquillian testing of a single Service in a war

    Michael Burman Newbie

      Hi,

       

      How does one test one service in Arquillian with war deployment? The provided examples of Arquillian deployments are copying the whole package to the container, which is something I don't want, as I want to test with different settings (such as different persistence.xml to enable query logging and different DataSource file for H2).

       

      I have following structure for this example service:

       

      RESTEasyGateway + CustomComposer -> Service, which calls with @Inject a @Stateless bean which has @PersistenceContext. Testing the EJB & Persistence works fine with Arquillian, however trying to test the whole call from the start to the end (sort of like integration testing) proves problematic.

       

      Trying to deploy AS war with the following properties:

       

      
      
      
          
      return ShrinkWrap.create(WebArchive.class, "routingServiceTest.war")
      
      
                  
      .addClasses(RoutingModifier.class, RoutingDao.class, Operator.class, RoutingModifier_.class, Operator_.class, 
      
      
                 
      
      
       RoutingService.class, SearchCriteria.class, RoutingComposer.class, RoutingServiceBean.class)
      
      
                  
      .addAsResource("META-INF/dev-persistence.xml", "META-INF/persistence.xml")
      
      
                  
      .addAsWebInfResource("META-INF/switchyard-routingservice.xml")
      
      
                  
      .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
      
      
                  
      .addAsWebInfResource("test-ds.xml");
      
      
      
      
      
      

       

      Goes quite far, but in the end I get the following error:

       

      Caused by: java.lang.ClassNotFoundException: org.switchyard.component.resteasy.composer.RESTEasyMessageComposer

       

      Target is EAP 6.1.0 + SwitchYard 1.1 (the app works fine when deployed normally). Maybe this is more related to the WAR deployment style, but the deployment page had nothing special.