polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nic...@apache.org
Subject [12/35] polygene-java git commit: POLYGENE-256 - Fixed clear() method in Cassandra many/named associations (and some edge-case for properties and associations).
Date Sun, 28 May 2017 16:10:32 GMT
POLYGENE-256 - Fixed clear() method in Cassandra many/named associations (and some edge-case
for properties and associations).

Signed-off-by: niclas <niclas@hedhman.org>


Project: http://git-wip-us.apache.org/repos/asf/polygene-java/repo
Commit: http://git-wip-us.apache.org/repos/asf/polygene-java/commit/5e925a57
Tree: http://git-wip-us.apache.org/repos/asf/polygene-java/tree/5e925a57
Diff: http://git-wip-us.apache.org/repos/asf/polygene-java/diff/5e925a57

Branch: refs/heads/develop
Commit: 5e925a57fcf90d9516cbad5d2de987100942fb70
Parents: 51a0c08
Author: niclas <niclas@hedhman.org>
Authored: Tue May 23 08:48:41 2017 +0800
Committer: niclas <niclas@hedhman.org>
Committed: Tue May 23 08:48:41 2017 +0800

----------------------------------------------------------------------
 .../entitystore/cassandra/CassandraEntityStoreMixin.java  |  9 ++++-----
 .../entitystore/cassandra/CassandraEntityStoreTest.java   | 10 ----------
 2 files changed, 4 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/polygene-java/blob/5e925a57/extensions/entitystore-cassandra/src/main/java/org/apache/polygene/entitystore/cassandra/CassandraEntityStoreMixin.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-cassandra/src/main/java/org/apache/polygene/entitystore/cassandra/CassandraEntityStoreMixin.java
b/extensions/entitystore-cassandra/src/main/java/org/apache/polygene/entitystore/cassandra/CassandraEntityStoreMixin.java
index 80b638a..be0d226 100644
--- a/extensions/entitystore-cassandra/src/main/java/org/apache/polygene/entitystore/cassandra/CassandraEntityStoreMixin.java
+++ b/extensions/entitystore-cassandra/src/main/java/org/apache/polygene/entitystore/cassandra/CassandraEntityStoreMixin.java
@@ -171,7 +171,7 @@ public class CassandraEntityStoreMixin
                     try
                     {
                         storedValue = storedProperties.get( propertyDescriptor.qualifiedName().name()
);
-                        if( storedValue == null )
+                        if( storedValue == null || storedValue.isEmpty() )
                         {
                             properties.remove( propertyDescriptor.qualifiedName() );
                         }
@@ -200,7 +200,7 @@ public class CassandraEntityStoreMixin
                     try
                     {
                         String storedValue = storedAssociations.get( associationType.qualifiedName().name()
);
-                        EntityReference value = storedValue == null
+                        EntityReference value = storedValue == null || storedValue.isEmpty()
                                                 ? null
                                                 : EntityReference.parseEntityReference( storedValue
);
                         associations.put( associationType.qualifiedName(), value );
@@ -224,7 +224,7 @@ public class CassandraEntityStoreMixin
                     try
                     {
                         String storedValue = storedManyassociation.get( manyAssociationType.qualifiedName().name()
);
-                        if( storedValue != null )
+                        if( storedValue != null && !storedValue.isEmpty() )
                         {
                             String[] refs = storedValue.split( "," );
                             for( String value : refs )
@@ -253,7 +253,7 @@ public class CassandraEntityStoreMixin
                     try
                     {
                         String storedValues = storedNamedassociation.get( namedAssociationType.qualifiedName().name()
);
-                        if( storedValues != null )
+                        if( storedValues != null && !storedValues.isEmpty() )
                         {
                             @SuppressWarnings( "unchecked" )
                             Map<String, String> namedRefs = new ObjectMapper().readValue(
storedValues, Map.class );
@@ -345,7 +345,6 @@ public class CassandraEntityStoreMixin
                                 many,
                                 named );
                             ResultSet result = cluster.cassandraClientSession().execute(
statement );
-                            System.out.println( result );
                         } );
                 String ids = stream( state.spliterator(), false )
                     .filter( entity -> entity.status() == EntityStatus.REMOVED )

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/5e925a57/extensions/entitystore-cassandra/src/test/java/org/apache/polygene/entitystore/cassandra/CassandraEntityStoreTest.java
----------------------------------------------------------------------
diff --git a/extensions/entitystore-cassandra/src/test/java/org/apache/polygene/entitystore/cassandra/CassandraEntityStoreTest.java
b/extensions/entitystore-cassandra/src/test/java/org/apache/polygene/entitystore/cassandra/CassandraEntityStoreTest.java
index bead8cb..ca5b946 100644
--- a/extensions/entitystore-cassandra/src/test/java/org/apache/polygene/entitystore/cassandra/CassandraEntityStoreTest.java
+++ b/extensions/entitystore-cassandra/src/test/java/org/apache/polygene/entitystore/cassandra/CassandraEntityStoreTest.java
@@ -28,8 +28,6 @@ import org.apache.polygene.test.entity.AbstractEntityStoreTest;
 import org.apache.polygene.test.entity.CanRemoveAll;
 import org.apache.polygene.test.internal.DockerRule;
 import org.junit.ClassRule;
-import org.junit.Ignore;
-import org.junit.Test;
 
 /**
  * Test the CassandraEntityStoreService.
@@ -82,12 +80,4 @@ public class CassandraEntityStoreTest
         cleaner.removeAll();
         super.tearDown();
     }
-
-    @Ignore( "POLYGENE-256" )
-    @Test
-    @Override
-    public void givenAssociationsModifiedWhenUnitOfWorkCompletesThenStoreState()
-    {
-        super.givenAssociationsModifiedWhenUnitOfWorkCompletesThenStoreState();
-    }
 }


Mime
View raw message