1 25 package org.objectweb.easybeans.tests.interceptors.business.stateful.containermanaged; 26 27 import static org.objectweb.easybeans.tests.common.helper.EJBHelper.getBeanRemoteInstance; 28 import static org.objectweb.easybeans.tests.common.helper.ExceptionHelper.checkCause; 29 30 import org.objectweb.easybeans.tests.common.ejbs.base.ItfAccessEJB; 31 import org.objectweb.easybeans.tests.common.ejbs.base.ItfAccessEMFactory; 32 import org.objectweb.easybeans.tests.common.ejbs.base.ItfAccessEntityManager; 33 import org.objectweb.easybeans.tests.common.ejbs.base.ItfAccessJNDI; 34 import org.objectweb.easybeans.tests.common.ejbs.base.ItfAccessResourceManager; 35 import org.objectweb.easybeans.tests.common.ejbs.base.ItfAccessSessionContext; 36 import org.objectweb.easybeans.tests.common.ejbs.base.ItfAccessUserTransaction; 37 import org.objectweb.easybeans.tests.common.ejbs.stateful.containermanaged.interceptoraccess.SFSBAccessInterceptorTest00; 38 import org.objectweb.easybeans.tests.common.ejbs.stateful.containermanaged.interceptoraccess.SFSBAccessSessionCtxInterceptor00; 39 import org.objectweb.easybeans.tests.common.ejbs.stateful.containermanaged.interceptoraccess.SFSBAccessSessionCtxInterceptor01; 40 import org.objectweb.easybeans.tests.common.ejbs.stateful.containermanaged.interceptoraccess.SFSBAccessUserTxInterceptor00; 41 import org.objectweb.easybeans.tests.common.exception.CustomException00; 42 import org.objectweb.easybeans.tests.interceptors.business.base.access.BaseAccessOperationsInterceptor00; 43 import org.testng.annotations.BeforeClass; 44 import org.testng.annotations.Test; 45 46 58 public class TestSFAccessInterceptor00 extends BaseAccessOperationsInterceptor00 { 59 60 64 @BeforeClass 65 public void startUp() throws Exception { 66 ItfAccessJNDI bean00 = getBeanRemoteInstance(SFSBAccessInterceptorTest00.class, ItfAccessJNDI.class); 67 ItfAccessEJB bean01 = getBeanRemoteInstance(SFSBAccessInterceptorTest00.class, ItfAccessEJB.class); 68 ItfAccessResourceManager bean02 = getBeanRemoteInstance(SFSBAccessInterceptorTest00.class, 69 ItfAccessResourceManager.class); 70 ItfAccessEntityManager bean03 = getBeanRemoteInstance(SFSBAccessInterceptorTest00.class, 71 ItfAccessEntityManager.class); 72 ItfAccessEMFactory bean04 = getBeanRemoteInstance(SFSBAccessInterceptorTest00.class, ItfAccessEMFactory.class); 73 ItfAccessSessionContext bean05 = getBeanRemoteInstance(SFSBAccessInterceptorTest00.class, 74 ItfAccessSessionContext.class); 75 76 ItfAccessSessionContext bean07 = getBeanRemoteInstance(SFSBAccessSessionCtxInterceptor00.class, 77 ItfAccessSessionContext.class); 78 ItfAccessSessionContext bean08 = getBeanRemoteInstance(SFSBAccessSessionCtxInterceptor01.class, 79 ItfAccessSessionContext.class); 80 super.setBeans(bean00, bean01, bean02, bean03, bean04, bean05, null, bean07, bean08); 81 } 82 83 91 @Override 92 @Test(groups = {"java:comp/env access"}) 93 public void testJNDI00() throws Exception { 94 super.testJNDI00(); 95 } 96 97 105 @Override 106 @Test(groups = {"EJB access"}) 107 public void testEJB00() throws Exception { 108 super.testEJB00(); 109 } 110 111 119 @Override 120 @Test(groups = {"Resource access"}) 121 public void testResource00() throws Exception { 122 super.testResource00(); 123 } 124 125 133 @Override 134 @Test(groups = {"Entity Manager access"}) 135 public void testEntityManager00() throws Exception { 136 super.testEntityManager00(); 137 } 138 139 147 @Override 148 @Test(groups = {"Entity Factory access"}) 149 public void testEntityFactory00() throws Exception { 150 super.testEntityFactory00(); 151 } 152 153 161 @Override 162 @Test(groups = {"SessionContext access"}) 163 public void testSessionContext00() throws Exception { 164 super.testSessionContext00(); 165 } 166 167 174 @Override 175 @Test(groups = {"SessionContext access"}) 176 public void testSessionContext01() { 177 try { 178 super.testSessionContext01(); 179 } catch (Exception e) { 180 checkCause(e, IllegalStateException .class); 181 } 182 } 183 184 191 @Override 192 @Test(groups = {"SessionContext access"}) 193 public void testSessionContext02(){ 194 try { 195 super.testSessionContext02(); 196 } catch (Exception e) { 197 checkCause(e, IllegalStateException .class); 198 } 199 } 200 201 209 @Override 210 @Test(groups = {"UserTransaction access"}, expectedExceptions = CustomException00.class) 211 @SuppressWarnings ("unused") 212 public void testUserTransaction00() throws Exception { 213 ItfAccessUserTransaction bean = getBeanRemoteInstance(SFSBAccessUserTxInterceptor00.class, 214 ItfAccessUserTransaction.class); 215 bean.accessUserTransaction(null); 216 } 217 218 } 219 | Popular Tags |