2012-09-11 6 views
3

프로젝트에서 Arquillian Drone을 사용하여 통합 테스트를 도입하려고합니다. 몇 가지 작은 데모 애플 리케이션을했고, 물건을 읽고, 마침내 비교적 단순한 웹 페이지에 대한 간단한 통합 테스트를 작성하려고했습니다.배치 URL이 Arquillian Drone과 통합 테스트에 주입되지 않았습니다.

필자는 모든 필수 종속성을 해결했으며 Intelli Idea에서 테스트 클래스를 실행할 수 있다고 생각합니다.

java.lang.RuntimeException가 : 필드의 java.net.URL com.example.BEViewUIWithDrone.deploymentURL (...)에 대한 값을 조회 할 수 없습니다

을 내가 그것을 실행할 때 내가 말하는 예외를 얻고있다

java.lang.RuntimeException가 : Class 형의 java.net.URL에 대한 공급자 null 값을 반환 org.jboss.arquillian.container.test.impl.enricher.resource.URLResourceProvider @

에 의한 6e73a35c at org.jboss.arquillian.test.impl.enricher.resource.ArquillianRe org.jboss.arquillian.test.impl.enricher.resource.ArquillianResourceTestEnricher.enrich에서 sourceTestEnricher.lookup (ArquillianResourceTestEnricher.java:115) (ArquillianResourceTestEnricher.java:57) "(낮은 전체 스택 추적)

내 테스트 클래스 :

public class BEViewUIWithDrone extends Arquillian { 

    private static final String WEBAPP_SRC = "project/src/main/webapp"; 

    @Drone 
    private DefaultSelenium selenium; 

    @ArquillianResource 
    URL deploymentURL; 


    @Deployment(testable = false) 
    public static WebArchive createDeployment() { 

     MavenDependencyResolver resolver = DependencyResolvers 
       .use(MavenDependencyResolver.class) 
       .loadDependenciesFromPom("pom.xml"); 

     File[] jbossLogging = resolver.artifact("org.jboss.logging:jboss-logging:3.0.0.GA").resolveAsFiles(); 
     File[] solder = resolver.artifact("org.jboss.seam.solder:seam-solder:3.0.0.Final").resolveAsFiles(); 

     return ShrinkWrap.create(WebArchive.class, "be-view.war") 
       .addAsLibraries(jbossLogging) 
       .addAsLibraries(solder) 
       .addClasses(BorrowingEntityService.class) 
       .addClasses(BorrowingEntityViewService.class) 
       .addClasses(ViewingService.class) 
       .addClasses(QueryLimit.class) 
       .addClasses(CustomerService.class) 
       .addClasses(MockProducer.class) 
       .addAsWebResource(new File(WEBAPP_SRC, "view/be/borrowingEntityView.xhtml")) 
       .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml") 
       .addAsWebInfResource(
         new StringAsset("<faces-config version=\"2.0\"/>"), 
         "faces-config.xml"); 
    } 

    @Test 
    public void simpleTest() { 

     // When 
     selenium.open(deploymentURL + "/view/be/searchBorrowingEntityView.jsf"); 
    } 
} 

폼은 조각 : link to pastie.org with listing

전체 스택 트레이스 :

java.lang.RuntimeException: Could not lookup value for field java.net.URL com.example.BEViewUIWithDrone.deploymentURL 
    at org.jboss.arquillian.test.impl.enricher.resource.ArquillianResourceTestEnricher.enrich(ArquillianResourceTestEnricher.java:61) 
    at org.jboss.arquillian.test.impl.TestInstanceEnricher.enrich(TestInstanceEnricher.java:52) 
    at org.jboss.arquillian.container.test.impl.ClientTestInstanceEnricher.enrich(ClientTestInstanceEnricher.java:51) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
    at java.lang.reflect.Method.invoke(Method.java:597) 
    at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90) 
    at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99) 
    at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81) 
    at org.jboss.arquillian.container.test.impl.client.ContainerEventController.createContext(ContainerEventController.java:142) 
    at org.jboss.arquillian.container.test.impl.client.ContainerEventController.createBeforeContext(ContainerEventController.java:124) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
    at java.lang.reflect.Method.invoke(Method.java:597) 
    at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90) 
    at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88) 
    at org.jboss.arquillian.test.impl.TestContextHandler.createTestContext(TestContextHandler.java:89) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
    at java.lang.reflect.Method.invoke(Method.java:597) 
    at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90) 
    at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88) 
    at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:75) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
    at java.lang.reflect.Method.invoke(Method.java:597) 
    at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90) 
    at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88) 
    at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:60) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
    at java.lang.reflect.Method.invoke(Method.java:597) 
    at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:90) 
    at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88) 
    at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:134) 
    at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:114) 
    at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.before(EventTestRunnerAdaptor.java:95) 
    at org.jboss.arquillian.testng.Arquillian.arquillianBeforeTest(Arquillian.java:130) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
    at java.lang.reflect.Method.invoke(Method.java:597) 
    at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:74) 
    at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:525) 
    at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:202) 
    at org.testng.internal.Invoker.invokeMethod(Invoker.java:613) 
    at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:846) 
    at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1170) 
    at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125) 
    at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109) 
    at org.testng.TestRunner.runWorkers(TestRunner.java:1147) 
    at org.testng.TestRunner.privateRun(TestRunner.java:749) 
    at org.testng.TestRunner.run(TestRunner.java:600) 
    at org.testng.SuiteRunner.runTest(SuiteRunner.java:317) 
    at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:312) 
    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:274) 
    at org.testng.SuiteRunner.run(SuiteRunner.java:223) 
    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) 
    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) 
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1039) 
    at org.testng.TestNG.runSuitesLocally(TestNG.java:964) 
    at org.testng.TestNG.run(TestNG.java:900) 
    at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:110) 
    at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:205) 
    at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:174) 
    at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:111) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
    at java.lang.reflect.Method.invoke(Method.java:597) 
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) 
Caused by: java.lang.RuntimeException: Provider for type class java.net.URL returned a null value: org.jboss.arqui[email protected]6e73a35c 
    at org.jboss.arquillian.test.impl.enricher.resource.ArquillianResourceTestEnricher.lookup(ArquillianResourceTestEnricher.java:115) 
    at org.jboss.arquillian.test.impl.enricher.resource.ArquillianResourceTestEnricher.enrich(ArquillianResourceTestEnricher.java:57) 
    ... 75 more 
Process finished with exit code 0 
,536,

답변

7

Weld-EE-Embedded 컨테이너는 CDI Bean 컨테이너 일 뿐이며 간단한 CDI 이상은 지원하지 않습니다.

JSF를 테스트하려면 JSF를 지원하는 컨테이너가 필요합니다. JBoss AS 7

+0

JBoss AS를 사용하는 경우에도 비슷한 오류가 발생합니다 ... – xybrek

+0

@xybrek 배포 방법 이었습니까? 다른 줄을 추가하는 동안 실수로 \ @ 배포 주석을 제거했습니다. 어떻게 묻지는 마십시오. JSF를 지원하는 컨테이너를 사용하는 사용자라면 나와 같은 plonker가 아니 었는지 확인할 수 있습니다! – Iridann