1 25 package org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.ejbref; 26 27 import static org.objectweb.easybeans.tests.common.helper.ContextHelper.checkBeanRef; 28 29 import javax.annotation.Resource; 30 import javax.ejb.EJB ; 31 import javax.ejb.Remote ; 32 import javax.ejb.SessionContext ; 33 import javax.ejb.Stateless ; 34 35 import org.objectweb.easybeans.tests.common.ejbs.base.ItfEJBRef; 36 import org.objectweb.easybeans.tests.common.ejbs.base.ItfOneMethod01; 37 38 39 44 @Stateless (name = "SLSBEjbRefFieldInjection") 45 @Remote (ItfEJBRef.class) 46 public class SLSBEjbRefMethodInjection implements ItfEJBRef { 47 48 51 @Resource 52 private SessionContext ctx; 53 54 57 private ItfOneMethod01 bean00; 58 59 62 private ItfOneMethod01 bean01; 63 64 67 private ItfOneMethod01 bean02; 68 69 72 private ItfOneMethod01 bean03; 73 74 77 private ItfOneMethod01 bean04; 78 79 82 private ItfOneMethod01 bean05; 83 84 87 private ItfOneMethod01 bean06; 88 89 93 @EJB 94 public void setBean00(final ItfOneMethod01 b){ 95 bean00 = b; 96 } 97 98 102 @EJB (name = "ejb/bean01", description = "This bean is used to test name and description properties of the @EJB annotation.") 103 public void setBean01(final ItfOneMethod01 b){ 104 bean01 = b; 105 } 106 107 111 @EJB (beanInterface = ItfOneMethod01.class) 112 public void setBean02(final ItfOneMethod01 b){ 113 bean02 = b; 114 } 115 116 120 @EJB (beanName = "EJBInjectionBean") 121 public void setBean03(final ItfOneMethod01 b){ 122 bean03 = b; 123 } 124 125 129 @EJB (mappedName = "org.objectweb.easybeans.tests.common.ejbs.base.EJBInjectionBean_org.objectweb.easybeans.tests.common." 130 + "ejbs.base.ItfOneMethod01@Remote") 131 public void setBean04(final ItfOneMethod01 b){ 132 bean04 = b; 133 } 134 135 136 140 @EJB (name = "ejb/bean05", beanInterface = ItfOneMethod01.class, beanName = "EJBInjectionBean", description = "bean05") 141 public void setBean05(final ItfOneMethod01 b){ 142 bean05 = b; 143 } 144 145 149 @EJB (name = "ejb/bean06", beanInterface = ItfOneMethod01.class, beanName = "EJBInjectionBean", description = "bean06", 150 mappedName = "org.objectweb.easybeans.tests.common.ejbs.base.EJBInjectionBean_org.objectweb.easybeans.tests.common." 151 + "ejbs.base.ItfOneMethod01@Remote") 152 public void setBean06(final ItfOneMethod01 b){ 153 bean06 = b; 154 } 155 156 160 public void check00() { 161 assert bean00.getBool(); 162 checkBeanRef(ctx, 163 "org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged." 164 + "ejbref.SLSBEjbRefMethodInjection/bean00", ItfOneMethod01.class); 165 } 166 167 171 public void check01() { 172 assert bean01.getBool(); 173 checkBeanRef(ctx, "ejb/bean01", ItfOneMethod01.class); 174 } 175 176 180 public void check02() { 181 assert bean02.getBool(); 182 checkBeanRef(ctx, 183 "org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged." 184 + "ejbref.SLSBEjbRefMethodInjection/bean02", ItfOneMethod01.class); 185 } 186 187 191 public void check03() { 192 assert bean03.getBool(); 193 checkBeanRef(ctx, 194 "org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged." 195 + "ejbref.SLSBEjbRefMethodInjection/bean03", ItfOneMethod01.class); 196 } 197 198 202 public void check04() { 203 assert bean04.getBool(); 204 checkBeanRef(ctx, 205 "org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged." 206 + "ejbref.SLSBEjbRefMethodInjection/bean04", ItfOneMethod01.class); 207 } 208 209 213 public void check05() { 214 assert bean05.getBool(); 215 checkBeanRef(ctx, "ejb/bean05", ItfOneMethod01.class); 216 } 217 218 222 public void check06() { 223 assert bean06.getBool(); 224 checkBeanRef(ctx, "ejb/bean06", ItfOneMethod01.class); 225 } 226 } 227 | Popular Tags |