2016-09-29 2 views
0

반대 배포 항아리와 실행 테스트 :Arquillian : 나는 그런 Arquillian 검사를

은 어떤 문제가
19:18:34,773 WARN [org.jboss.weld.deployer] (MSC service thread 1-5) JBAS016012: Deployment deployment "test.war" contains CDI annotations but beans.xml was not found. 
19:18:34,822 INFO [org.jboss.web] (ServerService Thread Pool -- 15) JBAS018210: Register web context: /test 
19:18:35,010 INFO [org.jboss.as.server] (management-handler-thread - 2) JBAS018559: Deployed "test.war" (runtime-name : "test.war") 
19:18:35,590 INFO [org.jboss.web] (ServerService Thread Pool -- 15) JBAS018224: Unregister web context: /test 
19:18:35,617 INFO [org.jboss.as.server.deployment] (MSC service thread 1-8) JBAS015877: Stopped deployment test.war (runtime-name: test.war) in 30ms 

:

@Deployment 
public static JavaArchive createDeployment() { 
    return ShrinkWrap.create(JavaArchive.class, "ejb.jar");// ejb.jar is in a resource root 
} 

@EJB 
private DateService dateService; 

@Test 
public void shouldBeAbleToInjectEJB() throws Exception { 
    Assert.assertNotNull(dateService); 
} 

나는 Arquillian 전쟁의 장식을지지하고 서버에 배포하려고 볼 ? 왜 즉시 배포되지 않았습니까?

+0

0.5 초 후에 배포가 취소 되었습니까? 테스트를 실행하기에 충분 했습니까? 전체 배포 방법입니까? 그러한 경우에는 이것이 실패해야합니다. –

답변

0

Jar에 자원을 추가하지 않았습니다. ejb가 추가되었습니다. DateService는 생성하고 테스트하려는 EJB입니까? 테스트를 실행중인 프로젝트에 있습니까? Arquillian에서는 배포 된 jar에 필요한 모든 리소스를 추가해야합니다.

@Deployment 
public static JavaArchive createDeployment() { 
    return ShrinkWrap.create(JavaArchive.class, "ejb.jar").addClass(DateService.class);// ejb.jar is in a resource root 
} 

@EJB 
private DateService dateService; 

@Test 
public void shouldBeAbleToInjectEJB() throws Exception { 
    Assert.assertNotNull(dateService); 
}