You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by ds...@apache.org on 2017/10/30 23:44:29 UTC

[geode] branch feature/GEODE-3781 updated: test no longer configures cache to not deserialize pdx

This is an automated email from the ASF dual-hosted git repository.

dschneider pushed a commit to branch feature/GEODE-3781
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/feature/GEODE-3781 by this push:
     new 62c9803  test no longer configures cache to not deserialize pdx
62c9803 is described below

commit 62c9803e82f3d1e96077b9f67e7087318db8b148
Author: Darrel Schneider <ds...@pivotal.io>
AuthorDate: Mon Oct 30 16:43:48 2017 -0700

    test no longer configures cache to not deserialize pdx
---
 .../jdbc/JDBCAsyncWriterIntegrationTest.java       | 27 ++++++++++++++++++----
 1 file changed, 23 insertions(+), 4 deletions(-)

diff --git a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JDBCAsyncWriterIntegrationTest.java b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JDBCAsyncWriterIntegrationTest.java
index 87b654b..994cbb5 100644
--- a/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JDBCAsyncWriterIntegrationTest.java
+++ b/geode-connectors/src/test/java/org/apache/geode/connectors/jdbc/JDBCAsyncWriterIntegrationTest.java
@@ -31,6 +31,7 @@ import org.apache.geode.cache.RegionShortcut;
 import org.apache.geode.connectors.jdbc.JDBCAsyncWriter;
 import org.apache.geode.internal.cache.GemFireCacheImpl;
 import org.apache.geode.pdx.PdxInstance;
+import org.apache.geode.pdx.PdxSerializationException;
 import org.apache.geode.test.junit.categories.IntegrationTest;
 import org.awaitility.Awaitility;
 
@@ -61,7 +62,7 @@ public class JDBCAsyncWriterIntegrationTest {
       // ignore
     }
     if (null == cache) {
-      cache = (GemFireCacheImpl) new CacheFactory().setPdxReadSerialized(true).set(MCAST_PORT, "0")
+      cache = (GemFireCacheImpl) new CacheFactory().setPdxReadSerialized(false).set(MCAST_PORT, "0")
           .create();
     }
     setupDB();
@@ -195,7 +196,13 @@ public class JDBCAsyncWriterIntegrationTest {
     Awaitility.await().atMost(30, TimeUnit.SECONDS)
         .until(() -> assertThat(jdbcWriter.getSuccessfulEvents()).isEqualTo(2));
 
-    employees.destroy("1");
+    try {
+      employees.destroy("1");
+    } catch (PdxSerializationException ignore) {
+      // destroy tries to deserialize old value
+      // which does not work because our PdxInstance
+      // does not have a real class
+    }
 
     Awaitility.await().atMost(30, TimeUnit.SECONDS)
         .until(() -> assertThat(jdbcWriter.getSuccessfulEvents()).isEqualTo(3));
@@ -220,7 +227,13 @@ public class JDBCAsyncWriterIntegrationTest {
 
     PdxInstance pdx3 = cache.createPdxInstanceFactory("Employee").writeString("name", "Emp1")
         .writeInt("age", 72).create();
-    employees.put("1", pdx3);
+    try {
+      employees.put("1", pdx3);
+    } catch (PdxSerializationException ignore) {
+      // put tries to deserialize old value
+      // which does not work because our PdxInstance
+      // does not have a real class
+    }
 
     Awaitility.await().atMost(30, TimeUnit.SECONDS)
         .until(() -> assertThat(jdbcWriter.getSuccessfulEvents()).isEqualTo(2));
@@ -246,7 +259,13 @@ public class JDBCAsyncWriterIntegrationTest {
 
     PdxInstance pdx3 = cache.createPdxInstanceFactory("Employee").writeString("name", "Emp1")
         .writeInt("age", 72).create();
-    employees.put("1", pdx3);
+    try {
+      employees.put("1", pdx3);
+    } catch (PdxSerializationException ignore) {
+      // put tries to deserialize old value
+      // which does not work because our PdxInstance
+      // does not have a real class
+    }
 
     Awaitility.await().atMost(10, TimeUnit.SECONDS)
         .until(() -> assertThat(jdbcWriter.getSuccessfulEvents()).isEqualTo(2));

-- 
To stop receiving notification emails like this one, please contact
['"commits@geode.apache.org" <co...@geode.apache.org>'].