use of org.mule.runtime.core.api.transaction.MuleTransactionConfig in project mule by mulesoft.
the class TransactionalExecutionTemplateTestCase method testActionBeginOrJoinAndNoTx.
@Test
public void testActionBeginOrJoinAndNoTx() throws Exception {
MuleTransactionConfig config = new MuleTransactionConfig(TransactionConfig.ACTION_BEGIN_OR_JOIN);
ExecutionTemplate executionTemplate = createExecutionTemplate(config);
config.setFactory(new TestTransactionFactory(mockTransaction));
Object result = executionTemplate.execute(getEmptyTransactionCallback());
assertThat(result, is(RETURN_VALUE));
verify(mockTransaction).commit();
verify(mockTransaction, never()).rollback();
assertThat(TransactionCoordination.getInstance().getTransaction(), IsNull.<Object>nullValue());
}
use of org.mule.runtime.core.api.transaction.MuleTransactionConfig in project mule by mulesoft.
the class TransactionalExecutionTemplateTestCase method testActionIndifferentConfig.
@Test
public void testActionIndifferentConfig() throws Exception {
MuleTransactionConfig config = new MuleTransactionConfig(TransactionConfig.ACTION_INDIFFERENT);
ExecutionTemplate executionTemplate = createExecutionTemplate(config);
Object result = executionTemplate.execute(getEmptyTransactionCallback());
assertThat(result, is(RETURN_VALUE));
assertThat(TransactionCoordination.getInstance().getTransaction(), IsNull.<Object>nullValue());
}
use of org.mule.runtime.core.api.transaction.MuleTransactionConfig in project mule by mulesoft.
the class TransactionalExecutionTemplateTestCase method testActionNoneAndNoTx.
@Test
public void testActionNoneAndNoTx() throws Exception {
MuleTransactionConfig config = new MuleTransactionConfig(TransactionConfig.ACTION_NONE);
ExecutionTemplate executionTemplate = createExecutionTemplate(config);
Object result = executionTemplate.execute(getEmptyTransactionCallback());
assertThat(result, is(RETURN_VALUE));
}
Aggregations