Package org.mule.transaction

Examples of org.mule.transaction.MuleTransactionConfig


    @Test
    public void testActionAlwaysBeginAndSuspendXaTxAndFailureCallback() throws Exception
    {
        TransactionCoordination.getInstance().bindTransaction(mockTransaction);
        mockTransaction.setXA(true);
        MuleTransactionConfig config = new MuleTransactionConfig(TransactionConfig.ACTION_ALWAYS_BEGIN);
        ExecutionTemplate executionTemplate = createExecutionTemplate(config);
        config.setFactory(new TestTransactionFactory(mockNewTransaction));
        MuleEvent exceptionListenerResult = configureExceptionListenerCall();
        try
        {
            executionTemplate.execute(getFailureTransactionCallback());
        }
View Full Code Here


    }

    @Test
    public void testActionAlwaysJoinAndExternalTxAndFailureCallback() throws Exception
    {
        MuleTransactionConfig config = new MuleTransactionConfig(TransactionConfig.ACTION_ALWAYS_JOIN);
        config.setInteractWithExternal(true);
        mockExternalTransactionFactory = mock(ExternalTransactionAwareTransactionFactory.class);
        config.setFactory(mockExternalTransactionFactory);
        when(mockExternalTransactionFactory.joinExternalTransaction(mockMuleContext)).thenAnswer(new Answer<Transaction>()
        {
            @Override
            public Transaction answer(InvocationOnMock invocationOnMock) throws Throwable
            {
View Full Code Here

    }
   
    @Test
    public void testInnerTransactionCreatedAndResolved() throws Exception
    {
        ExecutionTemplate transactionTemplate = createExecutionTemplate(new MuleTransactionConfig());
        configureExceptionListenerCall();
        when(mockMessagingException.causedRollback()).thenReturn(false);
        try
        {
            transactionTemplate.execute(TransactionTemplateTestUtils.getFailureTransactionCallbackStartsTransaction(mockMessagingException, mockTransaction));
View Full Code Here

    }

    @Test
    public void testInnerTransactionCreatedAndNotResolved() throws Exception
    {
        ExecutionTemplate transactionTemplate = TransactionalErrorHandlingExecutionTemplate.createScopeExecutionTemplate(mockMuleContext, new MuleTransactionConfig(), mockMessagingExceptionHandler);
        configureCatchExceptionListenerCall();
        when(mockMessagingException.causedRollback()).thenReturn(false);
        try
        {
            transactionTemplate.execute(TransactionTemplateTestUtils.getFailureTransactionCallbackStartsTransaction(mockMessagingException, mockTransaction));
View Full Code Here

TOP

Related Classes of org.mule.transaction.MuleTransactionConfig

Copyright © 2018 www.massapicom. 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.