Refactor all samples to use the build.GemFireServerPlugin Gradle Plugin.

This commit is contained in:
John Blum
2019-05-29 16:25:58 -07:00
parent b10ee66483
commit acd4d5b1a9
16 changed files with 46 additions and 152 deletions

View File

@@ -26,4 +26,13 @@ dependencies {
}
mainClassName = "sample.ServerConfig"
mainClassName = 'sample.ServerConfig'
project.tasks.findByName("prepareAppServerForIntegrationTests")?.configure { task ->
//println('Task gemfireServer' + project.tasks.findByName("gemfireServer"))
project.tasks.findByName("gemfireServer")?.configure { gemfireServerTask ->
//println "Task 'mainClassName' Property Value [$gemfireServerTask.mainClassName]"
gemfireServerTask.mainClassName = this.mainClassName
//println "Task 'mainClassName' Property Value [$gemfireServerTask.mainClassName]"
}
}

View File

@@ -39,7 +39,7 @@ public class ClientConfig extends IntegrationTestConfig {
@Bean
ClientCacheConfigurer clientCacheServerPortConfigurer(
@Value("${spring.session.data.geode.cache.server.port:40404}") int port) { // <3>
@Value("${spring.data.gemfire.cache.server.port:40404}") int port) { // <3>
return (beanName, clientCacheFactoryBean) ->
clientCacheFactoryBean.setServers(Collections.singletonList(

View File

@@ -56,7 +56,7 @@ public abstract class IntegrationTestConfig {
@Bean
BeanPostProcessor clientServerReadyBeanPostProcessor(
@Value("${spring.session.data.geode.cache.server.port:40404}") int port) { // <5>
@Value("${spring.data.gemfire.cache.server.port:40404}") int port) { // <5>
return new BeanPostProcessor() {

View File

@@ -16,8 +16,6 @@
package sample;
import java.io.IOException;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Bean;
@@ -34,7 +32,7 @@ import org.springframework.session.data.gemfire.config.annotation.web.http.Enabl
public class ServerConfig {
@SuppressWarnings("resource")
public static void main(String[] args) throws IOException {
public static void main(String[] args) {
new AnnotationConfigApplicationContext(ServerConfig.class).registerShutdownHook();
}
@@ -46,7 +44,7 @@ public class ServerConfig {
@Bean
CacheServerConfigurer cacheServerPortConfigurer(
@Value("${spring.session.data.geode.cache.server.port:40404}") int port) { // <4>
@Value("${spring.data.gemfire.cache.server.port:40404}") int port) { // <4>
return (beanName, cacheServerFactoryBean) -> {
cacheServerFactoryBean.setPort(port);