Search in sources :

Example 1 with TransactionCoordinatorBuilderInitiator

use of org.hibernate.resource.transaction.internal.TransactionCoordinatorBuilderInitiator in project hibernate-orm by hibernate.

the class LegacySettingInitiatorTest method testLegacySettingSelection.

@Test
public void testLegacySettingSelection() {
    final TransactionCoordinatorBuilderInitiator initiator = new TransactionCoordinatorBuilderInitiator();
    TransactionCoordinatorBuilder builder = initiator.initiateService(Collections.singletonMap(TransactionCoordinatorBuilderInitiator.LEGACY_SETTING_NAME, "org.hibernate.transaction.JDBCTransactionFactory"), bsr);
    assertThat(builder, instanceOf(JdbcResourceLocalTransactionCoordinatorBuilderImpl.class));
    builder = initiator.initiateService(Collections.singletonMap(TransactionCoordinatorBuilderInitiator.LEGACY_SETTING_NAME, "org.hibernate.transaction.JTATransactionFactory"), bsr);
    assertThat(builder, instanceOf(JtaTransactionCoordinatorBuilderImpl.class));
    builder = initiator.initiateService(Collections.singletonMap(TransactionCoordinatorBuilderInitiator.LEGACY_SETTING_NAME, "org.hibernate.transaction.CMTTransactionFactory"), bsr);
    assertThat(builder, instanceOf(JtaTransactionCoordinatorBuilderImpl.class));
}
Also used : JtaTransactionCoordinatorBuilderImpl(org.hibernate.resource.transaction.backend.jta.internal.JtaTransactionCoordinatorBuilderImpl) TransactionCoordinatorBuilderInitiator(org.hibernate.resource.transaction.internal.TransactionCoordinatorBuilderInitiator) JdbcResourceLocalTransactionCoordinatorBuilderImpl(org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorBuilderImpl) TransactionCoordinatorBuilder(org.hibernate.resource.transaction.spi.TransactionCoordinatorBuilder) Test(org.junit.Test)

Aggregations

JdbcResourceLocalTransactionCoordinatorBuilderImpl (org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorBuilderImpl)1 JtaTransactionCoordinatorBuilderImpl (org.hibernate.resource.transaction.backend.jta.internal.JtaTransactionCoordinatorBuilderImpl)1 TransactionCoordinatorBuilderInitiator (org.hibernate.resource.transaction.internal.TransactionCoordinatorBuilderInitiator)1 TransactionCoordinatorBuilder (org.hibernate.resource.transaction.spi.TransactionCoordinatorBuilder)1 Test (org.junit.Test)1