usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject [25/52] [abbrv] git commit: Fixed obscelete tests
Date Wed, 03 Sep 2014 22:11:20 GMT
Fixed obscelete tests


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

Branch: refs/heads/two-dot-o-push-notifications
Commit: b1c70510b2ae2ef10236177772e334c6e23e1a80
Parents: 70b6739
Author: Todd Nine <toddnine@apache.org>
Authored: Fri Aug 29 11:30:56 2014 -0600
Committer: Todd Nine <toddnine@apache.org>
Committed: Fri Aug 29 11:30:56 2014 -0600

----------------------------------------------------------------------
 .../collection/mvcc/entity/impl/MvccLogEntryImpl.java |  3 ++-
 .../collection/mvcc/stage/delete/MarkStartTest.java   |  3 +++
 .../collection/mvcc/stage/load/LoadTest.java          |  7 +++++++
 .../collection/util/InvalidIdGenerator.java           | 14 --------------
 4 files changed, 12 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b1c70510/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/impl/MvccLogEntryImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/impl/MvccLogEntryImpl.java
b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/impl/MvccLogEntryImpl.java
index 574a461..a50eeac 100644
--- a/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/impl/MvccLogEntryImpl.java
+++ b/stack/corepersistence/collection/src/main/java/org/apache/usergrid/persistence/collection/mvcc/entity/impl/MvccLogEntryImpl.java
@@ -23,6 +23,7 @@ import java.util.UUID;
 
 import org.apache.usergrid.persistence.collection.mvcc.entity.MvccLogEntry;
 import org.apache.usergrid.persistence.collection.mvcc.entity.Stage;
+import org.apache.usergrid.persistence.core.util.ValidationUtils;
 import org.apache.usergrid.persistence.model.entity.Id;
 
 import com.google.common.base.Preconditions;
@@ -43,7 +44,7 @@ public class MvccLogEntryImpl implements MvccLogEntry {
 
     public MvccLogEntryImpl( final Id entityId, final UUID version, final Stage stage, final
State state ) {
         Preconditions.checkNotNull( entityId, "entity id is required" );
-        Preconditions.checkNotNull( version, "version id is required" );
+        ValidationUtils.verifyTimeUuid( version, "version" );
         Preconditions.checkNotNull( stage, "entity  is required" );
         Preconditions.checkNotNull( state, "state  is required" );
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b1c70510/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/delete/MarkStartTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/delete/MarkStartTest.java
b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/delete/MarkStartTest.java
index ed870a3..1b04022 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/delete/MarkStartTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/delete/MarkStartTest.java
@@ -92,6 +92,9 @@ public class MarkStartTest extends AbstractIdStageTest {
 
         UUIDService uuidService = mock( UUIDService.class );
 
+        //generate the random uuid, not a time uuid, should fail tests
+        when(uuidService.newTimeUUID()).thenReturn( UUID.randomUUID() );
+
         new MarkStart( logStrategy, uuidService ).call( event );
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b1c70510/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/load/LoadTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/load/LoadTest.java
b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/load/LoadTest.java
index cb5dd64..3643bd1 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/load/LoadTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/load/LoadTest.java
@@ -347,6 +347,13 @@ public class LoadTest  extends AbstractIdStageTest {
     @Override
     protected void validateStage( final CollectionIoEvent<Id> event ) {
         final UUIDService uuidService = mock(UUIDService.class);
+
+        /**
+         * Mock up wrong UUID type
+         */
+        when(uuidService.newTimeUUID()).thenReturn( UUID.randomUUID() );
+
+
         final MvccEntitySerializationStrategy serializationStrategy = mock(MvccEntitySerializationStrategy.class);
 
         new Load(uuidService, serializationStrategy).call( event );

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/b1c70510/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/util/InvalidIdGenerator.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/util/InvalidIdGenerator.java
b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/util/InvalidIdGenerator.java
index 98c382c..fec72e9 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/util/InvalidIdGenerator.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/util/InvalidIdGenerator.java
@@ -110,25 +110,11 @@ public class InvalidIdGenerator {
         public List<PotentialAssignment> getValueSources( final ParameterSignature
sig ) {
 
             final List<PotentialAssignment> result = new ArrayList<PotentialAssignment>();
-            result.add( PotentialAssignment.forValue( "wrongEntityUuidType", wrongEntityUuidType()
) );
             result.add( PotentialAssignment.forValue( "wrongEntityTypeLength", wrongEntityTypeLength()
) );
 
             return result;
         }
 
-        /**
-         * Incorrect fields
-         */
-        private static Id wrongEntityUuidType() {
-
-            final Id entityId = mock( Id.class );
-
-            //set this to a non time uuid
-            when( entityId.getUuid() ).thenReturn( UUID.randomUUID() );
-            when( entityId.getType() ).thenReturn( "test" );
-
-            return entityId;
-        }
 
         private static Id wrongEntityTypeLength() {
 


Mime
View raw message