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.SFSBAccessInterceptorTest01; 38 import org.objectweb.easybeans.tests.common.ejbs.stateful.containermanaged.interceptoraccess.SFSBAccessSessionCtxInterceptor02; 39 import org.objectweb.easybeans.tests.common.ejbs.stateful.containermanaged.interceptoraccess.SFSBAccessUserTxInterceptor01; 40 import org.objectweb.easybeans.tests.common.exception.CustomException00; 41 import org.objectweb.easybeans.tests.interceptors.business.base.access.BaseAccessOperationsInterceptor00; 42 import org.testng.annotations.BeforeClass; 43 import org.testng.annotations.Test; 44 45 58 public class TestSFAccessInterceptor01 extends BaseAccessOperationsInterceptor00 { 59 60 64 @BeforeClass 65 public void startUp() throws Exception { 66 ItfAccessJNDI bean00 = getBeanRemoteInstance(SFSBAccessInterceptorTest01.class, ItfAccessJNDI.class); 67 ItfAccessEJB bean01 = getBeanRemoteInstance(SFSBAccessInterceptorTest01.class, ItfAccessEJB.class); 68 ItfAccessResourceManager bean02 = getBeanRemoteInstance(SFSBAccessInterceptorTest01.class, 69 ItfAccessResourceManager.class); 70 ItfAccessEntityManager bean03 = getBeanRemoteInstance(SFSBAccessInterceptorTest01.class, 71 ItfAccessEntityManager.class); 72 ItfAccessEMFactory bean04 = getBeanRemoteInstance(SFSBAccessInterceptorTest01.class, ItfAccessEMFactory.class); 73 ItfAccessSessionContext bean05 = getBeanRemoteInstance(SFSBAccessInterceptorTest01.class, 74 ItfAccessSessionContext.class); 75 76 ItfAccessSessionContext bean07 = getBeanRemoteInstance(SFSBAccessSessionCtxInterceptor02.class, 77 ItfAccessSessionContext.class); 78 super.setBeans(bean00, bean01, bean02, bean03, bean04, bean05, null, bean07, null); 79 } 80 81 89 @Override 90 @Test(groups = {"java:comp/env access"}) 91 public void testJNDI00() throws Exception { 92 super.testJNDI00(); 93 } 94 95 103 @Override 104 @Test(groups = {"EJB access"}) 105 public void testEJB00() throws Exception { 106 super.testEJB00(); 107 } 108 109 117 @Override 118 @Test(groups = {"Resource access"}) 119 public void testResource00() throws Exception { 120 super.testResource00(); 121 } 122 123 131 @Override 132 @Test(groups = {"Entity Manager access"}) 133 public void testEntityManager00() throws Exception { 134 super.testEntityManager00(); 135 } 136 137 145 @Override 146 @Test(groups = {"Entity Factory access"}) 147 public void testEntityFactory00() throws Exception { 148 super.testEntityFactory00(); 149 } 150 151 159 @Override 160 @Test(groups = {"SessionContext access"}) 161 public void testSessionContext00() throws Exception { 162 super.testSessionContext00(); 163 } 164 165 173 @Override 174 @Test(groups = {"SessionContext access"}) 175 public void testSessionContext01() throws Exception { 176 try{ 177 super.testSessionContext01(); 178 }catch (Exception e){ 179 checkCause(e, IllegalStateException .class); 180 } 181 } 182 183 191 @Override 192 @Test(groups = {"UserTransaction access"}, expectedExceptions = CustomException00.class) 193 @SuppressWarnings ("unused") 194 public void testUserTransaction00() throws Exception { 195 ItfAccessUserTransaction bean = getBeanRemoteInstance(SFSBAccessUserTxInterceptor01.class, 196 ItfAccessUserTransaction.class); 197 bean.accessUserTransaction(null); 198 } 199 200 } 201 | Popular Tags |