cdi: AddingPassivatingScopeTest expects DeploymentException, but Weld throws DefinitionException
While running the CDI TCK (4.0.8 or higher) using
mvn clean install -U -Dit.test=AddingPassivatingScopeTest
The following is logged using GlassFish 7.0.6-SNAPSHOT, which includes Weld 5.1.0.FINAL:
17:13:20.998156 SEVERE main quillian.container.glassfish.clientutils.GlassFishClientUtil.getResponseMap While Deploying Application: AddingPassivatingScopeTestb781b1478f39301846c5223fa0d65747ec1f08e --exit_code: FAILURE, message: Error occurred during deployment: Exception while loading the app : CDI definition failure:Exception List with 1 exceptions:
Exception 0 :
org.jboss.weld.exceptions.DefinitionException: WELD-000118: Only normal scopes can be passivating. Scope interface org.jboss.cdi.tck.tests.full.extensions.lifecycle.bbd.broken.passivatingScope.EpochScoped
at org.jboss.weld.bootstrap.events.BeforeBeanDiscoveryImpl.addScope(BeforeBeanDiscoveryImpl.java:92)
at org.jboss.cdi.tck.tests.full.extensions.lifecycle.bbd.broken.passivatingScope.BeforeBeanDiscoveryObserver.observe(BeforeBeanDiscoveryObserver.java:30)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:95)
There is an org.jboss.weld.exceptions.DefinitionException at the core here. Yet, the test is:
@ShouldThrowException(DeploymentException.class)
@Deployment
public static WebArchive createTestArchive() {
return new WebArchiveBuilder().withTestClassPackage(AddingPassivatingScopeTest.class)
.withBeansXml(new BeansXml(BeanDiscoveryMode.ALL))
.withExtension(BeforeBeanDiscoveryObserver.class).build();
}
Should this be @ShouldThrowException(DefinitionException.class)? Or is Weld wrong here? Or should we just transform a DefinitionException to a DeploymentException?
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 22 (9 by maintainers)
Yes, I’ll close it. Thank you so much for all your kind help and patience! 😃