Package org.springframework.transaction.support

Examples of org.springframework.transaction.support.TransactionSynchronization.beforeCompletion()


      List synchs = TransactionSynchronizationManager.getSynchronizations();
      assertEquals(1, synchs.size());
      TransactionSynchronization synch = (TransactionSynchronization) synchs.get(0);
      synch.beforeCommit(false);
      synch.beforeCompletion();
      synch.afterCommit();
      synch.afterCompletion(TransactionSynchronization.STATUS_UNKNOWN);
    }
    finally {
      TransactionSynchronizationManager.clearSynchronization();
View Full Code Here


    MockControl synchControl = MockControl.createControl(TransactionSynchronization.class);
    final TransactionSynchronization synch = (TransactionSynchronization) synchControl.getMock();
    synch.beforeCommit(false);
    synchControl.setVoidCallable(1);
    synch.beforeCompletion();
    synchControl.setVoidCallable(1);
    synch.afterCommit();
    synchControl.setVoidCallable(1);
    synch.afterCompletion(TransactionSynchronization.STATUS_COMMITTED);
    synchControl.setVoidCallable(1);
View Full Code Here

    MockControl synchControl = MockControl.createControl(TransactionSynchronization.class);
    final TransactionSynchronization synch = (TransactionSynchronization) synchControl.getMock();
    synch.beforeCommit(false);
    synchControl.setVoidCallable(1);
    synch.beforeCompletion();
    synchControl.setVoidCallable(1);
    synch.afterCommit();
    synchControl.setVoidCallable(1);
    synch.afterCompletion(TransactionSynchronization.STATUS_COMMITTED);
    synchControl.setVoidCallable(1);
View Full Code Here

    utControl.setVoidCallable(1);
    utControl.replay();

    MockControl synchControl = MockControl.createControl(TransactionSynchronization.class);
    final TransactionSynchronization synch = (TransactionSynchronization) synchControl.getMock();
    synch.beforeCompletion();
    synchControl.setVoidCallable(1);
    synch.afterCompletion(TransactionSynchronization.STATUS_ROLLED_BACK);
    synchControl.setVoidCallable(1);
    synchControl.replay();
View Full Code Here

    utControl.setVoidCallable(1);
    utControl.replay();

    MockControl synchControl = MockControl.createControl(TransactionSynchronization.class);
    final TransactionSynchronization synch = (TransactionSynchronization) synchControl.getMock();
    synch.beforeCompletion();
    synchControl.setVoidCallable(1);
    synch.afterCompletion(TransactionSynchronization.STATUS_ROLLED_BACK);
    synchControl.setVoidCallable(1);
    synchControl.replay();
View Full Code Here

    utControl.setVoidCallable(1);
    utControl.replay();

    MockControl synchControl = MockControl.createControl(TransactionSynchronization.class);
    final TransactionSynchronization synch = (TransactionSynchronization) synchControl.getMock();
    synch.beforeCompletion();
    synchControl.setVoidCallable(1);
    synch.afterCompletion(TransactionSynchronization.STATUS_UNKNOWN);
    synchControl.setVoidCallable(1);
    synchControl.replay();
View Full Code Here

    utControl.setVoidCallable(1);
    utControl.replay();

    MockControl synchControl = MockControl.createControl(TransactionSynchronization.class);
    final TransactionSynchronization synch = (TransactionSynchronization) synchControl.getMock();
    synch.beforeCompletion();
    synchControl.setVoidCallable(1);
    synch.afterCompletion(TransactionSynchronization.STATUS_UNKNOWN);
    synchControl.setVoidCallable(1);
    synchControl.replay();
View Full Code Here

    MockControl synchControl = MockControl.createControl(TransactionSynchronization.class);
    final TransactionSynchronization synch = (TransactionSynchronization) synchControl.getMock();
    synch.beforeCommit(false);
    synchControl.setThrowable(new OptimisticLockingFailureException(""));
    synch.beforeCompletion();
    synchControl.setVoidCallable(1);
    synch.afterCompletion(TransactionSynchronization.STATUS_UNKNOWN);
    synchControl.setVoidCallable(1);
    synchControl.replay();
View Full Code Here

    utControl.setVoidCallable(1);
    utControl.replay();

    MockControl synchControl = MockControl.createControl(TransactionSynchronization.class);
    final TransactionSynchronization synch = (TransactionSynchronization) synchControl.getMock();
    synch.beforeCompletion();
    synchControl.setVoidCallable(1);
    synch.afterCompletion(TransactionSynchronization.STATUS_UNKNOWN);
    synchControl.setVoidCallable(1);
    synchControl.replay();
View Full Code Here

    utControl.setReturnValue(Status.STATUS_ACTIVE, 2);
    utControl.replay();

    MockControl synchControl = MockControl.createControl(TransactionSynchronization.class);
    final TransactionSynchronization synch = (TransactionSynchronization) synchControl.getMock();
    synch.beforeCompletion();
    synchControl.setVoidCallable(1);
    synch.afterCompletion(TransactionSynchronization.STATUS_UNKNOWN);
    synchControl.setVoidCallable(1);
    synchControl.replay();
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.