6 Replies Latest reply on Oct 6, 2013 11:43 AM by fleurystephane

    Arquillian and alternatives in CDI

    fleurystephane

      Hi!

       

      I'd like to build my test which is using alternatives in CDI.

      So I create this code in my test class :

       

      [source, java]

      ----

      @RunWith(Arquillian.class)

      public class FederationServiceTest {

         

          public static WebArchive war;

         

          @Deployment

          public static WebArchive createArchive(){

              war = ShrinkWrap.create(WebArchive.class);

              war.addPackage(FederationService.class.getPackage());

              war.addPackage(Federation.class.getPackage());

              war.addPackage(CountryException.class.getPackage());

              war.addPackage(FederationManagement.class.getPackage());

              war.addAsWebInfResource("WEB-INF/beans.xml");       <1>

             

              return war;

          }

      ----

      <1> : this file is not empty, it contains the alternative used somewhere else

       

      Problem : it doesn't find the src/main/webapp/WEB-INF/beans.xml :

       

      ----

      java.lang.IllegalArgumentException: WEB-INF/beans.xml not found in classloader sun.misc.Launcher$AppClassLoader@5ab8df17

      ----

       

      Thnaks for your help.

       

      Stéphane