1 25 package org.objectweb.easybeans.tests.transaction.containermanaged.base; 26 27 import static org.testng.Assert.fail; 28 29 import java.sql.SQLException ; 30 31 import org.objectweb.easybeans.log.JLog; 32 import org.objectweb.easybeans.log.JLogFactory; 33 import org.objectweb.easybeans.tests.common.ejbs.base.transaction.ItfContainerTransaction; 34 import org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.transaction.ItfTransactionMisc00; 35 36 56 public abstract class TestRequiredException extends TestContainerTransactionException { 57 58 61 private static JLog logger = JLogFactory.getLog(TestRequiredException.class); 62 63 64 65 73 @Override 74 public void testCallOtherBeanNotSup() throws Exception { 75 super.testCallOtherBeanNotSup(); 76 verifyOtherBeanNotSupport(); 77 } 78 79 87 @Override 88 public void testCallOtherBeanReq() throws Exception { 89 super.testCallOtherBeanReq(); 90 verifyOtherBeanReq(); 91 } 92 93 99 private void verifyOtherBeanNotSupport() throws Exception { 100 try { 102 ExceptionHandleUtil.verifyTable(DATABASE_1, ItfContainerTransaction.TABLE); 103 fail("The container did not make a rollback in the transaction."); 104 } catch (SQLException e) { 105 logger.debug("The test threw an expected exception {0}", e); 106 } 107 try { 111 ExceptionHandleUtil.verifyTable(DATABASE_2, ItfTransactionMisc00.TABLE); 112 } catch (SQLException e) { 113 fail("The container made a rollback in the transaction."); 114 } 115 } 116 117 123 private void verifyOtherBeanReq() throws Exception { 124 try { 126 ExceptionHandleUtil.verifyTable(DATABASE_1, ItfContainerTransaction.TABLE); 127 fail("The container did not make a rollback in the transaction."); 128 } catch (SQLException e) { 129 logger.debug("The test threw an expected exception {0}", e); 130 } 131 try { 135 ExceptionHandleUtil.verifyTable(DATABASE_2, ItfTransactionMisc00.TABLE); 136 fail("The container did not make a rollback in the transaction."); 137 } catch (SQLException e) { 138 logger.debug("The test threw an expected exception {0}", e); 139 } 140 } 141 142 143 } 144 | Popular Tags |