1 Reply Latest reply on Jun 1, 2017 10:46 AM by Tomaz Cerar

    How to create Arquillian deployment with PicketLink

    Lev Kuznetsov Newbie

      Crossposting here from SO, original post here: java ee - Trouble setting up Arquillian tests for Wildfly app with Picketlink - Stack Overflow

      I'm trying to write Arquillian tests for a web app to be deployed on Wildfly using Picketlink. My setup worked before I added Picketlink and it looks like I can package and deploy my application without any tests (it doesn't work which is why I want the tests so I can develop). Here's my deployment:

       

          @Deployment

          public static WebArchive deployment () {

            WebArchive w = ShrinkWrap.create (WebArchive.class, "test.war");

            w = w.addPackages (true, "us.levk.willow", "org.apache.deltaspike", "org.picketlink");

            w = w.addAsWebInfResource ("beans.xml", "beans.xml");

            w = w.addAsResource ("persistence.xml", "META-INF/persistence.xml");

            w = w.addAsWebInfResource ("jboss-web.xml", "jboss-web.xml");

            w = w.setWebXML ("web.xml");

            return w;

          }

       

      Running a test results in deployment failure due to a lot of missing CDI dependencies; relevant log output here: pastebin

       

       

      `beans.xml` adds `org.apache.deltaspike.security.impl.extension.SecurityInterceptor`, `jboss-web.xml` binds my app to context root, `web.xml` adds resteasy and this is `arquillian.xml`:

       

       

          <arquillian xmlns="http://jboss.org/schema/arquillian" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

            xsi:schemaLocation="

                  http://jboss.org/schema/arquillian

                  http://jboss.org/schema/arquillian/arquillian_1_0.xsd">

       

       

              <!-- Sets the protocol which is how Arquillian talks and executes the tests inside the container -->

            <defaultProtocol type="Servlet 3.0" />

       

       

              <!-- Configuration to be used when the WildFly managed profile is active -->

            <container qualifier="widlfly-managed" default="true">

              <configuration>

                <property name="jbossHome">${jbossHome:target/wildfly-10.1.0.Final}</property>

              </configuration>

            </container>

       

       

          </arquillian>