Package org.apache.aries.transaction.test

Examples of org.apache.aries.transaction.test.TestBean.insertRow()


     
      tran.begin();
      bean.insertRow("testWithClientTranAndWithRuntimeException", 1);
     
      try {
          bean.insertRow("testWithClientTranAndWithRuntimeException", 2, new RuntimeException("Dummy exception"));
      } catch (RuntimeException e) {
          e.printStackTrace();
      }
     
      try {
View Full Code Here


      finalRows = bean.countRows();
      assertTrue("Initial rows: " + initialRows + ", Final rows: " + finalRows, finalRows - initialRows == 0);
     
      //Test without client transaction - an exception is thrown because a transaction is mandatory
      try {
          bean.insertRow("testWithoutClientTran", 1);
          fail("IllegalStateException not thrown");
      } catch (IllegalStateException e) {
          e.printStackTrace();
      }
  }
View Full Code Here

      //Test with client transaction and with application exception - the user transaction is not
      //marked for rollback and can still be committed
      initialRows = nsBean.countRows();
     
      tran.begin();
      rBean.insertRow("testWithClientTranAndWithAppException", 1);
     
      try {
          nsBean.throwApplicationException();
      } catch (SQLException e) {
          e.printStackTrace();
View Full Code Here

      //Test with client transaction and with runtime exception - the user transaction is not
      //marked for rollback and can still be committed
      initialRows = nsBean.countRows();
     
      tran.begin();
      rBean.insertRow("testWithClientTranAndWithRuntimeException", 1);
     
      try {
          nsBean.throwRuntimeException();
      } catch (RuntimeException e) {
          e.printStackTrace();
View Full Code Here

     
      //Test with client transaction - the user transaction is used to insert a row
      int initialRows = bean.countRows();
     
      tran.begin();
      bean.insertRow("testWithClientTran", 1);
      tran.commit();
     
      int finalRows = bean.countRows();
      assertTrue("Initial rows: " + initialRows + ", Final rows: " + finalRows, finalRows - initialRows == 1);
     
View Full Code Here

     
      //Test with client transaction and application exception - the user transaction is not rolled back
      initialRows = bean.countRows();
     
      tran.begin();
      bean.insertRow("testWithClientTranAndWithAppException", 1);
     
      try {
          bean.insertRow("testWithClientTranAndWithAppException", 2, new SQLException());
      } catch (SQLException e) {
          e.printStackTrace();
View Full Code Here

     
      tran.begin();
      bean.insertRow("testWithClientTranAndWithAppException", 1);
     
      try {
          bean.insertRow("testWithClientTranAndWithAppException", 2, new SQLException());
      } catch (SQLException e) {
          e.printStackTrace();
      }
     
      tran.commit();
View Full Code Here

     
      //Test with client transaction - the user transaction is used to insert a row
      int initialRows = bean.countRows();
     
      tran.begin();
      bean.insertRow("testWithClientTran", 1);
      tran.commit();
     
      int finalRows = bean.countRows();
      assertTrue("Initial rows: " + initialRows + ", Final rows: " + finalRows, finalRows - initialRows == 1);
     
View Full Code Here

     
      //Test with client transaction and application exception - the user transaction is not rolled back
      initialRows = bean.countRows();
     
      tran.begin();
      bean.insertRow("testWithClientTranAndWithAppException", 1);
     
      try {
          bean.insertRow("testWithClientTranAndWithAppException", 2, new SQLException());
      } catch (SQLException e) {
          e.printStackTrace();
View Full Code Here

     
      tran.begin();
      bean.insertRow("testWithClientTranAndWithAppException", 1);
     
      try {
          bean.insertRow("testWithClientTranAndWithAppException", 2, new SQLException());
      } catch (SQLException e) {
          e.printStackTrace();
      }
     
      tran.commit();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.