![](/img/trans.png)
[英]Arquillian integrations tests - cannot run test, when other instance of wildfly is running
[英]Running Arquillian tests for a Wildfly Swarm Web application with custom Main class
我们有一个Web应用程序,使用Wildly Swarm打包为WAR文件。 通过自定义Main类配置Web应用程序,该类在启动swarm应用程序时将进行处理。
现在,我们要使用Arquillian测试来保护我们的应用程序。 启动Web应用程序进行测试时,我们如何配置在Arquillian测试套件中创建的ShrinkWrap存档以使用Main类?
使用依赖
<dependency>
<groupId>org.wildfly.swarm</groupId>
<artifactId>arquillian</artifactId>
</dependency>
它提供了@CreateSwarm
批注,您可以在@CreateSwarm
测试中使用它来创建自定义Swarm对象,就像在主类中一样。
@RunWith(Arquillian.class)
public class SomeTest {
@Deployment
public static JavaArchive createTestArchive() { /* ... */ }
@CreateSwarm
public static Swarm newContainer() throws Exception {
Swarm swarm = new Swarm();
// configure your swarm thingy
return swarm;
}
不幸的是,我实际上还没有开始工作。 在发布时,带有Wildfly Swarm的Arquillian仍然被认为是不稳定的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.