Refactor all samples to use the build.GemFireServerPlugin Gradle Plugin.
This commit is contained in:
@@ -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]"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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() {
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user