Merge branch '2.1.x'

pull/15554/head
Andy Wilkinson 6 years ago
commit ddf64802c0

@ -24,7 +24,6 @@ import org.springframework.boot.autoconfigure.jdbc.XADataSourceAutoConfiguration
import org.springframework.boot.autoconfigure.jms.activemq.ActiveMQAutoConfiguration;
import org.springframework.boot.autoconfigure.jms.artemis.ArtemisAutoConfiguration;
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
@ -33,6 +32,7 @@ import org.springframework.context.annotation.Import;
*
* @author Josh Long
* @author Phillip Webb
* @author Nishant Raut
* @since 1.2.0
*/
@Configuration
@ -43,7 +43,6 @@ import org.springframework.context.annotation.Import;
HibernateJpaAutoConfiguration.class })
@Import({ JndiJtaConfiguration.class, BitronixJtaConfiguration.class,
AtomikosJtaConfiguration.class })
@EnableConfigurationProperties(JtaProperties.class)
public class JtaAutoConfiguration {
}

@ -42,7 +42,6 @@ import org.junit.rules.TemporaryFolder;
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import org.springframework.boot.autoconfigure.transaction.TransactionAutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.jdbc.XADataSourceWrapper;
import org.springframework.boot.jms.XAConnectionFactoryWrapper;
import org.springframework.boot.jta.atomikos.AtomikosDataSourceBean;
@ -70,6 +69,7 @@ import static org.mockito.Mockito.mock;
* @author Phillip Webb
* @author Andy Wilkinson
* @author Kazuki Shimizu
* @author Nishant Raut
*/
public class JtaAutoConfigurationTests {
@ -134,7 +134,7 @@ public class JtaAutoConfigurationTests {
@Test
public void defaultBitronixServerId() throws UnknownHostException {
this.context = new AnnotationConfigApplicationContext(
JtaPropertiesConfiguration.class, BitronixJtaConfiguration.class);
BitronixJtaConfiguration.class);
String serverId = this.context.getBean(bitronix.tm.Configuration.class)
.getServerId();
assertThat(serverId).isEqualTo(InetAddress.getLocalHost().getHostAddress());
@ -145,8 +145,7 @@ public class JtaAutoConfigurationTests {
this.context = new AnnotationConfigApplicationContext();
TestPropertyValues.of("spring.jta.transactionManagerId:custom")
.applyTo(this.context);
this.context.register(JtaPropertiesConfiguration.class,
BitronixJtaConfiguration.class);
this.context.register(BitronixJtaConfiguration.class);
this.context.refresh();
String serverId = this.context.getBean(bitronix.tm.Configuration.class)
.getServerId();
@ -159,8 +158,7 @@ public class JtaAutoConfigurationTests {
File logs = this.temp.newFolder("jta");
TestPropertyValues.of("spring.jta.logDir:" + logs.getAbsolutePath())
.applyTo(this.context);
this.context.register(JtaPropertiesConfiguration.class,
AtomikosJtaConfiguration.class);
this.context.register(AtomikosJtaConfiguration.class);
this.context.refresh();
File epochFile = new File(logs, "tmlog0.log");
@ -174,8 +172,7 @@ public class JtaAutoConfigurationTests {
.of("spring.jta.atomikos.connectionfactory.minPoolSize:5",
"spring.jta.atomikos.connectionfactory.maxPoolSize:10")
.applyTo(this.context);
this.context.register(JtaPropertiesConfiguration.class,
AtomikosJtaConfiguration.class, PoolConfiguration.class);
this.context.register(AtomikosJtaConfiguration.class, PoolConfiguration.class);
this.context.refresh();
AtomikosConnectionFactoryBean connectionFactory = this.context
.getBean(AtomikosConnectionFactoryBean.class);
@ -190,8 +187,7 @@ public class JtaAutoConfigurationTests {
.of("spring.jta.bitronix.connectionfactory.minPoolSize:5",
"spring.jta.bitronix.connectionfactory.maxPoolSize:10")
.applyTo(this.context);
this.context.register(JtaPropertiesConfiguration.class,
BitronixJtaConfiguration.class, PoolConfiguration.class);
this.context.register(BitronixJtaConfiguration.class, PoolConfiguration.class);
this.context.refresh();
PoolingConnectionFactoryBean connectionFactory = this.context
.getBean(PoolingConnectionFactoryBean.class);
@ -206,8 +202,7 @@ public class JtaAutoConfigurationTests {
.of("spring.jta.atomikos.datasource.minPoolSize:5",
"spring.jta.atomikos.datasource.maxPoolSize:10")
.applyTo(this.context);
this.context.register(JtaPropertiesConfiguration.class,
AtomikosJtaConfiguration.class, PoolConfiguration.class);
this.context.register(AtomikosJtaConfiguration.class, PoolConfiguration.class);
this.context.refresh();
AtomikosDataSourceBean dataSource = this.context
.getBean(AtomikosDataSourceBean.class);
@ -222,8 +217,7 @@ public class JtaAutoConfigurationTests {
.of("spring.jta.bitronix.datasource.minPoolSize:5",
"spring.jta.bitronix.datasource.maxPoolSize:10")
.applyTo(this.context);
this.context.register(JtaPropertiesConfiguration.class,
BitronixJtaConfiguration.class, PoolConfiguration.class);
this.context.register(BitronixJtaConfiguration.class, PoolConfiguration.class);
this.context.refresh();
PoolingDataSourceBean dataSource = this.context
.getBean(PoolingDataSourceBean.class);
@ -263,12 +257,6 @@ public class JtaAutoConfigurationTests {
assertThat(transactionManager.isRollbackOnCommitFailure()).isTrue();
}
@Configuration
@EnableConfigurationProperties(JtaProperties.class)
public static class JtaPropertiesConfiguration {
}
@Configuration
public static class CustomTransactionManagerConfig {

Loading…
Cancel
Save