geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dschnei...@apache.org
Subject [geode] branch feature/GEODE-6272 updated: added unit test for fields in different order
Date Mon, 14 Jan 2019 22:51:47 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/feature/GEODE-6272 by this push:
     new f64605b  added unit test for fields in different order
f64605b is described below

commit f64605ba0d165a172b357d368850e05fa7a754de
Author: Darrel Schneider <dschneider@pivotal.io>
AuthorDate: Mon Jan 14 14:51:12 2019 -0800

    added unit test for fields in different order
---
 .../org/apache/geode/pdx/PdxInstanceFactoryJUnitTest.java  | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/geode-core/src/integrationTest/java/org/apache/geode/pdx/PdxInstanceFactoryJUnitTest.java
b/geode-core/src/integrationTest/java/org/apache/geode/pdx/PdxInstanceFactoryJUnitTest.java
index 07f1874..51be526 100644
--- a/geode-core/src/integrationTest/java/org/apache/geode/pdx/PdxInstanceFactoryJUnitTest.java
+++ b/geode-core/src/integrationTest/java/org/apache/geode/pdx/PdxInstanceFactoryJUnitTest.java
@@ -1298,6 +1298,20 @@ public class PdxInstanceFactoryJUnitTest {
   }
 
   @Test
+  public void stablePdxInstanceWithMultipleEqualFieldsInDifferentOrderAreEqual() {
+    PdxInstanceFactory factory = cache.createStablePdxInstanceFactory("myPdxInstanceType");
+    factory.writeString("fieldOne", "valueOne");
+    factory.writeString("fieldTwo", "valueTwo");
+    PdxInstance instance = factory.create();
+    factory = cache.createStablePdxInstanceFactory("myPdxInstanceType");
+    factory.writeString("fieldTwo", "valueTwo");
+    factory.writeString("fieldOne", "valueOne");
+    PdxInstance instance2 = factory.create();
+
+    assertThat(instance).isEqualTo(instance2);
+  }
+
+  @Test
   public void normalPdxInstanceAddedToRegionWithPdxReadSerializedFalseAndABadClassThrowsClassNotFoundWhenRegionGet()
{
     // make sure the cache has pdx-read-serialized set to false
     this.cache.close();


Mime
View raw message