1 25 package org.objectweb.easybeans.tests.sessionbean.stateless.context; 26 27 import static org.objectweb.easybeans.tests.common.helper.EJBHelper.getBeanRemoteInstance; 28 import static org.objectweb.easybeans.tests.common.helper.ExceptionHelper.checkCause; 29 import static org.testng.Assert.fail; 30 31 import javax.ejb.EJBException ; 32 33 import org.objectweb.easybeans.tests.common.ejbs.base.sessioncontext.ItfSessionContextBMT; 34 import org.objectweb.easybeans.tests.common.ejbs.base.sessioncontext.ItfSessionContextCMT; 35 import org.objectweb.easybeans.tests.common.ejbs.base.sessioncontext.ItfSessionContextEJB3; 36 import org.objectweb.easybeans.tests.common.ejbs.base.sessioncontext.ItfSessionContextTimer; 37 import org.objectweb.easybeans.tests.common.ejbs.base.sessioncontext.ItfSessionContextWS; 38 import org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.sessioncontext.SLSBSessionCtxMethods; 39 import org.testng.annotations.BeforeMethod; 40 import org.testng.annotations.Test; 41 42 53 public class TestSLSessionContextMethods00 implements ItfSessionContextBMT, ItfSessionContextCMT, 54 ItfSessionContextEJB3, ItfSessionContextTimer, ItfSessionContextWS { 55 56 59 private ItfSessionContextBMT beanBMT; 60 61 64 private ItfSessionContextCMT beanCMT; 65 66 69 private ItfSessionContextEJB3 beanEJB3; 70 71 72 75 private ItfSessionContextTimer beanTimer; 76 77 80 private ItfSessionContextWS beanWS; 81 82 86 @BeforeMethod 87 public void startUp() throws Exception { 88 beanBMT = getBeanRemoteInstance(SLSBSessionCtxMethods.class, ItfSessionContextBMT.class); 89 beanCMT = getBeanRemoteInstance(SLSBSessionCtxMethods.class, ItfSessionContextCMT.class); 90 beanEJB3 = getBeanRemoteInstance(SLSBSessionCtxMethods.class, ItfSessionContextEJB3.class); 91 beanTimer = getBeanRemoteInstance(SLSBSessionCtxMethods.class, ItfSessionContextTimer.class); 92 } 94 95 100 @Test 101 public void verifyGetUserTransaction() { 102 try { 103 beanBMT.verifyGetUserTransaction(); 104 fail("The bean must throw an exception."); 105 } catch (EJBException e) { 106 checkCause(e, IllegalStateException .class); 107 } 108 } 109 110 115 @Test 116 public void verifyGetBusinessObject() { 117 beanEJB3.verifyGetBusinessObject(); 118 } 119 120 125 @Test 126 public void verifyGetInvokedBusinessInterface() { 127 beanEJB3.verifyGetInvokedBusinessInterface(); 128 } 129 130 135 @Test 136 public void verifyGetTimerService() { 137 beanTimer.verifyGetTimerService(); 138 } 139 140 145 @Test 146 public void verifySetRollbackOnly() { 147 beanCMT.verifySetRollbackOnly(); 148 } 149 150 155 @Test 156 public void verifyGetRollbackOnly() { 157 beanCMT.verifyGetRollbackOnly(); 158 } 159 160 161 166 public void verifyGetMessageContext() { 168 } 170 171 } 172 | Popular Tags |