From 3f84baa3783e0358d5f99e516442937e7c85f2e2 Mon Sep 17 00:00:00 2001 From: John Blum Date: Tue, 17 May 2016 12:11:59 -0700 Subject: [PATCH] SGF-497 - Change Pool reference from GemFire's DEFAULT Pool to the gemfireServerPool in the BeanPostProcessor when checking the pending event count. (cherry picked from commit 2d2dca163323d557aed3791d2d1f9a9ed23f01ed) Signed-off-by: John Blum --- build.gradle | 106 +++++++++--------- .../DurableClientCacheIntegrationTest.java | 9 +- ...ableClientCacheIntegrationTest-context.xml | 3 +- 3 files changed, 58 insertions(+), 60 deletions(-) diff --git a/build.gradle b/build.gradle index 50a0b6cc..74c6b803 100644 --- a/build.gradle +++ b/build.gradle @@ -18,8 +18,8 @@ configurations { } apply plugin: "java" -apply plugin: 'idea' apply plugin: 'eclipse' +apply plugin: 'idea' apply from: "$rootDir/maven.gradle" apply plugin: 'bundlor' apply plugin: 'propdeps' @@ -33,17 +33,6 @@ archivesBaseName = project.name sourceCompatibility = 1.6 targetCompatibility = 1.6 -sourceSets { - main { - output.resourcesDir = 'build/classes/main' - output.classesDir = 'build/classes/main' - } - test { - output.resourcesDir = 'build/classes/test' - output.classesDir = 'build/classes/test' - } -} - [compileJava, compileTestJava]*.options*.compilerArgs = ["-Xlint:-serial"] if (project.hasProperty('platformVersion')) { @@ -79,6 +68,17 @@ tasks.withType(Test).all { systemProperties['spring.profiles.active'] = 'apache-geode' } +sourceSets { + main { + output.resourcesDir = 'build/classes/main' + output.classesDir = 'build/classes/main' + } + test { + output.resourcesDir = 'build/classes/test' + output.classesDir = 'build/classes/test' + } +} + repositories { maven { url "https://repo.spring.io/libs-release" } maven { url "https://repo.spring.io/plugins-release"} @@ -88,51 +88,51 @@ repositories { dependencies { // Spring Framework compile("org.springframework:spring-context-support:$springVersion") { - exclude group: "commons-logging", module: "commons-logging" + exclude group: "commons-logging", module: "commons-logging" } compile("org.springframework:spring-tx:$springVersion") { - exclude group: "commons-logging", module: "commons-logging" + exclude group: "commons-logging", module: "commons-logging" } - // Spring Data - compile("org.springframework.data:spring-data-commons:${springDataCommonsVersion}") { - exclude group: "commons-logging", module: "commons-logging" - } + // Spring Data + compile("org.springframework.data:spring-data-commons:${springDataCommonsVersion}") { + exclude group: "commons-logging", module: "commons-logging" + } - // Apache Geode (a.k.a. Pivotal GemFire) - compile("org.apache.geode:geode-core:$gemfireVersion") { - exclude group: "com.fasterxml.jackson.core", module: "jackson-annotations" - exclude group: "com.fasterxml.jackson.core", module: "jackson-core" - exclude group: "com.fasterxml.jackson.core", module: "jackson-databind" + // Apache Geode (a.k.a. Pivotal GemFire) + compile("org.apache.geode:geode-core:$gemfireVersion") { + exclude group: "com.fasterxml.jackson.core", module: "jackson-annotations" + exclude group: "com.fasterxml.jackson.core", module: "jackson-core" + exclude group: "com.fasterxml.jackson.core", module: "jackson-databind" exclude group: "org.apache.hbase", module: "hbase" - exclude group: "org.apache.logging.log4j", module: "log4j-slf4j-impl" - exclude group: "org.slf4j", module: "slf4j-api" - exclude group: "org.springframework", module: "spring-aop" - exclude group: "org.springframework", module: "spring-beans" - exclude group: "org.springframework", module: "spring-context" - exclude group: "org.springframework", module: "spring-context-support" - exclude group: "org.springframework", module: "spring-core" - exclude group: "org.springframework", module: "spring-expression" - exclude group: "org.springframework", module: "spring-tx" - exclude group: "org.springframework", module: "spring-web" - exclude group: "org.springframework", module: "spring-webmvc" - exclude group: "org.springframework.data", module: "spring-data-commons" - exclude group: "org.springframework.shell", module: "spring-shell" - } + exclude group: "org.apache.logging.log4j", module: "log4j-slf4j-impl" + exclude group: "org.slf4j", module: "slf4j-api" + exclude group: "org.springframework", module: "spring-aop" + exclude group: "org.springframework", module: "spring-beans" + exclude group: "org.springframework", module: "spring-context" + exclude group: "org.springframework", module: "spring-context-support" + exclude group: "org.springframework", module: "spring-core" + exclude group: "org.springframework", module: "spring-expression" + exclude group: "org.springframework", module: "spring-tx" + exclude group: "org.springframework", module: "spring-web" + exclude group: "org.springframework", module: "spring-webmvc" + exclude group: "org.springframework.data", module: "spring-data-commons" + exclude group: "org.springframework.shell", module: "spring-shell" + } compile("org.apache.geode:geode-cq:$gemfireVersion") compile("org.apache.geode:geode-wan:$gemfireVersion") - optional("com.google.code.findbugs:annotations:2.0.2") - runtime("antlr:antlr:$antlrVersion") + optional("com.google.code.findbugs:annotations:2.0.2") + runtime("antlr:antlr:$antlrVersion") optional "javax.enterprise:cdi-api:$cdiVersion" - compile "org.aspectj:aspectjweaver:$aspectjVersion" + compile "org.aspectj:aspectjweaver:$aspectjVersion" compile "com.fasterxml.jackson.core:jackson-annotations:$jacksonVersion" compile "com.fasterxml.jackson.core:jackson-databind:$jacksonVersion" // Testing testCompile "javax.annotation:jsr250-api:1.0", optional testCompile("org.springframework:spring-test:$springVersion") { - exclude group: "commons-logging", module: "commons-logging" + exclude group: "commons-logging", module: "commons-logging" } testCompile "junit:junit:$junitVersion" testCompile "org.hamcrest:hamcrest-core:$hamcrestVersion" @@ -143,14 +143,18 @@ dependencies { testRuntime "javax.el:el-api:$cdiVersion" testRuntime "javax.servlet:servlet-api:$servletApiVersion" - testRuntime "log4j:log4j:$log4jVersion" - testRuntime "org.apache.derby:derbyLocale_zh_TW:10.9.1.0" - testRuntime "org.slf4j:slf4j-log4j12:$slf4jVersion" + testRuntime "log4j:log4j:$log4jVersion" + testRuntime "org.apache.derby:derbyLocale_zh_TW:10.9.1.0" + testRuntime "org.slf4j:slf4j-log4j12:$slf4jVersion" testRuntime "org.springframework.shell:spring-shell:1.0.0.RELEASE" sharedResources "org.springframework.data.build:spring-data-build-resources:$springDataBuildVersion@zip" } +bundlor { + manifestTemplate = file("template.mf").text +} + jar { dependsOn = [ 'bundlor' ] @@ -165,10 +169,6 @@ jar { } } -bundlor { - manifestTemplate = file("template.mf").text -} - javadoc { dependsOn = [ 'extractSharedResources' ] destinationDir = file("${buildDir}/api") @@ -186,12 +186,10 @@ javadoc { ] links = [ - "http://static.springframework.org/spring/docs/3.1.x/javadoc-api", - "http://download.oracle.com/javase/6/docs/api", - "http://www.gemstone.com/docs/6.5.1/product/docs/japi/", - "http://asm.objectweb.org/asm223/javadoc/user", - "http://logging.apache.org/log4j/docs/api/", - "http://atinject.googlecode.com/svn/trunk/javadoc/" + "http://docs.oracle.com/javase/6/docs/api/", + "http://docs.spring.io/spring/docs/current/javadoc-api/", + "http://gemfire.docs.pivotal.io/docs-gemfire/latest/javadocs/japi/", + "http://logging.apache.org/log4j/1.2/apidocs/", ] exclude "org/springframework/data/gemfire/config/**" diff --git a/src/test/java/org/springframework/data/gemfire/client/DurableClientCacheIntegrationTest.java b/src/test/java/org/springframework/data/gemfire/client/DurableClientCacheIntegrationTest.java index a5bf3446..f30315fe 100644 --- a/src/test/java/org/springframework/data/gemfire/client/DurableClientCacheIntegrationTest.java +++ b/src/test/java/org/springframework/data/gemfire/client/DurableClientCacheIntegrationTest.java @@ -61,6 +61,7 @@ import com.gemstone.gemfire.cache.Region; import com.gemstone.gemfire.cache.client.ClientCache; import com.gemstone.gemfire.cache.client.ClientCacheFactory; import com.gemstone.gemfire.cache.client.ClientRegionShortcut; +import com.gemstone.gemfire.cache.client.Pool; import com.gemstone.gemfire.cache.util.CacheListenerAdapter; /** @@ -263,17 +264,17 @@ public class DurableClientCacheIntegrationTest extends AbstractGemFireClientServ @Override public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { - if (bean instanceof ClientCache) { - ClientCache clientCache = (ClientCache) bean; + if (bean instanceof Pool && "gemfireServerPool".equals(beanName)) { + Pool gemfireServerPool = (Pool) bean; if (isBeforeDirtiesContext()) { // NOTE: A value of -2 indicates the client connected to the server for the first time... - assertThat(clientCache.getDefaultPool().getPendingEventCount(), is(equalTo(-2))); + assertThat(gemfireServerPool.getPendingEventCount(), is(equalTo(-2))); } else { // NOTE: the pending event count could be 3 because it should minimally include the 2 puts // from the client cache producer and possibly a "marker" as well... - assertThat(clientCache.getDefaultPool().getPendingEventCount(), is(greaterThanOrEqualTo(2))); + assertThat(gemfireServerPool.getPendingEventCount(), is(greaterThanOrEqualTo(2))); } } diff --git a/src/test/resources/org/springframework/data/gemfire/client/DurableClientCacheIntegrationTest-context.xml b/src/test/resources/org/springframework/data/gemfire/client/DurableClientCacheIntegrationTest-context.xml index 199afa32..186ff575 100644 --- a/src/test/resources/org/springframework/data/gemfire/client/DurableClientCacheIntegrationTest-context.xml +++ b/src/test/resources/org/springframework/data/gemfire/client/DurableClientCacheIntegrationTest-context.xml @@ -37,8 +37,7 @@ DurableClientCacheIntegrationTestClient -