Skip to content

Commit

Permalink
Merge branch '2.1.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
wilkinsona committed Dec 21, 2018
2 parents dd96fff + 3cfcc9e commit ddf6480
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
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;

Expand All @@ -33,6 +32,7 @@
*
* @author Josh Long
* @author Phillip Webb
* @author Nishant Raut
* @since 1.2.0
*/
@Configuration
Expand All @@ -43,7 +43,6 @@
HibernateJpaAutoConfiguration.class })
@Import({ JndiJtaConfiguration.class, BitronixJtaConfiguration.class,
AtomikosJtaConfiguration.class })
@EnableConfigurationProperties(JtaProperties.class)
public class JtaAutoConfiguration {

}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@

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;
Expand Down Expand Up @@ -70,6 +69,7 @@
* @author Phillip Webb
* @author Andy Wilkinson
* @author Kazuki Shimizu
* @author Nishant Raut
*/
public class JtaAutoConfigurationTests {

Expand Down Expand Up @@ -134,7 +134,7 @@ public void bitronixSanityCheck() {
@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());
Expand All @@ -145,8 +145,7 @@ public void customBitronixServerId() {
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();
Expand All @@ -159,8 +158,7 @@ public void defaultAtomikosTransactionManagerName() throws IOException {
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");
Expand All @@ -174,8 +172,7 @@ public void atomikosConnectionFactoryPoolConfiguration() {
.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);
Expand All @@ -190,8 +187,7 @@ public void bitronixConnectionFactoryPoolConfiguration() {
.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);
Expand All @@ -206,8 +202,7 @@ public void atomikosDataSourcePoolConfiguration() {
.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);
Expand All @@ -222,8 +217,7 @@ public void bitronixDataSourcePoolConfiguration() {
.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);
Expand Down Expand Up @@ -263,12 +257,6 @@ public void bitronixCustomizeJtaTransactionManagerUsingProperties() {
assertThat(transactionManager.isRollbackOnCommitFailure()).isTrue();
}

@Configuration
@EnableConfigurationProperties(JtaProperties.class)
public static class JtaPropertiesConfiguration {

}

@Configuration
public static class CustomTransactionManagerConfig {

Expand Down

0 comments on commit ddf6480

Please sign in to comment.