1 25 package org.objectweb.easybeans.tests.sessionbean.stateful.sbinterface; 26 27 import static org.objectweb.easybeans.tests.common.ejbs.entity.callbacklogger.CallbackType.PRE_DESTROY; 28 import static org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.callbacklogger.ItfCallbackLoggerAccess.SLEEP; 29 import static org.objectweb.easybeans.tests.common.helper.EJBHelper.getBeanRemoteInstance; 30 31 import java.util.ArrayList ; 32 import java.util.List ; 33 34 import org.objectweb.easybeans.tests.common.ejbs.base.ItfCheck02; 35 import org.objectweb.easybeans.tests.common.ejbs.stateful.containermanaged.sbinterface.SFSBSessionBeanItf; 36 import org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.callbacklogger.ItfCallbackLoggerAccess; 37 import org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.callbacklogger.SLSBCallbackLoggerAccess; 38 import org.testng.annotations.BeforeMethod; 39 import org.testng.annotations.Test; 40 41 46 public class TestSFSessionBeanInterface { 47 48 51 private ItfCheck02 bean; 52 53 56 private ItfCallbackLoggerAccess beanLogger; 57 58 62 @BeforeMethod 63 public void startUp() throws Exception { 64 bean = getBeanRemoteInstance(SFSBSessionBeanItf.class, ItfCheck02.class); 65 beanLogger = getBeanRemoteInstance(SLSBCallbackLoggerAccess.class, ItfCallbackLoggerAccess.class); 66 beanLogger.deleteAll(); 67 } 68 69 75 @Test 76 public void verifySessionContext() throws Exception { 77 bean.check(); 78 } 79 80 86 public void verifyEjbActivate() throws Exception { 88 } 90 91 97 public void verifyEjbPassivate() throws Exception { 99 } 101 102 108 @Test 109 public void verifyEjbRemove() throws Exception { 110 bean.remove(); 111 112 Thread.sleep(SLEEP); 114 115 List <String > arLife = new ArrayList <String >(); 117 118 arLife.add(SFSBSessionBeanItf.class.getName()); 119 120 beanLogger.verifyCallbackOrder(SFSBSessionBeanItf.class, PRE_DESTROY, arLife.toArray(new String [0])); 121 } 122 } 123 | Popular Tags |