Remove use of deprecated Apache Geode Pool API.

Remove the configuration of Pool.threadLocalConnections and replace with Pool.subcriptionEnabled configuration.
This commit is contained in:
John Blum
2022-01-31 15:26:39 -08:00
parent 74b58d507b
commit d118cc2eb8

View File

@@ -107,7 +107,7 @@ public class ClientCachePoolCustomizationsIntegrationTests extends SpringBootApp
assertThat(namedPoolBean).isNotNull();
assertThat(namedPoolBean.getName()).isEqualTo(poolName);
assertThat(namedPoolBean.getServerGroup()).isEqualTo("TestServerGroup");
assertThat(namedPoolBean.getThreadLocalConnections()).isTrue();
assertThat(namedPoolBean.getSubscriptionEnabled()).isTrue();
}
Pool namedPool = PoolManager.find(poolName);
@@ -115,7 +115,7 @@ public class ClientCachePoolCustomizationsIntegrationTests extends SpringBootApp
assertThat(namedPool).isNotNull();
assertThat(namedPool.getName()).isEqualTo(poolName);
assertThat(namedPool.getServerGroup()).isEqualTo("TestServerGroup");
assertThat(namedPool.getThreadLocalConnections()).isTrue();
assertThat(namedPool.getSubscriptionEnabled()).isTrue();
if (DEFAULT_POOL_NAME.equals(poolName)) {
assertThat(namedPool).isSameAs(clientCache.getDefaultPool());
@@ -163,7 +163,7 @@ public class ClientCachePoolCustomizationsIntegrationTests extends SpringBootApp
public void usingClientCacheDefaultPoolPropertiesConfigurationModifiesDefaultPool() {
System.setProperty("spring.data.gemfire.pool.default.server-group", "TestServerGroup");
System.setProperty("spring.data.gemfire.pool.default.thread-local-connections", Boolean.TRUE.toString());
System.setProperty("spring.data.gemfire.pool.default.subscription-enabled", Boolean.TRUE.toString());
ConfigurableApplicationContext applicationContext =
newApplicationContext(WithAutoConfiguredClientCacheConfiguration.class,
@@ -177,7 +177,7 @@ public class ClientCachePoolCustomizationsIntegrationTests extends SpringBootApp
public void usingClientCachePoolPropertiesConfigurationModifiesAllPools() {
System.setProperty("spring.data.gemfire.pool.server-group", "TestServerGroup");
System.setProperty("spring.data.gemfire.pool.thread-local-connections", Boolean.TRUE.toString());
System.setProperty("spring.data.gemfire.pool.subscription-enabled", Boolean.TRUE.toString());
ConfigurableApplicationContext applicationContext =
newApplicationContext(WithAutoConfiguredClientCacheConfiguration.class,
@@ -237,7 +237,7 @@ public class ClientCachePoolCustomizationsIntegrationTests extends SpringBootApp
public void usingPoolPropertiesForTestPoolModifiesTestPool() {
System.setProperty("spring.data.gemfire.pool.TestPool.server-group", "TestServerGroup");
System.setProperty("spring.data.gemfire.pool.TestPool.thread-local-connections", Boolean.TRUE.toString());
System.setProperty("spring.data.gemfire.pool.TestPool.subscription-enabled", Boolean.TRUE.toString());
ConfigurableApplicationContext applicationContext =
newApplicationContext(WithAutoConfiguredClientCacheConfiguration.class,
@@ -272,7 +272,7 @@ public class ClientCachePoolCustomizationsIntegrationTests extends SpringBootApp
@EnableGemFireMockObjects(destroyOnEvents = ContextClosedEvent.class)
static class WithAutoConfiguredClientCacheConfiguration { }
@ClientCacheApplication(serverGroup = "TestServerGroup", threadLocalConnections = true)
@ClientCacheApplication(serverGroup = "TestServerGroup", subscriptionEnabled = true)
static class WithClientCacheApplicationConfiguration { }
@Configuration
@@ -284,7 +284,7 @@ public class ClientCachePoolCustomizationsIntegrationTests extends SpringBootApp
return (beanName, clientCacheFactoryBean) -> {
clientCacheFactoryBean.setServerGroup("TestServerGroup");
clientCacheFactoryBean.setThreadLocalConnections(true);
clientCacheFactoryBean.setSubscriptionEnabled(true);
};
}
}
@@ -294,7 +294,7 @@ public class ClientCachePoolCustomizationsIntegrationTests extends SpringBootApp
static class WithEnableDefaultPoolConfiguration { }
@Configuration
@EnablePool(name = "DEFAULT", serverGroup = "TestServerGroup", threadLocalConnections = true)
@EnablePool(name = "DEFAULT", serverGroup = "TestServerGroup", subscriptionEnabled = true)
static class WithEnableDefaultPoolAttributesConfiguration { }
@Configuration
@@ -303,7 +303,7 @@ public class ClientCachePoolCustomizationsIntegrationTests extends SpringBootApp
@Configuration
@EnablePool(name = "TestPool", servers = @EnablePool.Server, serverGroup = "TestServerGroup",
threadLocalConnections = true)
subscriptionEnabled = true)
static class WithEnableTestPoolAttributesConfiguration { }
@Configuration
@@ -316,7 +316,7 @@ public class ClientCachePoolCustomizationsIntegrationTests extends SpringBootApp
return (beanName, poolFactoryBean) -> {
poolFactoryBean.setServerGroup("TestServerGroup");
poolFactoryBean.setThreadLocalConnections(true);
poolFactoryBean.setSubscriptionEnabled(true);
};
}
}
@@ -335,7 +335,7 @@ public class ClientCachePoolCustomizationsIntegrationTests extends SpringBootApp
return (beanName, poolFactoryBean) -> {
poolFactoryBean.setServerGroup("TestServerGroup");
poolFactoryBean.setThreadLocalConnections(true);
poolFactoryBean.setSubscriptionEnabled(true);
};
}
}