You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by gr...@apache.org on 2015/03/19 23:20:19 UTC

[29/50] [abbrv] incubator-usergrid git commit: Fixes bug with delete marking and incorrect return value

Fixes bug with delete marking and incorrect return value


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/4ee788d4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/4ee788d4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/4ee788d4

Branch: refs/heads/USERGRID-493
Commit: 4ee788d4db58899ab68778ad97586a26dbe753ef
Parents: cf32557
Author: Todd Nine <tn...@apigee.com>
Authored: Thu Mar 5 03:43:04 2015 -0700
Committer: Todd Nine <tn...@apigee.com>
Committed: Thu Mar 5 03:43:04 2015 -0700

----------------------------------------------------------------------
 .../serialization/impl/MvccEntitySerializationStrategyV2Impl.java | 2 +-
 .../serialization/impl/MvccEntitySerializationStrategyV3Impl.java | 2 +-
 .../impl/MvccEntitySerializationStrategyImplTest.java             | 3 ++-
 3 files changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/4ee788d4/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV2Impl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV2Impl.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV2Impl.java
index ed97e80..f679185 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV2Impl.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV2Impl.java
@@ -217,7 +217,7 @@ public class MvccEntitySerializationStrategyV2Impl extends MvccEntitySerializati
             // it's been deleted, remove it
 
             if ( STATE_DELETED == state ) {
-                return new EntityWrapper( MvccEntity.Status.COMPLETE, Optional.<Entity>absent() );
+                return new EntityWrapper( MvccEntity.Status.DELETED, Optional.<Entity>absent() );
             }
 
             Entity storedEntity;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/4ee788d4/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV3Impl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV3Impl.java b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV3Impl.java
index ba58ee2..6ad18bb 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV3Impl.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV3Impl.java
@@ -583,7 +583,7 @@ public class MvccEntitySerializationStrategyV3Impl implements MvccEntitySerializ
             // it's been deleted, remove it
 
             if ( STATE_DELETED == state ) {
-                return new EntityWrapper( MvccEntity.Status.COMPLETE, entityVersion, Optional.<Entity>absent() );
+                return new EntityWrapper( MvccEntity.Status.DELETED, entityVersion, Optional.<Entity>absent() );
             }
 
             EntityMap storedEntity;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/4ee788d4/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImplTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImplTest.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImplTest.java
index f76230d..3c89b31 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImplTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyImplTest.java
@@ -251,6 +251,7 @@ public abstract class MvccEntitySerializationStrategyImplTest {
         assertEquals( entityId, returned.getId() );
         assertEquals( version, returned.getVersion() );
         assertFalse( returned.getEntity().isPresent() );
+        assertEquals( MvccEntity.Status.DELETED, returned.getStatus());
 
         //now delete it
         serializationStrategy.delete( context, entityId, version ).execute();
@@ -395,7 +396,7 @@ public abstract class MvccEntitySerializationStrategyImplTest {
 
         final Optional<Entity> empty = Optional.absent();
 
-        MvccEntity clearedV3 = new MvccEntityImpl( id, version3, MvccEntity.Status.COMPLETE, empty );
+        MvccEntity clearedV3 = new MvccEntityImpl( id, version3, MvccEntity.Status.DELETED, empty );
 
         MvccEntity returnedV3 =
             serializationStrategy.load( context, Collections.singleton( id ), version3 ).getEntity( id );