1 25 package org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.basic; 26 27 import static org.testng.Assert.assertEquals; 28 29 import javax.ejb.EJB ; 30 import javax.ejb.Remote ; 31 import javax.ejb.Stateless ; 32 33 import org.objectweb.easybeans.tests.common.ejbs.base.ItfSimplePrintMessage; 34 import org.objectweb.easybeans.tests.common.ejbs.stateful.containermanaged.basic.SFSBDeployTest; 35 import org.objectweb.easybeans.tests.common.helper.EJBHelper; 36 37 43 @Stateless 44 @Remote 45 public class SLSBSessionBeanTester implements ItfSessionBeanTester { 46 47 50 @EJB (beanName = "SLSBDeployTest") 51 private ItfSimplePrintMessage slsbBean1; 52 53 56 @EJB (beanName = "SFSBDeployTest") 57 private ItfSimplePrintMessage sfsbBean1; 58 59 63 public void testSLSBByInjection() { 64 assertEquals(slsbBean1.getDefaultMessage(), ItfSimplePrintMessage.DEFAULT_MESSAGE, 65 "The bean with the remote interface did not returned the default message."); 66 } 67 68 73 public void testSLSBByLookup() throws Exception { 74 ItfSimplePrintMessage slsbBean2 = EJBHelper.getBeanRemoteInstance(SLSBDeployTest.class, 75 ItfSimplePrintMessage.class); 76 assertEquals(slsbBean2.getDefaultMessage(), ItfSimplePrintMessage.DEFAULT_MESSAGE, 77 "The bean with the remote interface did not returned the default message."); 78 } 79 80 84 public void testSFSBByInjection() { 85 assertEquals(sfsbBean1.getDefaultMessage(), ItfSimplePrintMessage.DEFAULT_MESSAGE, 86 "The bean with the remote interface did not returned the default message."); 87 } 88 89 94 public void testSFSBByLookup() throws Exception { 95 ItfSimplePrintMessage sfsbBean2 = EJBHelper.getBeanRemoteInstance(SFSBDeployTest.class, 96 ItfSimplePrintMessage.class); 97 assertEquals(sfsbBean2.getDefaultMessage(), ItfSimplePrintMessage.DEFAULT_MESSAGE, 98 "The bean with the remote interface did not returned the default message."); 99 } 100 101 } 102 | Popular Tags |