1 25 package org.objectweb.easybeans.tests.transaction.containermanaged.stateless; 26 27 import javax.transaction.UserTransaction ; 28 29 import org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.inheritance.ItfCMTInheritance; 30 import org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.inheritance.SLSBCMTInheritance; 31 import org.objectweb.easybeans.tests.common.helper.EJBHelper; 32 import org.objectweb.easybeans.tests.common.helper.TransactionHelper; 33 import org.testng.annotations.BeforeMethod; 34 import org.testng.annotations.Test; 35 36 47 public class TestInheritance { 48 49 52 private ItfCMTInheritance slsbCMTInheritance; 53 54 58 @BeforeMethod 59 public void setup() throws Exception { 60 slsbCMTInheritance = EJBHelper.getBeanRemoteInstance(SLSBCMTInheritance.class, ItfCMTInheritance.class); 61 } 62 63 72 @Test(expectedExceptions = javax.ejb.EJBException .class) 73 public void testClassDefinition() throws Exception { 74 UserTransaction utx = TransactionHelper.getInternalUserTransaction(); 75 try { 76 utx.begin(); 77 slsbCMTInheritance.dummyMethod1(); 78 } finally { 79 utx.rollback(); 80 } 81 } 82 83 92 @Test(expectedExceptions = javax.ejb.EJBException .class) 93 public void testMethodDefinition() throws Exception { 94 slsbCMTInheritance.dummyMethod2(); 95 96 } 97 98 107 @Test(expectedExceptions = javax.ejb.EJBException .class) 108 public void testOverrideSuperclassDefinition1() throws Exception { 109 slsbCMTInheritance.dummyMethod3(); 110 111 } 112 113 121 @Test 122 public void testOverrideSuperclassDefinition2() throws Exception { 123 UserTransaction utx = TransactionHelper.getInternalUserTransaction(); 124 try { 125 utx.begin(); 126 slsbCMTInheritance.dummyMethod4(); 127 } finally { 128 utx.rollback(); 129 } 130 } 131 } 132 | Popular Tags |