Description
The following TCK test,
*.deployment.lifecycle.broken.addDefinitionError.AddDefinitionErrorTest.testObserverDefinitionErrorTreatedAsDefinitionError
fails because no exception is reported when app is deployed. There is an extension class, BeanDiscoveryObserver, which calls,
event.addDefinitionError(new AssertionError(...))
in a method that observes the AfterBeanDiscovery event. The spec says that if such an error is reported, the deployment should fail, so the tests appears to be correct.
I cannot find any code in Weld that would check the list of errors in an instance of AfterBeanDiscoveryImpl, though. This suggests that an error check is missing in Weld. The method WeldBootstrap.deployBeans() calls,
AfterBeanDiscoveryImp.fire(...)
which is a static method that creates a new instance of AfterBeanDiscoveryImpl. However, that instance is discarded after its fire() method is called.