使用Picketlink设置Wildfly应用程序的Arquillian测试时遇到问题

时间:2017-05-27 18:49:14

标签: java-ee wildfly jboss-arquillian picketlink

我试图使用Picketlink为使用Wildfly部署的Web应用编写Arquillian测试。在我添加Picketlink之前我的设置工作,看起来我可以打包和部署我的应用程序而无需任何测试(它不起作用,这就是为什么我想要测试,所以我可以开发)。这是我的部署:

@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;
}

由于大量缺少CDI依赖性,运行测试会导致部署失败;相关日志输出:https://pastebin.com/sTD1x1Ag

beans.xml添加了org.apache.deltaspike.security.impl.extension.SecurityInterceptorjboss-web.xml将我的应用绑定到了上下文根,web.xml添加了resteasy,这是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>

0 个答案:

没有答案