gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-02 02:10:54 27 4
gpt4 key购买 nike

我正在构建一个测试套件,以便在 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/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com