Examples of TestTransaction


Examples of org.mule.tck.testmodels.mule.TestTransaction

        TransactionCoordination.getInstance().bindTransaction(mockTransaction);
        TransactionCoordination.getInstance().suspendCurrentTransaction();
        assertThat(TransactionCoordination.getInstance().getTransaction(), IsNull.<Object>nullValue());
        configureExceptionListener(null,null);
        ExecutionTemplate executionTemplate = createExceptionHandlingTransactionTemplate();
        final Transaction mockNewTransaction = spy(new TestTransaction(mockMuleContext));
        try
        {
            executionTemplate.execute(TransactionTemplateTestUtils.getFailureTransactionCallbackStartsTransaction(mockMessagingException, mockNewTransaction));
            fail("MessagingException must be thrown");
        }
View Full Code Here

Examples of org.mule.tck.testmodels.mule.TestTransaction

    @Test
    public void testCommitCurrentTransaction() throws Exception
    {
        assertThat(tc.getTransaction(), IsNull.<Object>nullValue());
        tc.commitCurrentTransaction();
        TestTransaction testTransaction = spy(new TestTransaction(muleContext));

        tc.bindTransaction(testTransaction);
        tc.commitCurrentTransaction();
        assertThat(tc.getTransaction(),IsNull.<Object>nullValue());
        verify(testTransaction, times(1)).commit();
View Full Code Here

Examples of org.mule.tck.testmodels.mule.TestTransaction

    @Test
    public void testCommitCurrentTransactionWithSuspendedTransaction() throws Exception
    {
        assertThat(tc.getTransaction(), IsNull.<Object>nullValue());
        TestTransaction xaTx = spy(new TestTransaction(muleContext));
        xaTx.setXA(true);
        Transaction tx = spy(new TestTransaction(muleContext));

        tc.bindTransaction(xaTx);
        tc.suspendCurrentTransaction();
        tc.bindTransaction(tx);
        tc.commitCurrentTransaction();
View Full Code Here

Examples of org.mule.tck.testmodels.mule.TestTransaction

    @Test
    public void testRollbackCurrentTransaction() throws Exception
    {
        assertThat(tc.getTransaction(), IsNull.<Object>nullValue());
        tc.commitCurrentTransaction();
        TestTransaction testTransaction = spy(new TestTransaction(muleContext));

        tc.bindTransaction(testTransaction);
        tc.rollbackCurrentTransaction();
        assertThat(tc.getTransaction(),IsNull.<Object>nullValue());
        verify(testTransaction, times(1)).rollback();
View Full Code Here

Examples of org.mule.tck.testmodels.mule.TestTransaction

    @Test
    public void testRollbackCurrentTransactionWithSuspendedTransaction() throws Exception
    {
        assertThat(tc.getTransaction(), IsNull.<Object>nullValue());
        TestTransaction xaTx = spy(new TestTransaction(muleContext));
        xaTx.setXA(true);
        Transaction tx = spy(new TestTransaction(muleContext));

        tc.bindTransaction(xaTx);
        tc.suspendCurrentTransaction();
        tc.bindTransaction(tx);
        tc.rollbackCurrentTransaction();
View Full Code Here

Examples of org.mule.tck.testmodels.mule.TestTransaction

    public void testResumeXaTransactionIfAvailableWithNoTx() throws Exception
    {
        assertThat(tc.getTransaction(), IsNull.<Object>nullValue());
        tc.resumeXaTransactionIfAvailable();

        Transaction tx = spy(new TestTransaction(muleContext));
        tc.bindTransaction(tx);
        tc.resumeXaTransactionIfAvailable();
        verify(tx, times(0)).resume();
    }
View Full Code Here

Examples of org.mule.tck.testmodels.mule.TestTransaction

    public void testResumeXaTransactionIfAvailableWithTx() throws Exception
    {
        assertThat(tc.getTransaction(), IsNull.<Object>nullValue());
        tc.resumeXaTransactionIfAvailable();

        TestTransaction tx = spy(new TestTransaction(muleContext));
        tx.setXA(true);
        tc.bindTransaction(tx);
        tc.suspendCurrentTransaction();
        tc.resumeXaTransactionIfAvailable();
        verify(tx, times(1)).suspend();
        verify(tx, times(1)).resume();
View Full Code Here

Examples of org.mule.tck.testmodels.mule.TestTransaction

    @Test(expected = IllegalTransactionStateException.class)
    public void testResumeXaTransactionTwice() throws Exception
    {
        assertThat(tc.getTransaction(), IsNull.<Object>nullValue());
        TestTransaction tx = spy(new TestTransaction(muleContext));
        tx.setXA(true);
        tc.bindTransaction(tx);
        tc.resumeSuspendedTransaction();
        tc.resumeSuspendedTransaction();
    }
View Full Code Here

Examples of org.mule.tck.testmodels.mule.TestTransaction

    @Test
    public void testResolveTransactionForRollback() throws Exception
    {
        assertThat(tc.getTransaction(), IsNull.<Object>nullValue());
        TestTransaction tx = spy(new TestTransaction(muleContext));
        tx.setXA(true);
        tc.bindTransaction(tx);
        tx.setRollbackOnly();
        tc.resolveTransaction();
        assertThat(tc.getTransaction(),IsNull.<Object>nullValue());
        verify(tx,times(1)).rollback();
    }
View Full Code Here

Examples of org.mule.tck.testmodels.mule.TestTransaction

    @Test
    public void testResolveTransactionForCommit() throws Exception
    {
        assertThat(tc.getTransaction(), IsNull.<Object>nullValue());
        TestTransaction tx = spy(new TestTransaction(muleContext));
        tx.setXA(true);
        tc.bindTransaction(tx);
        tc.resolveTransaction();
        assertThat(tc.getTransaction(),IsNull.<Object>nullValue());
        verify(tx,times(1)).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.