1 25 package org.objectweb.easybeans.tests.interceptors.business.stateless.containermanaged; 26 27 import static org.objectweb.easybeans.tests.common.helper.ExceptionHelper.checkCause; 28 import static org.objectweb.easybeans.tests.common.helper.EJBHelper.getBeanRemoteInstance; 29 30 import javax.ejb.EJBException ; 31 32 import org.objectweb.easybeans.tests.common.ejbs.base.ItfAccessEJB; 33 import org.objectweb.easybeans.tests.common.ejbs.base.ItfAccessEMFactory; 34 import org.objectweb.easybeans.tests.common.ejbs.base.ItfAccessEntityManager; 35 import org.objectweb.easybeans.tests.common.ejbs.base.ItfAccessJNDI; 36 import org.objectweb.easybeans.tests.common.ejbs.base.ItfAccessResourceManager; 37 import org.objectweb.easybeans.tests.common.ejbs.base.ItfAccessSessionContext; 38 import org.objectweb.easybeans.tests.common.ejbs.base.ItfAccessUserTransaction; 39 import org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.interceptoraccess.SLSBAccessInterceptorTest00; 40 import org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.interceptoraccess.SLSBAccessSessionCtxInterceptor00; 41 import org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.interceptoraccess.SLSBAccessSessionCtxInterceptor01; 42 import org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.interceptoraccess.SLSBAccessUserTxInterceptor00; 43 import org.objectweb.easybeans.tests.common.exception.CustomException00; 44 import org.objectweb.easybeans.tests.interceptors.business.base.access.BaseAccessOperationsInterceptor00; 45 import org.testng.annotations.BeforeClass; 46 import org.testng.annotations.Test; 47 48 59 public class TestSLAccessInterceptor00 extends BaseAccessOperationsInterceptor00 { 60 61 65 @BeforeClass 66 public void startUp() throws Exception { 67 ItfAccessJNDI bean00 = getBeanRemoteInstance(SLSBAccessInterceptorTest00.class, ItfAccessJNDI.class); 68 ItfAccessEJB bean01 = getBeanRemoteInstance(SLSBAccessInterceptorTest00.class, ItfAccessEJB.class); 69 ItfAccessResourceManager bean02 = getBeanRemoteInstance(SLSBAccessInterceptorTest00.class, 70 ItfAccessResourceManager.class); 71 ItfAccessEntityManager bean03 = getBeanRemoteInstance(SLSBAccessInterceptorTest00.class, 72 ItfAccessEntityManager.class); 73 ItfAccessEMFactory bean04 = getBeanRemoteInstance(SLSBAccessInterceptorTest00.class, ItfAccessEMFactory.class); 74 ItfAccessSessionContext bean05 = getBeanRemoteInstance(SLSBAccessInterceptorTest00.class, 75 ItfAccessSessionContext.class); 76 77 ItfAccessSessionContext bean07 = getBeanRemoteInstance(SLSBAccessSessionCtxInterceptor00.class, 78 ItfAccessSessionContext.class); 79 ItfAccessSessionContext bean08 = getBeanRemoteInstance(SLSBAccessSessionCtxInterceptor01.class, 80 ItfAccessSessionContext.class); 81 super.setBeans(bean00, bean01, bean02, bean03, bean04, bean05, null, bean07, bean08); 82 } 83 84 91 @Override 92 @Test(groups = {"java:comp/env access"}) 93 public void testJNDI00() throws Exception { 94 super.testJNDI00(); 95 } 96 97 104 @Override 105 @Test(groups = {"EJB access"}) 106 public void testEJB00() throws Exception { 107 super.testEJB00(); 108 } 109 110 117 @Override 118 @Test(groups = {"Resource access"}) 119 public void testResource00() throws Exception { 120 super.testResource00(); 121 } 122 123 130 @Override 131 @Test(groups = {"Entity Manager access"}) 132 public void testEntityManager00() throws Exception { 133 super.testEntityManager00(); 134 } 135 136 143 @Override 144 @Test(groups = {"Entity Factory access"}) 145 public void testEntityFactory00() throws Exception { 146 super.testEntityFactory00(); 147 } 148 149 156 @Override 157 @Test(groups = {"SessionContext access"}) 158 public void testSessionContext00() throws Exception { 159 super.testSessionContext00(); 160 } 161 162 170 @Override 171 @Test(groups = {"SessionContext access"}) 172 public void testSessionContext01() throws Exception { 173 super.testSessionContext01(); 174 } 175 176 186 @Override 187 @Test(groups = {"SessionContext access"}) 188 public void testSessionContext02() throws Exception { 189 try { 190 super.testSessionContext02(); 191 } catch (EJBException e) { 192 checkCause(e, IllegalStateException .class); 193 } 194 } 195 196 204 @Override 205 @Test(groups = {"UserTransaction access"}, expectedExceptions = CustomException00.class) 206 @SuppressWarnings ("unused") 207 public void testUserTransaction00() throws Exception { 208 ItfAccessUserTransaction bean = getBeanRemoteInstance(SLSBAccessUserTxInterceptor00.class, 209 ItfAccessUserTransaction.class); 210 bean.accessUserTransaction(null); 211 } 212 213 } 214 | Popular Tags |