我已经用Arquillian进行了测试,但是当我试图到达那里时它只给了我404。我在日志中发现的内容:
3:04:30,320 INFO [org.wildfly.extension.undertow] (MSC service thread 1-11) JBAS017534: Registered web context: /d98c2952-075b-42ac-bf5b-e56940574105
23:04:30,417 INFO [org.jboss.as.server] (management-handler-thread - 3) JBAS018559: Deployed "d98c2952-075b-42ac-bf5b-e56940574105.war" (runtime-name : "d98c2952-075b-42ac-bf5b-e56940574105.war")
23:04:32,412 INFO [org.wildfly.extension.undertow] (MSC service thread 1-4) JBAS017535: Unregistered web context: /d98c2952-075b-42ac-bf5b-e56940574105
23:04:32,418 INFO [org.jboss.weld.deployer] (MSC service thread 1-1) JBAS016009: Stopping weld service for deployment d98c2952-075b-42ac-bf5b-e56940574105.war
23:04:32,455 INFO [org.jboss.as.server.deployment] (MSC service thread 1-15) JBAS015877: Stopped deployment d98c2952-075b-42ac-bf5b-e56940574105.war (runtime-name: d98c2952-075b-42ac-bf5b-e56940574105.war) in 46ms
23:04:32,472 INFO [org.jboss.as.repository] (management-handler-thread - 3) JBAS014901: Content removed from location /home/dawid/java/tools/wildfly-8.1.0.Final/standalone/data/content/33/6bed642862d3cdee740b4f24aa8a9226a50bfc/content
23:04:32,472 INFO [org.jboss.as.server] (management-handler-thread - 3) JBAS018558: Undeployed "d98c2952-075b-42ac-bf5b-e56940574105.war" (runtime-name: "d98c2952-075b-42ac-bf5b-e56940574105.war")
Tests run: 3, Failures: 2, Errors: 1, Skipped: 0, Time elapsed: 16.128 sec <<< FAILURE!
testGettingValues(com.sargent.rest.UserFileRestfulTest) Time elapsed: 0.483 sec <<< ERROR!
javax.ws.rs.NotFoundException: HTTP 404 Not Found
我可以从日志中看出应用程序在测试之前已取消部署。有什么想法吗?
答案 0 :(得分:0)
在测试失败之前可能没有部署。在从JUnit输出任何日志之前,Arquillian通常会输出所有服务器输出。这让我的团队中的人多次混淆。
我会在arquillian.xml文件中配置deploymentExportPath,以便您可以获得已保存的war副本。然后,您可以手动将其部署到服务器,并在获得404时自行测试。只有在此之后,我才会怀疑Arquillian是否正在加载它。