Beispiel #1
0
 public void testSameTransactionEachCall()
     throws RemoteException, SystemException, NotSupportedException {
   final IIOPTransactionalStatefulRemote remote = statefulHome.create();
   userTransaction.begin();
   try {
     remote.sameTransaction(true);
     remote.sameTransaction(false);
   } finally {
     userTransaction.rollback();
   }
 }
Beispiel #2
0
 public void testSynchronization(final boolean succeeded)
     throws RemoteException, SystemException, NotSupportedException, RollbackException,
         HeuristicRollbackException, HeuristicMixedException {
   final IIOPTransactionalStatefulRemote remote = statefulHome.create();
   userTransaction.begin();
   try {
     remote.sameTransaction(true);
     remote.sameTransaction(false);
   } finally {
     if (succeeded) {
       userTransaction.commit();
     } else {
       userTransaction.rollback();
     }
   }
   Assert.assertEquals(succeeded, remote.isBeforeCompletion());
   Assert.assertEquals((Boolean) succeeded, remote.getCommitSucceeded());
 }