Java 类org.springframework.boot.autoconfigure.transaction.jta.JtaAutoConfiguration 实例源码

项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:HibernateJpaAutoConfigurationTests.java   
@Test
public void defaultJtaPlatform() throws Exception {
    this.context.register(JtaAutoConfiguration.class);
    setupTestConfiguration();
    this.context.refresh();
    Map<String, Object> jpaPropertyMap = this.context
            .getBean(LocalContainerEntityManagerFactoryBean.class)
            .getJpaPropertyMap();
    assertThat(jpaPropertyMap.get("hibernate.transaction.jta.platform"))
            .isInstanceOf(SpringJtaPlatform.class);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:HibernateJpaAutoConfigurationTests.java   
@Test
public void testCustomJtaPlatform() throws Exception {
    EnvironmentTestUtils.addEnvironment(this.context,
            "spring.jpa.properties.hibernate.transaction.jta.platform:"
                    + TestJtaPlatform.class.getName());
    this.context.register(JtaAutoConfiguration.class);
    setupTestConfiguration();
    this.context.refresh();
    Map<String, Object> jpaPropertyMap = this.context
            .getBean(LocalContainerEntityManagerFactoryBean.class)
            .getJpaPropertyMap();
    assertThat((String) jpaPropertyMap.get("hibernate.transaction.jta.platform"))
            .isEqualTo(TestJtaPlatform.class.getName());
}
项目:spring-boot-concourse    文件:HibernateJpaAutoConfigurationTests.java   
@Test
public void defaultJtaPlatform() throws Exception {
    this.context.register(JtaAutoConfiguration.class);
    setupTestConfiguration();
    this.context.refresh();
    Map<String, Object> jpaPropertyMap = this.context
            .getBean(LocalContainerEntityManagerFactoryBean.class)
            .getJpaPropertyMap();
    assertThat(jpaPropertyMap.get("hibernate.transaction.jta.platform"))
            .isInstanceOf(SpringJtaPlatform.class);
}
项目:spring-boot-concourse    文件:HibernateJpaAutoConfigurationTests.java   
@Test
public void testCustomJtaPlatform() throws Exception {
    EnvironmentTestUtils.addEnvironment(this.context,
            "spring.jpa.properties.hibernate.transaction.jta.platform:"
                    + TestJtaPlatform.class.getName());
    this.context.register(JtaAutoConfiguration.class);
    setupTestConfiguration();
    this.context.refresh();
    Map<String, Object> jpaPropertyMap = this.context
            .getBean(LocalContainerEntityManagerFactoryBean.class)
            .getJpaPropertyMap();
    assertThat((String) jpaPropertyMap.get("hibernate.transaction.jta.platform"))
            .isEqualTo(TestJtaPlatform.class.getName());
}
项目:contestparser    文件:HibernateJpaAutoConfigurationTests.java   
@Test
public void defaultJtaPlatform() throws Exception {
    this.context.register(JtaProperties.class, JtaAutoConfiguration.class);
    setupTestConfiguration();
    this.context.refresh();
    Map<String, Object> jpaPropertyMap = this.context
            .getBean(LocalContainerEntityManagerFactoryBean.class)
            .getJpaPropertyMap();
    assertThat(jpaPropertyMap.get("hibernate.transaction.jta.platform"),
            instanceOf(SpringJtaPlatform.class));
}
项目:contestparser    文件:HibernateJpaAutoConfigurationTests.java   
@Test
public void testCustomJtaPlatform() throws Exception {
    EnvironmentTestUtils.addEnvironment(this.context,
            "spring.jpa.properties.hibernate.transaction.jta.platform:"
                    + TestJtaPlatform.class.getName());
    this.context.register(JtaProperties.class, JtaAutoConfiguration.class);
    setupTestConfiguration();
    this.context.refresh();
    Map<String, Object> jpaPropertyMap = this.context
            .getBean(LocalContainerEntityManagerFactoryBean.class)
            .getJpaPropertyMap();
    assertThat((String) jpaPropertyMap.get("hibernate.transaction.jta.platform"),
            equalTo(TestJtaPlatform.class.getName()));
}