[英]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.