-
1. Re: Integration testing and JNDI resource injection
mkouba Feb 7, 2017 3:02 AM (in response to maximelaval)Hi Maxime,
you would have to implement and register Weld resource injection SPI, ie. either
org.jboss.weld.injection.spi.InjectionServices
ororg.jboss.weld.injection.spi.ResourceInjectionServices
. See also EE resource injection and resolution services and Registering services. If using Weld SE you could also subclassorg.jboss.weld.environment.se.Weld
, overrideWeld.createDeployment(ResourceLoader, CDI11Bootstrap)
and register SPI service programatically -deployment.getServices().add()
. -
2. Re: Integration testing and JNDI resource injection
maximelaval Feb 8, 2017 11:11 AM (in response to mkouba)Hi Martin,
What is the difference between a Service and a WeldBeanDeploymentArchive?
Also how to map the JNDI name to the bean, in my case "java:comp/env/ds"?
Thanks.
-
3. Re: Integration testing and JNDI resource injection
mkouba Feb 9, 2017 2:37 AM (in response to maximelaval)BeanDeploymentArchive
represents a CDI bean archive whereas Weld SPIService
implementation makes it possible to integrate Weld in various environments. In your case, I would probably start with implementingorg.jboss.weld.injection.spi.InjectionServices.aroundInject()
, ie. find all resource injection points, do a JNDI lookup manually and set the field.