java-ee-7 - Arquillian 配置 DeploymentException 和 WindowBeanHolder

标签 java-ee-7 jboss-arquillian

我正在构建一个测试套件,以便在 arquillian 上执行它们。我已经关注了这个Arquillian's starting guide 我正在使用这个 gradle 来测试我的测试:

providedCompile 'org.jboss.spec:jboss-javaee-7.0:1.0.3.Final'

testCompile 'junit:junit:4.12'
testCompile 'org.hamcrest:hamcrest-junit:2.0.0.0'
testCompile 'org.jglue.cdi-unit:cdi-unit:3.1.3'
testCompile 'org.mockito:mockito-core:2.0.31-beta'
testCompile 'eu.codearte.catch-exception:catch-exception:2.0.0-ALPHA-1'
testCompile 'com.jayway.restassured:rest-assured:2.6.0'
testCompile 'com.carrotsearch:junit-benchmarks:0.7.2'

testCompile 'org.jboss.arquillian.junit:arquillian-junit-container:1.1.9.Final'
testCompile 'org.jboss.arquillian:arquillian-bom:1.1.9.Final'
testCompile 'org.jboss.arquillian.container:arquillian-weld-ee-embedded-1.1:1.0.0.CR9'
testCompile 'org.jboss.weld:weld-core:2.3.0.Final'
testCompile 'org.jboss.shrinkwrap:shrinkwrap-depchain:1.2.2'
testCompile 'org.apache.deltaspike.core:deltaspike-core-api:1.5.0'
testCompile 'org.apache.deltaspike.core:deltaspike-core-impl:1.5.0'
testCompile 'org.slf4j:slf4j-simple:1.7.12'

当我从 Eclipse 执行测试时:

它给我抛出了一个异常:

<configuration>
    <appSettings>
        <add key="environment" value="developmentorg.jboss.weld.exceptions.DeploymentException: Exception List with 1 exceptions:
        Exception 0 :
        java.lang.IllegalStateException: Could not find beans for Type=class org.apache.deltaspike.core.impl.scope.window.WindowBeanHolder and qualifiers:[]
            at org.apache.deltaspike.core.api.provider.BeanProvider.getContextualReference(BeanProvider.java:150)
            at org.apache.deltaspike.core.impl.scope.DeltaSpikeContextExtension.initializeDeltaSpikeContexts(DeltaSpikeContextExtension.java:85)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

最佳答案

添加

.addPackages(true, "org.apache.deltaspike")

至 ShrinkWrap 代码。

关于java-ee-7 - Arquillian 配置 DeploymentException 和 WindowBeanHolder,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33169361/

相关文章:

java - 在线程中进行 DAO 注入(inject)

java - 如何将公历字符串转换为公历?

java - WEB-INF 在 Java EE Web 应用程序中的用途是什么?

java - Arquillian - 模块中已定义组件

jersey - 无法在我的资源类中注入(inject) @Service 和 @Contract 依赖项

jboss - Java EE 7 兼容服务器?

java - 在 Arquillian 测试类中注入(inject)始终为 null

jboss7.x - 使用 arquillian 调试远程容器失败

junit - 阿奎利安 : Wildfly embedded?