[geode-native] branch develop updated (11a9bc2 -> 7dbcae0)
This is an automated email from the ASF dual-hosted git repository. mkevo pushed a change to branch develop in repository https://gitbox.apache.org/repos/asf/geode-native.git. from 11a9bc2 GEODE-7868: Enhance ReflectionBasedAutoSerializer (#585) new 2e0fe62 GEODE-7930: Fix endpoint name truncation bug new 42fb6fb Introduced fixes: new 7dbcae0 Merge pull request #588 from Nordix/feature/GEODE-7930 The 1139 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: cppcache/src/ThinClientPoolDM.cpp | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-)
[geode] branch develop updated (d4b7c14 -> 1b1ad6b)
This is an automated email from the ASF dual-hosted git repository. moleske pushed a change to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git. from d4b7c14 GEODE-7864: Closing the query statements after execution. (#4873) add 1b1ad6b GEODE-7947 Implement tests for EXPIRE-related functionality (#4904) No new revisions were added by this update. Summary of changes: ...Test.java => ExpireAtDockerAcceptanceTest.java} | 20 ++-- ...ceTest.java => ExpireDockerAcceptanceTest.java} | 20 ++-- .../geode/redis/GeoDockerAcceptanceTest.java | 2 +- .../geode/redis/HashesDockerAcceptanceTest.java| 2 +- .../geode/redis/ListsDockerAcceptanceTest.java | 2 +- ...eTest.java => PexpireDockerAcceptanceTest.java} | 20 ++-- .../geode/redis/PubSubDockerAcceptanceTest.java| 2 +- .../geode/redis/RenameDockerAcceptanceTest.java| 2 +- .../geode/redis/SetsDockerAcceptanceTest.java | 2 +- .../redis/SortedSetsDockerAcceptanceTest.java | 2 +- .../geode/redis/StringsDockerAcceptanceTest.java | 2 +- .../redis/general/ExpireAtIntegrationTest.java | 128 + .../geode/redis/general/ExpireIntegrationTest.java | 14 +-- .../redis/general/PexpireIntegrationTest.java | 12 +- .../redis/internal/executor/ExpireAtExecutor.java | 46 +--- .../redis/internal/executor/ExpireExecutor.java| 21 ++-- ...nitTest.java => ExpireAtExecutorJUnitTest.java} | 53 + .../executor/general/ExpireExecutorJUnitTest.java | 2 +- ...itTest.java => PExpireAtExecutorJUnitTest.java} | 54 - 19 files changed, 263 insertions(+), 143 deletions(-) copy geode-redis/src/acceptanceTest/java/org/apache/geode/redis/{ListsDockerAcceptanceTest.java => ExpireAtDockerAcceptanceTest.java} (68%) mode change 100755 => 100644 copy geode-redis/src/acceptanceTest/java/org/apache/geode/redis/{ListsDockerAcceptanceTest.java => ExpireDockerAcceptanceTest.java} (68%) mode change 100755 => 100644 copy geode-redis/src/acceptanceTest/java/org/apache/geode/redis/{ListsDockerAcceptanceTest.java => PexpireDockerAcceptanceTest.java} (68%) mode change 100755 => 100644 create mode 100644 geode-redis/src/integrationTest/java/org/apache/geode/redis/general/ExpireAtIntegrationTest.java copy geode-redis/src/test/java/org/apache/geode/redis/internal/executor/general/{ExpireExecutorJUnitTest.java => ExpireAtExecutorJUnitTest.java} (66%) copy geode-redis/src/test/java/org/apache/geode/redis/internal/executor/general/{ExpireExecutorJUnitTest.java => PExpireAtExecutorJUnitTest.java} (66%)
[geode] branch develop updated: GEODE-7864: Remove null checks that are not required Part-2. (#4881)
This is an automated email from the ASF dual-hosted git repository. nnag pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/develop by this push: new d663864 GEODE-7864: Remove null checks that are not required Part-2. (#4881) d663864 is described below commit d663864e720f354c374139bbdcbcc1f9fdd5eb83 Author: Nabarun Nag AuthorDate: Mon Apr 6 15:16:55 2020 -0700 GEODE-7864: Remove null checks that are not required Part-2. (#4881) --- .../admin/internal/ManagedSystemMemberImpl.java| 17 +++-- .../apache/geode/internal/cache/FilterProfile.java | 42 +++--- .../cache/wan/serial/BatchDestroyOperation.java| 2 +- .../pdx/internal/AutoSerializableManager.java | 21 --- .../CommandAvailabilityIndicatorTestHelper.java| 2 +- 5 files changed, 25 insertions(+), 59 deletions(-) diff --git a/geode-core/src/main/java/org/apache/geode/admin/internal/ManagedSystemMemberImpl.java b/geode-core/src/main/java/org/apache/geode/admin/internal/ManagedSystemMemberImpl.java index 310359b..81dfeca 100644 --- a/geode-core/src/main/java/org/apache/geode/admin/internal/ManagedSystemMemberImpl.java +++ b/geode-core/src/main/java/org/apache/geode/admin/internal/ManagedSystemMemberImpl.java @@ -94,23 +94,16 @@ public abstract class ManagedSystemMemberImpl extends SystemMemberImpl @Override public int setState(int state) { -if (this.stateChange == null) { - // The initial state is set in the constructor before - // stateChange is initialized. + +synchronized (this.stateChange) { int oldState = this.state; this.state = state; - return oldState; -} else { - synchronized (this.stateChange) { -int oldState = this.state; -this.state = state; + this.stateChange.notifyAll(); -this.stateChange.notifyAll(); - -return oldState; - } + return oldState; } + } /** diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/FilterProfile.java b/geode-core/src/main/java/org/apache/geode/internal/cache/FilterProfile.java index e9d95a6..b1c72ec 100755 --- a/geode-core/src/main/java/org/apache/geode/internal/cache/FilterProfile.java +++ b/geode-core/src/main/java/org/apache/geode/internal/cache/FilterProfile.java @@ -1203,16 +1203,10 @@ public class FilterProfile implements DataSerializableFixedID { fillInCQRoutingInfo(ev, true, NO_PROFILES, fri); fi = fri.getLocalFilterInfo(); } - if (this.allKeyClientsInv != null || this.keysOfInterestInv != null - || this.patternsOfInterestInv != null || this.filtersOfInterestInv != null) { -clientsInv = this.getInterestedClients(ev, this.allKeyClientsInv, -this.keysOfInterestInv, this.patternsOfInterestInv, this.filtersOfInterestInv); - } - if (this.allKeyClients != null || this.keysOfInterest != null - || this.patternsOfInterest != null || this.filtersOfInterest != null) { -clients = this.getInterestedClients(ev, this.allKeyClients, this.keysOfInterest, -this.patternsOfInterest, this.filtersOfInterest); - } + clientsInv = this.getInterestedClients(ev, this.allKeyClientsInv, + this.keysOfInterestInv, this.patternsOfInterestInv, this.filtersOfInterestInv); + clients = this.getInterestedClients(ev, this.allKeyClients, this.keysOfInterest, + this.patternsOfInterest, this.filtersOfInterest); if (clients != null || clientsInv != null) { if (fi == null) { fi = new FilterInfo(); @@ -1258,16 +1252,10 @@ public class FilterProfile implements DataSerializableFixedID { fillInCQRoutingInfo(ev, true, NO_PROFILES, fri); fi = fri.getLocalFilterInfo(); } - if (this.allKeyClientsInv != null || this.keysOfInterestInv != null - || this.patternsOfInterestInv != null || this.filtersOfInterestInv != null) { -clientsInv = this.getInterestedClients(ev, this.allKeyClientsInv, -this.keysOfInterestInv, this.patternsOfInterestInv, this.filtersOfInterestInv); - } - if (this.allKeyClients != null || this.keysOfInterest != null - || this.patternsOfInterest != null || this.filtersOfInterest != null) { -clients = this.getInterestedClients(ev, this.allKeyClients, this.keysOfInterest, -this.patternsOfInterest, this.filtersOfInterest); - } + clientsInv = this.getInterestedClients(ev, this.allKeyClientsInv, + this.keysOfInterestInv, this.patternsOfInterestInv, this.filtersOfInterestInv); + clients = this.getInterestedClients(ev, this.allKeyClients, this.keysOfInterest, + this.patternsOfInterest, this.filtersOfInterest);
[geode] branch develop updated: GEODE-7864: Closing the query statements after execution. (#4873)
This is an automated email from the ASF dual-hosted git repository. nnag pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/develop by this push: new d4b7c14 GEODE-7864: Closing the query statements after execution. (#4873) d4b7c14 is described below commit d4b7c1459c10ed1934080ef4a398b9d6232cfb45 Author: Nabarun Nag AuthorDate: Mon Apr 6 15:17:26 2020 -0700 GEODE-7864: Closing the query statements after execution. (#4873) --- .../java/org/apache/geode/internal/jta/CacheUtils.java | 16 +--- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/geode-junit/src/main/java/org/apache/geode/internal/jta/CacheUtils.java b/geode-junit/src/main/java/org/apache/geode/internal/jta/CacheUtils.java index 530ca78..2ce567e 100644 --- a/geode-junit/src/main/java/org/apache/geode/internal/jta/CacheUtils.java +++ b/geode-junit/src/main/java/org/apache/geode/internal/jta/CacheUtils.java @@ -144,12 +144,13 @@ public class CacheUtils { String sql = "select * from " + tableName; Connection conn = ds.getConnection(); -Statement sm = conn.createStatement(); -ResultSet rs = sm.executeQuery(sql); -while (rs.next()) { - System.out.println("id " + rs.getString(1) + " name " + rs.getString(2)); +try (Statement sm = conn.createStatement()) { + ResultSet rs = sm.executeQuery(sql); + while (rs.next()) { +System.out.println("id " + rs.getString(1) + " name " + rs.getString(2)); + } + rs.close(); } -rs.close(); conn.close(); } @@ -159,8 +160,9 @@ public class CacheUtils { Connection conn = ds.getConnection(); // System.out.println (" trying to drop table: " + tableName); String sql = "drop table " + tableName; -Statement sm = conn.createStatement(); -sm.execute(sql); +try (Statement sm = conn.createStatement()) { + sm.execute(sql); +} conn.close(); }
[geode] branch develop updated (e7f6faf -> d2f18fd)
This is an automated email from the ASF dual-hosted git repository. dbarnes pushed a change to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git. from e7f6faf GEODE-7950: Force TLS1.2 for installing PackageProvider=NuGet (#4908) add d2f18fd GEODE-7156: add docs for security-auth-token-enabled-components (#4910) No new revisions were added by this update. Summary of changes: .../configuring/running/cluster-management-service.html.md.erb | 9 + geode-docs/reference/topics/gemfire_properties.html.md.erb | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-)
[geode] branch develop updated: GEODE-7950: Force TLS1.2 for installing PackageProvider=NuGet (#4908)
This is an automated email from the ASF dual-hosted git repository. rhoughton pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/develop by this push: new e7f6faf GEODE-7950: Force TLS1.2 for installing PackageProvider=NuGet (#4908) e7f6faf is described below commit e7f6faf637fc77daa1ca4bd942be0c10e9577dc7 Author: Robert Houghton AuthorDate: Mon Apr 6 13:16:11 2020 -0700 GEODE-7950: Force TLS1.2 for installing PackageProvider=NuGet (#4908) Would be nice to set the default TLS for all PowerShell sessions, but that seems to be unsupported. --- ci/images/google-windows-geode-builder/build_image.sh | 3 ++- ci/images/google-windows-geode-builder/windows-packer.json | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ci/images/google-windows-geode-builder/build_image.sh b/ci/images/google-windows-geode-builder/build_image.sh index 741e21b..2c2fd96 100755 --- a/ci/images/google-windows-geode-builder/build_image.sh +++ b/ci/images/google-windows-geode-builder/build_image.sh @@ -18,7 +18,7 @@ PACKER=${PACKER:-packer} PACKER_ARGS="${*}" -INTERNAL=${INTERNAL:-true} +INTERNAL=${INTERNAL:-false} SOURCE="${BASH_SOURCE[0]}" while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink SCRIPTDIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" @@ -46,6 +46,7 @@ if [[ -n "${MY_NAME}" ]]; then GCP_NETWORK=${GCP_NETWORK##*/} GCP_SUBNETWORK=$(echo ${NETWORK_INTERFACE_INFO} | jq -r '.networkInterfaces[0].subnetwork') GCP_SUBNETWORK=${GCP_SUBNETWORK##*/} + INTERNAL=true fi if [[ -z "${GCP_PROJECT}" ]]; then diff --git a/ci/images/google-windows-geode-builder/windows-packer.json b/ci/images/google-windows-geode-builder/windows-packer.json index 17d0542..20e169b 100644 --- a/ci/images/google-windows-geode-builder/windows-packer.json +++ b/ci/images/google-windows-geode-builder/windows-packer.json @@ -53,6 +53,7 @@ "inline": [ "$ErrorActionPreference = \"Stop\"", "Set-ExecutionPolicy Bypass -Scope Process -Force", +"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12", "Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force", "Install-Module DockerMsftProvider -Force", "Install-Package Docker -ProviderName DockerMsftProvider -Force",
[geode] branch support/1.12 updated: GEODE-7941: update Shiro to recommended version 1.5.2 (#4896)
This is an automated email from the ASF dual-hosted git repository. onichols pushed a commit to branch support/1.12 in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/support/1.12 by this push: new 8a9490b GEODE-7941: update Shiro to recommended version 1.5.2 (#4896) 8a9490b is described below commit 8a9490bb617c099907dc37ad4d161c31ec7b4f63 Author: Owen Nichols <34043438+onichols-pivo...@users.noreply.github.com> AuthorDate: Wed Apr 1 21:32:16 2020 -0700 GEODE-7941: update Shiro to recommended version 1.5.2 (#4896) * GEODE-7941: update Shiro to recommended version 1.5.2 * update in dependency_classpath.txt and assembly_content.txt (cherry picked from commit 6fffd5c07a2f67575ccec6d19df48c70a51ab1c3) --- boms/geode-all-bom/src/test/resources/expected-pom.xml | 2 +- .../geode/gradle/plugins/DependencyConstraints.groovy | 2 +- .../src/integrationTest/resources/assembly_content.txt | 18 +- .../integrationTest/resources/dependency_classpath.txt | 18 +- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/boms/geode-all-bom/src/test/resources/expected-pom.xml b/boms/geode-all-bom/src/test/resources/expected-pom.xml index ce24ce9..765efc4 100644 --- a/boms/geode-all-bom/src/test/resources/expected-pom.xml +++ b/boms/geode-all-bom/src/test/resources/expected-pom.xml @@ -340,7 +340,7 @@ org.apache.shiro shiro-core -1.4.1 +1.5.2 compile diff --git a/buildSrc/src/main/groovy/org/apache/geode/gradle/plugins/DependencyConstraints.groovy b/buildSrc/src/main/groovy/org/apache/geode/gradle/plugins/DependencyConstraints.groovy index e36a2f2..45c2a79 100644 --- a/buildSrc/src/main/groovy/org/apache/geode/gradle/plugins/DependencyConstraints.groovy +++ b/buildSrc/src/main/groovy/org/apache/geode/gradle/plugins/DependencyConstraints.groovy @@ -42,7 +42,7 @@ class DependencyConstraints implements Plugin { deps.put("jgroups.version", "3.6.14.Final") deps.put("log4j.version", "2.12.1") deps.put("micrometer.version", "1.2.1") -deps.put("shiro.version", "1.4.1") +deps.put("shiro.version", "1.5.2") deps.put("slf4j-api.version", "1.7.28") // These version numbers are used in testing various versions of tomcat and are consumed explicitly diff --git a/geode-assembly/src/integrationTest/resources/assembly_content.txt b/geode-assembly/src/integrationTest/resources/assembly_content.txt index 8b3b268..3e7a85f 100644 --- a/geode-assembly/src/integrationTest/resources/assembly_content.txt +++ b/geode-assembly/src/integrationTest/resources/assembly_content.txt @@ -1044,15 +1044,15 @@ lib/netty-all-4.1.42.Final.jar lib/protobuf-java-3.10.0.jar lib/ra.jar lib/rmiio-2.1.2.jar -lib/shiro-cache-1.4.1.jar -lib/shiro-config-core-1.4.1.jar -lib/shiro-config-ogdl-1.4.1.jar -lib/shiro-core-1.4.1.jar -lib/shiro-crypto-cipher-1.4.1.jar -lib/shiro-crypto-core-1.4.1.jar -lib/shiro-crypto-hash-1.4.1.jar -lib/shiro-event-1.4.1.jar -lib/shiro-lang-1.4.1.jar +lib/shiro-cache-1.5.2.jar +lib/shiro-config-core-1.5.2.jar +lib/shiro-config-ogdl-1.5.2.jar +lib/shiro-core-1.5.2.jar +lib/shiro-crypto-cipher-1.5.2.jar +lib/shiro-crypto-core-1.5.2.jar +lib/shiro-crypto-hash-1.5.2.jar +lib/shiro-event-1.5.2.jar +lib/shiro-lang-1.5.2.jar lib/slf4j-api-1.7.28.jar lib/snappy-0.4.jar lib/spring-beans-5.2.1.RELEASE.jar diff --git a/geode-assembly/src/integrationTest/resources/dependency_classpath.txt b/geode-assembly/src/integrationTest/resources/dependency_classpath.txt index 95af982..f442a24 100644 --- a/geode-assembly/src/integrationTest/resources/dependency_classpath.txt +++ b/geode-assembly/src/integrationTest/resources/dependency_classpath.txt @@ -34,8 +34,8 @@ antlr-2.7.7.jar javax.activation-1.2.0.jar istack-commons-runtime-3.0.9.jar commons-validator-1.6.jar -shiro-core-1.4.1.jar -shiro-config-ogdl-1.4.1.jar +shiro-core-1.5.2.jar +shiro-config-ogdl-1.5.2.jar commons-beanutils-1.9.4.jar commons-collections-3.2.2.jar commons-io-2.6.jar @@ -56,13 +56,13 @@ jopt-simple-5.0.4.jar httpcore-4.4.12.jar snappy-0.4.jar jgroups-3.6.14.Final.jar -shiro-cache-1.4.1.jar -shiro-crypto-hash-1.4.1.jar -shiro-crypto-cipher-1.4.1.jar -shiro-config-core-1.4.1.jar -shiro-event-1.4.1.jar -shiro-crypto-core-1.4.1.jar -shiro-lang-1.4.1.jar +shiro-cache-1.5.2.jar +shiro-crypto-hash-1.5.2.jar +shiro-crypto-cipher-1.5.2.jar +shiro-config-core-1.5.2.jar +shiro-event-1.5.2.jar +shiro-crypto-core-1.5.2.jar +shiro-lang-1.5.2.jar slf4j-api-1.7.28.jar swagger-annotations-1.5.23.jar spring-core-5.2.1.RELEASE.jar
[geode] branch develop updated: GEODE-7917: change thrown exception type for SSL to IOException (#4858)
This is an automated email from the ASF dual-hosted git repository. mivanac pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/develop by this push: new 552cdea GEODE-7917: change thrown exception type for SSL to IOException (#4858) 552cdea is described below commit 552cdead5664c0b004094a136d9c419983ff38a9 Author: Mario Ivanac <48509724+miva...@users.noreply.github.com> AuthorDate: Mon Apr 6 20:38:28 2020 +0200 GEODE-7917: change thrown exception type for SSL to IOException (#4858) * GEODE-7917: Change exception type to IOException when caused by EOFException * GEODE-7917: added test * GEODE-7917: update after comments --- .../tcpserver/TCPClientSSLIntegrationTest.java | 49 ++ .../distributed/internal/tcpserver/TcpClient.java | 8 2 files changed, 57 insertions(+) diff --git a/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/tcpserver/TCPClientSSLIntegrationTest.java b/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/tcpserver/TCPClientSSLIntegrationTest.java index ece03ca..8ab0a8e 100644 --- a/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/tcpserver/TCPClientSSLIntegrationTest.java +++ b/geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/tcpserver/TCPClientSSLIntegrationTest.java @@ -18,8 +18,10 @@ import static org.apache.geode.security.SecurableCommunicationChannels.LOCATOR; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.Mockito.when; +import java.io.EOFException; import java.io.IOException; import java.net.InetAddress; import java.security.GeneralSecurityException; @@ -77,6 +79,25 @@ public class TCPClientSSLIntegrationTest { SocketCreatorFactory.close(); } + private void startServerWithCertificate() + throws GeneralSecurityException, IOException { + +CertificateMaterial serverCertificate = new CertificateBuilder() +.commonName("tcp-server") +.issuedBy(ca) +.sanDnsName(InetAddress.getLocalHost().getHostName()) +.generate(); + +CertStores serverStore = CertStores.locatorStore(); +serverStore.withCertificate("server", serverCertificate); +serverStore.trust("ca", ca); + +Properties serverProperties = serverStore +.propertiesWith(LOCATOR, true, true); + +startTcpServer(serverProperties); + } + private void startServerAndClient(CertificateMaterial serverCertificate, CertificateMaterial clientCertificate, boolean enableHostNameValidation) throws GeneralSecurityException, IOException { @@ -216,4 +237,32 @@ public class TCPClientSSLIntegrationTest { + localhost.getHostName() + " found."); } + @Test + public void clientFailsToConnectIfRemotePeerShutdowns() throws Exception, SSLHandshakeException { + +startServerWithCertificate(); + +SocketCreator socketCreator = Mockito.mock(SocketCreator.class); +ClusterSocketCreator ssc = Mockito.mock(ClusterSocketCreator.class); + +Exception eofexc = new EOFException("SSL peer shut down incorrectly"); +Exception sslexc = new SSLHandshakeException("Remote host terminated the handshake"); +sslexc.initCause(eofexc); + +when(socketCreator.forCluster()) +.thenReturn(ssc); +when(ssc.connect(any(), anyInt(), any(), any())) +.thenThrow(sslexc); + +client = new TcpClient(socketCreator, +InternalDataSerializer.getDSFIDSerializer().getObjectSerializer(), +InternalDataSerializer.getDSFIDSerializer().getObjectDeserializer(), +TcpSocketFactory.DEFAULT); + +assertThatExceptionOfType(IOException.class) +.isThrownBy(() -> client.requestToServer(new HostAndPort(localhost.getHostName(), port), +Boolean.valueOf(false), 5 * 1000)) +.withCauseInstanceOf(SSLHandshakeException.class) +.withStackTraceContaining("Remote host terminated the handshake"); + } } diff --git a/geode-tcp-server/src/main/java/org/apache/geode/distributed/internal/tcpserver/TcpClient.java b/geode-tcp-server/src/main/java/org/apache/geode/distributed/internal/tcpserver/TcpClient.java index 64cbb2f..b5e8d91 100644 --- a/geode-tcp-server/src/main/java/org/apache/geode/distributed/internal/tcpserver/TcpClient.java +++ b/geode-tcp-server/src/main/java/org/apache/geode/distributed/internal/tcpserver/TcpClient.java @@ -29,6 +29,7 @@ import java.util.function.LongSupplier; import java.util.function.Supplier; import javax.net.ssl.SSLException; +import javax.net.ssl.SSLHandshakeException; import org.apache.logging.log4j.Logger; @@ -255,6 +256,13 @@ public class TcpClient { try { sock = sock
[geode] branch feature/GEODE-7945 updated (94035a6 -> b8692b9)
This is an automated email from the ASF dual-hosted git repository. jchen21 pushed a change to branch feature/GEODE-7945 in repository https://gitbox.apache.org/repos/asf/geode.git. from 94035a6 Remove unnecessary import add b8692b9 Revert the removed synchronized block No new revisions were added by this update. Summary of changes: .../geode/internal/cache/GemFireCacheImpl.java | 68 +++--- 1 file changed, 34 insertions(+), 34 deletions(-)
[geode] branch feature/GEODE-7945 updated (91de61e -> 94035a6)
This is an automated email from the ASF dual-hosted git repository. jchen21 pushed a change to branch feature/GEODE-7945 in repository https://gitbox.apache.org/repos/asf/geode.git. from 91de61e Replace Map.get and remove with remove add 94035a6 Remove unnecessary import No new revisions were added by this update. Summary of changes: .../src/main/java/org/apache/geode/internal/cache/GemFireCacheImpl.java | 1 - 1 file changed, 1 deletion(-)
[geode] branch develop updated: GEODE-7892: Code improvements in ConnectionProxyJUnitTest
This is an automated email from the ASF dual-hosted git repository. bschuchardt pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/develop by this push: new 24203d8 GEODE-7892: Code improvements in ConnectionProxyJUnitTest new 087e47a Merge pull request #4827 from Nordix/feature/GEODE-7892 24203d8 is described below commit 24203d86f2cc99c686e042fd87d4359ad9389d56 Author: Alberto Bustamante Reyes AuthorDate: Wed Mar 4 13:14:31 2020 +0100 GEODE-7892: Code improvements in ConnectionProxyJUnitTest --- .../tier/sockets/ConnectionProxyJUnitTest.java | 97 ++ 1 file changed, 27 insertions(+), 70 deletions(-) diff --git a/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/tier/sockets/ConnectionProxyJUnitTest.java b/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/tier/sockets/ConnectionProxyJUnitTest.java index a731442..ecf87c4 100644 --- a/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/tier/sockets/ConnectionProxyJUnitTest.java +++ b/geode-core/src/integrationTest/java/org/apache/geode/internal/cache/tier/sockets/ConnectionProxyJUnitTest.java @@ -28,7 +28,9 @@ import static org.junit.Assert.fail; import java.util.Map; import java.util.Properties; +import java.util.concurrent.TimeUnit; +import org.awaitility.Duration; import org.junit.After; import org.junit.Before; import org.junit.Ignore; @@ -56,7 +58,6 @@ import org.apache.geode.internal.cache.EntryEventImpl; import org.apache.geode.internal.cache.EventID; import org.apache.geode.internal.cache.ha.ThreadIdentifier; import org.apache.geode.test.awaitility.GeodeAwaitility; -import org.apache.geode.test.dunit.WaitCriterion; import org.apache.geode.test.junit.categories.ClientSubscriptionTest; /** @@ -78,6 +79,9 @@ public class ConnectionProxyJUnitTest { SequenceIdAndExpirationObject seo = null; + final Duration timeoutToVerifyExpiry = new Duration(30, TimeUnit.SECONDS); + final Duration timeoutToVerifyAckSend = new Duration(30, TimeUnit.SECONDS); + @Before public void setUp() throws Exception { @@ -239,18 +243,9 @@ public class ConnectionProxyJUnitTest { e.printStackTrace(); fail("Failed to create server"); } - WaitCriterion ev = new WaitCriterion() { -@Override -public boolean done() { - return proxy.getConnectedServerCount() == 1; -} - -@Override -public String description() { - return null; -} - }; - GeodeAwaitility.await().untilAsserted(ev); + GeodeAwaitility.await().untilAsserted(() -> { +assertEquals(1, proxy.getConnectedServerCount()); + }); } finally { if (server != null) { server.stop(); @@ -297,18 +292,9 @@ public class ConnectionProxyJUnitTest { e.printStackTrace(); fail("Failed to create server"); } - WaitCriterion ev = new WaitCriterion() { -@Override -public boolean done() { - return proxy.getConnectedServerCount() == 1; -} - -@Override -public String description() { - return null; -} - }; - GeodeAwaitility.await().untilAsserted(ev); + GeodeAwaitility.await().untilAsserted(() -> { +assertEquals(1, proxy.getConnectedServerCount()); + }); } finally { if (server != null) { server.stop(); @@ -383,7 +369,7 @@ public class ConnectionProxyJUnitTest { fail(" eid should not be duplicate as it is a new entry"); } -verifyExpiry(60 * 1000); +verifyExpiry(); if (proxy.verifyIfDuplicate(eid)) { fail(" eid should not be duplicate as the previous entry should have expired "); @@ -429,18 +415,7 @@ public class ConnectionProxyJUnitTest { fail(" eid should not be duplicate as it is a new entry"); } -WaitCriterion ev = new WaitCriterion() { - @Override - public boolean done() { -return proxy.verifyIfDuplicate(eid); - } - - @Override - public String description() { -return null; - } -}; -GeodeAwaitility.await().untilAsserted(ev); +GeodeAwaitility.await().untilAsserted(() -> assertTrue(proxy.verifyIfDuplicate(eid))); } catch (Exception ex) { ex.printStackTrace(); fail("Failed to initialize client"); @@ -483,7 +458,7 @@ public class ConnectionProxyJUnitTest { fail(" eid can never be duplicate, it is being created for the first time! "); } } -verifyExpiry(30 * 1000); +verifyExpiry(); for (int i = 0; i < EVENT_ID_COUNT; i++) { if (proxy.verifyIfDuplicate(eid[i])) { @@ -697,7 +672,7 @@ public class ConnectionProxyJUnitTest { // should send the ack to server
[geode] branch develop updated: GEODE-7098: Tomcat8SessionsClientServerDUnitTest Tests were getting bind failures (#4903)
This is an automated email from the ASF dual-hosted git repository. mhanson pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/geode.git The following commit(s) were added to refs/heads/develop by this push: new abd0f54 GEODE-7098: Tomcat8SessionsClientServerDUnitTest Tests were getting bind failures (#4903) abd0f54 is described below commit abd0f54dd280b64473a4ef36149d31de4a74da1d Author: mhansonp AuthorDate: Mon Apr 6 09:22:38 2020 -0700 GEODE-7098: Tomcat8SessionsClientServerDUnitTest Tests were getting bind failures (#4903) * GEODE-7098: Tests were getting bind failures using SocketUtils.getAvailableTCPPort - Moved tests to use AvailablePortHelper class - Added Sanity check to setup - Rename testSanity call to basicConnectivityCheck - Inline testSanity Co-authored-by: Mark Hanson --- .../modules/session/TestSessionsTomcat8Base.java | 23 +- .../Tomcat8SessionsClientServerDUnitTest.java | 52 ++ .../modules/session/Tomcat8SessionsDUnitTest.java | 5 ++- 3 files changed, 59 insertions(+), 21 deletions(-) diff --git a/extensions/geode-modules-tomcat8/src/distributedTest/java/org/apache/geode/modules/session/TestSessionsTomcat8Base.java b/extensions/geode-modules-tomcat8/src/distributedTest/java/org/apache/geode/modules/session/TestSessionsTomcat8Base.java index eedd635..e7cec09 100644 --- a/extensions/geode-modules-tomcat8/src/distributedTest/java/org/apache/geode/modules/session/TestSessionsTomcat8Base.java +++ b/extensions/geode-modules-tomcat8/src/distributedTest/java/org/apache/geode/modules/session/TestSessionsTomcat8Base.java @@ -27,13 +27,14 @@ import com.meterware.httpunit.WebConversation; import com.meterware.httpunit.WebRequest; import com.meterware.httpunit.WebResponse; import org.apache.catalina.core.StandardWrapper; +import org.apache.logging.log4j.Logger; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; import org.apache.geode.cache.Region; +import org.apache.geode.logging.internal.log4j.api.LogService; import org.apache.geode.modules.session.catalina.DeltaSessionManager; -import org.apache.geode.test.dunit.VM; import org.apache.geode.test.dunit.rules.CacheRule; import org.apache.geode.test.dunit.rules.DistributedRule; @@ -44,26 +45,26 @@ public abstract class TestSessionsTomcat8Base implements Serializable { @Rule public CacheRule cacheRule = new CacheRule(); + protected Logger logger = LogService.getLogger(); - VM vm0; int port; EmbeddedTomcat8 server; StandardWrapper servlet; Region region; DeltaSessionManager sessionManager; - /** - * Check that the basics are working - */ - @Test - public void testSanity() throws Exception { + public void basicConnectivityCheck() throws Exception { WebConversation wc = new WebConversation(); +assertThat(wc).describedAs("WebConversation was").isNotNull(); +logger.debug("Sending request to http://localhost:{}/test";, port); WebRequest req = new GetMethodWebRequest(String.format("http://localhost:%d/test";, port)); +assertThat(req).describedAs("WebRequest was").isNotNull(); req.setParameter("cmd", QueryCommand.GET.name()); req.setParameter("param", "null"); - WebResponse response = wc.getResponse(req); -assertThat(response.getNewCookieNames()[0]).isEqualTo("JSESSIONID"); +assertThat(response).describedAs("WebResponse was").isNotNull(); +assertThat(response.getNewCookieNames()[0]).describedAs("SessionID was") +.isEqualTo("JSESSIONID"); } /** @@ -356,7 +357,7 @@ public abstract class TestSessionsTomcat8Base implements Serializable { assertThat(region.get(sessionId).getAttribute(key)).isEqualTo("999"); } - /* + /** * Test for issue #38 CommitSessionValve throws exception on invalidated sessions */ @Test @@ -399,7 +400,7 @@ public abstract class TestSessionsTomcat8Base implements Serializable { WebResponse response = wc.getResponse(req); assertThat(response.getText()).isEqualTo("done"); -assertThat(region.size()).as("The region should be empty").isEqualTo(0); +assertThat(region.size()).as("The region should contain one entry").isEqualTo(1); } /** diff --git a/extensions/geode-modules-tomcat8/src/distributedTest/java/org/apache/geode/modules/session/Tomcat8SessionsClientServerDUnitTest.java b/extensions/geode-modules-tomcat8/src/distributedTest/java/org/apache/geode/modules/session/Tomcat8SessionsClientServerDUnitTest.java index 683ae5c..276a4c2 100644 --- a/extensions/geode-modules-tomcat8/src/distributedTest/java/org/apache/geode/modules/session/Tomcat8SessionsClientServerDUnitTest.java +++ b/extensions/geode-modules-tomcat8/src/distributedTest/java/org/apache/geode/modules/session/Tomcat8SessionsClientServerDUnitTest.java @@ -16,17 +16,20 @@ package org.apache.geode.modules.session; import static org.apache.geode.distributed.Co