1 22 package org.jboss.test.cmp2.commerce; 23 24 import java.util.Collection ; 25 import java.util.HashSet ; 26 import java.util.Set ; 27 import java.util.Iterator ; 28 import javax.naming.InitialContext ; 29 import javax.ejb.EJBLocalObject ; 30 31 import junit.framework.Test; 32 import junit.framework.TestCase; 33 import junit.framework.TestSuite; 34 import org.apache.log4j.Category; 35 import net.sourceforge.junitejb.EJBTestCase; 36 37 public class TxTesterTest extends EJBTestCase { 38 public static Test suite() { 39 TestSuite testSuite = new TestSuite("TxTesterTest"); 40 testSuite.addTestSuite(TxTesterTest.class); 41 return testSuite; 42 } 43 44 public TxTesterTest(String name) { 45 super(name); 46 } 47 48 private Category log = Category.getInstance(getClass()); 49 private TxTesterHome txTesterHome; 50 51 58 public void setUp() throws Exception { 59 InitialContext jndi = new InitialContext (); 60 61 txTesterHome = 62 (TxTesterHome) jndi.lookup("commerce/TxTester"); 63 } 64 65 public void testTxTester_none() throws Exception { 66 TxTester txTester = null; 67 try { 68 txTester = txTesterHome.create(); 69 boolean result = txTester.accessCMRCollectionWithoutTx(); 70 71 if (!result) 72 fail("Expected accessCMRCollectionWithoutTx to throw an exception"); 73 } finally { 74 if(txTester != null) { 75 txTester.remove(); 76 } 77 } 78 } 79 } 80 | Popular Tags |