1 25 package org.objectweb.easybeans.tests.common.ejbs.ws.ejbref; 26 27 import static org.objectweb.easybeans.tests.common.helper.ContextHelper.checkBeanRef; 28 import static org.testng.Assert.assertTrue; 29 30 import javax.annotation.Resource; 31 import javax.ejb.EJB ; 32 import javax.ejb.EJBs ; 33 import javax.ejb.Remote ; 34 import javax.ejb.SessionContext ; 35 import javax.ejb.Stateless ; 36 import javax.jws.WebService; 37 38 import org.objectweb.easybeans.tests.common.ejbs.base.ItfOneMethod01; 39 import org.objectweb.easybeans.tests.common.ws.ejbref.gen.ItfChecker; 40 import org.objectweb.easybeans.tests.common.ws.ejbref.gen.WSException; 41 42 47 @Stateless (name = "SLSBEjbRefInjection") 48 @WebService(name="Checker", 50 serviceName="EjbRefService", 51 targetNamespace="http://objectweb.org/easybeans/tests/common/ws/ejbref/gen", 52 wsdlLocation="META-INF/wsdl/ejbref.wsdl") 53 @Remote 54 @EJBs ({ 55 @EJB (name = "ejb/beanDeclaration", beanName="EJBInjectionBean", beanInterface=ItfOneMethod01.class)}) 56 public class SLSBEjbRefInjection implements ItfChecker{ 57 58 61 @Resource 62 private SessionContext ctx; 63 64 67 private ItfOneMethod01 beanMethodInjection; 68 69 72 @EJB (name="ejb/beanField", beanName="EJBInjectionBean") 73 private ItfOneMethod01 beanFieldInjection; 74 75 79 @EJB (name="ejb/beanMethod", beanName = "EJBInjectionBean") 80 public void setBean(final ItfOneMethod01 b){ 81 beanMethodInjection = b; 82 } 83 84 88 public void check() throws WSException { 89 90 checkBeanRef(ctx, "ejb/beanField", ItfOneMethod01.class); 92 assertTrue(beanFieldInjection.getBool(), "The value must be true."); 93 94 checkBeanRef(ctx, "ejb/beanMethod", ItfOneMethod01.class); 96 assertTrue(beanMethodInjection.getBool(), "The value must be true."); 97 98 checkBeanRef(ctx, "ejb/beanDeclaration", ItfOneMethod01.class); 100 } 101 } 102 | Popular Tags |