usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sfeld...@apache.org
Subject [04/25] incubator-usergrid git commit: Finished migrating tests to new framework. Need to validate keyspace name.
Date Wed, 01 Apr 2015 20:44:39 GMT
http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/6bf2d3d2/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerifyIT.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerifyIT.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerifyIT.java
index 8e14c4f..9d0cd20 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerifyIT.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerifyIT.java
@@ -18,28 +18,31 @@
 package org.apache.usergrid.persistence.collection.mvcc.stage.write;
 
 
-import com.google.inject.Inject;
-import org.apache.usergrid.persistence.collection.CollectionScope;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
 import org.apache.usergrid.persistence.collection.EntityCollectionManager;
 import org.apache.usergrid.persistence.collection.EntityCollectionManagerFactory;
 import org.apache.usergrid.persistence.collection.exception.WriteUniqueVerifyException;
-import org.apache.usergrid.persistence.core.guice.MigrationManagerRule;
 import org.apache.usergrid.persistence.collection.guice.TestCollectionModule;
-import org.apache.usergrid.persistence.collection.impl.CollectionScopeImpl;
 import org.apache.usergrid.persistence.collection.mvcc.stage.TestEntityGenerator;
 import org.apache.usergrid.persistence.collection.serialization.SerializationFig;
+import org.apache.usergrid.persistence.core.guice.MigrationManagerRule;
+import org.apache.usergrid.persistence.core.scope.ApplicationScope;
+import org.apache.usergrid.persistence.core.scope.ApplicationScopeImpl;
 import org.apache.usergrid.persistence.core.test.ITRunner;
+import org.apache.usergrid.persistence.core.test.UseModules;
 import org.apache.usergrid.persistence.model.entity.Entity;
 import org.apache.usergrid.persistence.model.entity.Id;
 import org.apache.usergrid.persistence.model.entity.SimpleId;
 import org.apache.usergrid.persistence.model.field.IntegerField;
 import org.apache.usergrid.persistence.model.field.StringField;
-import org.apache.usergrid.persistence.core.test.UseModules;
+
+import com.google.inject.Inject;
+
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.fail;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.runner.RunWith;
 
 
 /**
@@ -49,7 +52,7 @@ import org.junit.runner.RunWith;
 @UseModules( TestCollectionModule.class )
 public class WriteUniqueVerifyIT {
 
-    @Inject 
+    @Inject
     SerializationFig serializationFig;
 
     @Inject
@@ -62,10 +65,9 @@ public class WriteUniqueVerifyIT {
     @Test
     public void testConflict() {
 
-        final Id orgId = new SimpleId("WriteUniqueVerifyIT");
         final Id appId = new SimpleId("testConflict");
 
-        final CollectionScope scope = new CollectionScopeImpl( appId, orgId, "fastcars" );
+        final ApplicationScope scope = new ApplicationScopeImpl( appId );
         final EntityCollectionManager entityManager = cmf.createCollectionManager( scope );
 
         final Entity entity = TestEntityGenerator.generateEntity();
@@ -78,8 +80,8 @@ public class WriteUniqueVerifyIT {
         entityFetched.setField( new StringField("foo", "bar"));
 
         // wait for temporary unique value records to time out
-        try { 
-            Thread.sleep(serializationFig.getTimeout() * 1100); 
+        try {
+            Thread.sleep(serializationFig.getTimeout() * 1100);
         } catch (InterruptedException ignored) { }
 
         // another enity that tries to use two unique values already taken by first
@@ -107,10 +109,9 @@ public class WriteUniqueVerifyIT {
     @Test
     public void testNoConflict1() {
 
-        final Id orgId = new SimpleId("WriteUniqueVerifyIT");
         final Id appId = new SimpleId("testNoConflict");
 
-        final CollectionScope scope = new CollectionScopeImpl( appId, orgId, "fastcars" );
+        final ApplicationScope scope = new ApplicationScopeImpl( appId);
         final EntityCollectionManager entityManager = cmf.createCollectionManager( scope );
 
         final Entity entity = TestEntityGenerator.generateEntity();
@@ -127,10 +128,9 @@ public class WriteUniqueVerifyIT {
     @Test
     public void testNoConflict2() {
 
-        final Id orgId = new SimpleId("WriteUniqueVerifyIT");
         final Id appId = new SimpleId("testNoConflict");
 
-        final CollectionScope scope = new CollectionScopeImpl( appId, orgId, "fastcars" );
+        final ApplicationScope scope = new ApplicationScopeImpl( appId );
         final EntityCollectionManager entityManager = cmf.createCollectionManager( scope );
 
         final Entity entity = TestEntityGenerator.generateEntity();

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/6bf2d3d2/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerifyTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerifyTest.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerifyTest.java
index 51cb198..b9a1565 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerifyTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/mvcc/stage/write/WriteUniqueVerifyTest.java
@@ -18,20 +18,20 @@
 package org.apache.usergrid.persistence.collection.mvcc.stage.write;
 
 
-import org.apache.usergrid.persistence.core.astyanax.CassandraConfig;
-import org.apache.usergrid.persistence.core.test.UseModules;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-import org.apache.usergrid.persistence.collection.CollectionScope;
-import org.apache.usergrid.persistence.core.guice.MigrationManagerRule;
-import org.apache.usergrid.persistence.collection.guice.TestCollectionModule;
 import org.apache.usergrid.persistence.collection.MvccEntity;
+import org.apache.usergrid.persistence.collection.guice.TestCollectionModule;
 import org.apache.usergrid.persistence.collection.mvcc.stage.CollectionIoEvent;
 import org.apache.usergrid.persistence.collection.serialization.SerializationFig;
 import org.apache.usergrid.persistence.collection.serialization.UniqueValueSerializationStrategy;
+import org.apache.usergrid.persistence.core.astyanax.CassandraConfig;
+import org.apache.usergrid.persistence.core.guice.MigrationManagerRule;
+import org.apache.usergrid.persistence.core.scope.ApplicationScope;
 import org.apache.usergrid.persistence.core.test.ITRunner;
+import org.apache.usergrid.persistence.core.test.UseModules;
 import org.apache.usergrid.persistence.model.entity.Entity;
 
 import com.google.inject.Inject;
@@ -41,7 +41,6 @@ import com.netflix.astyanax.connectionpool.exceptions.ConnectionException;
 
 import static org.apache.usergrid.persistence.collection.mvcc.stage.TestEntityGenerator.fromEntity;
 import static org.apache.usergrid.persistence.collection.mvcc.stage.TestEntityGenerator.generateEntity;
-import static org.junit.Assert.assertSame;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.never;
 import static org.mockito.Mockito.verify;
@@ -71,7 +70,7 @@ public class WriteUniqueVerifyTest {
 
     @Test
     public void testNoFields() throws ConnectionException {
-        final CollectionScope collectionScope = mock( CollectionScope.class );
+        final ApplicationScope collectionScope = mock( ApplicationScope.class );
         final Keyspace keyspace = mock(Keyspace.class);
         final MutationBatch batch = mock(MutationBatch.class);
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/6bf2d3d2/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/LogEntryIteratorTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/LogEntryIteratorTest.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/LogEntryIteratorTest.java
index 8a62505..720e602 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/LogEntryIteratorTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/LogEntryIteratorTest.java
@@ -7,12 +7,12 @@ import java.util.UUID;
 
 import org.junit.Test;
 
-import org.apache.usergrid.persistence.collection.CollectionScope;
-import org.apache.usergrid.persistence.collection.impl.CollectionScopeImpl;
-import org.apache.usergrid.persistence.collection.serialization.MvccLogEntrySerializationStrategy;
 import org.apache.usergrid.persistence.collection.MvccLogEntry;
+import org.apache.usergrid.persistence.collection.serialization.MvccLogEntrySerializationStrategy;
 import org.apache.usergrid.persistence.collection.util.LogEntryMock;
 import org.apache.usergrid.persistence.collection.util.VersionGenerator;
+import org.apache.usergrid.persistence.core.scope.ApplicationScope;
+import org.apache.usergrid.persistence.core.scope.ApplicationScopeImpl;
 import org.apache.usergrid.persistence.model.entity.Id;
 import org.apache.usergrid.persistence.model.entity.SimpleId;
 import org.apache.usergrid.persistence.model.util.UUIDGenerator;
@@ -38,8 +38,8 @@ public class LogEntryIteratorTest {
         final MvccLogEntrySerializationStrategy logEntrySerializationStrategy =
                 mock( MvccLogEntrySerializationStrategy.class );
 
-        final CollectionScope scope =
-                new CollectionScopeImpl( new SimpleId( "application" ), new SimpleId( "owner" ), "entities" );
+        final ApplicationScope scope =
+                new ApplicationScopeImpl( new SimpleId( "application" ));
 
         final Id entityId = new SimpleId( "entity" );
 
@@ -95,8 +95,8 @@ public class LogEntryIteratorTest {
         final MvccLogEntrySerializationStrategy logEntrySerializationStrategy =
                 mock( MvccLogEntrySerializationStrategy.class );
 
-        final CollectionScope scope =
-                new CollectionScopeImpl( new SimpleId( "application" ), new SimpleId( "owner" ), "entities" );
+        final ApplicationScope scope =
+                new ApplicationScopeImpl( new SimpleId( "application" ) );
 
         final Id entityId = new SimpleId( "entity" );
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/6bf2d3d2/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 07a4b1b..11575c7 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
@@ -26,18 +26,17 @@ import java.util.Iterator;
 import java.util.Set;
 import java.util.UUID;
 
-import org.apache.usergrid.persistence.collection.serialization.MvccEntitySerializationStrategy;
 import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
 
-import org.apache.usergrid.persistence.collection.CollectionScope;
 import org.apache.usergrid.persistence.collection.MvccEntity;
-import org.apache.usergrid.persistence.collection.impl.CollectionScopeImpl;
 import org.apache.usergrid.persistence.collection.mvcc.entity.impl.MvccEntityImpl;
-import org.apache.usergrid.persistence.model.util.EntityUtils;
+import org.apache.usergrid.persistence.collection.serialization.MvccEntitySerializationStrategy;
 import org.apache.usergrid.persistence.core.astyanax.CassandraFig;
 import org.apache.usergrid.persistence.core.guice.MigrationManagerRule;
+import org.apache.usergrid.persistence.core.scope.ApplicationScope;
+import org.apache.usergrid.persistence.core.scope.ApplicationScopeImpl;
 import org.apache.usergrid.persistence.model.entity.Entity;
 import org.apache.usergrid.persistence.model.entity.Id;
 import org.apache.usergrid.persistence.model.entity.SimpleId;
@@ -49,6 +48,7 @@ import org.apache.usergrid.persistence.model.field.IntegerField;
 import org.apache.usergrid.persistence.model.field.LongField;
 import org.apache.usergrid.persistence.model.field.StringField;
 import org.apache.usergrid.persistence.model.field.UUIDField;
+import org.apache.usergrid.persistence.model.util.EntityUtils;
 import org.apache.usergrid.persistence.model.util.UUIDGenerator;
 
 import com.google.common.base.Optional;
@@ -93,10 +93,8 @@ public abstract class MvccEntitySerializationStrategyImplTest {
     public void writeLoadDelete() throws ConnectionException {
 
         final Id organizationId = new SimpleId( "organization" );
-        final Id applicationId = new SimpleId( "application" );
-        final String name = "test";
 
-        CollectionScope context = new CollectionScopeImpl( organizationId,  applicationId, name );
+        ApplicationScope context = new ApplicationScopeImpl( organizationId );
 
 
         final UUID entityId = UUIDGenerator.newTimeUUID();
@@ -205,11 +203,9 @@ public abstract class MvccEntitySerializationStrategyImplTest {
     @Test
     public void writeLoadClearDelete() throws ConnectionException {
 
-        final Id organizationId = new SimpleId( "organization" );
         final Id applicationId = new SimpleId( "application" );
-        final String name = "test";
 
-        CollectionScope context = new CollectionScopeImpl(organizationId,  applicationId, name );
+        ApplicationScope context = new ApplicationScopeImpl( applicationId );
 
 
         final UUID version = UUIDGenerator.newTimeUUID();
@@ -264,11 +260,9 @@ public abstract class MvccEntitySerializationStrategyImplTest {
     @Test
     public void writeLoadDeleteMinimalFields() throws ConnectionException {
 
-        final Id organizationId = new SimpleId( "organization" );
         final Id applicationId = new SimpleId( "application" );
-        final String name = "test";
 
-        CollectionScope context = new CollectionScopeImpl( organizationId,  applicationId, name );
+         ApplicationScope context = new ApplicationScopeImpl( applicationId );
 
 
         final UUID entityId = UUIDGenerator.newTimeUUID();
@@ -332,11 +326,9 @@ public abstract class MvccEntitySerializationStrategyImplTest {
     @Test
     public void writeX2ClearDelete() throws ConnectionException {
 
-        final Id organizationId = new SimpleId( "organization" );
         final Id applicationId = new SimpleId( "application" );
-        final String name = "test";
 
-        CollectionScope context = new CollectionScopeImpl( organizationId, applicationId, name );
+        ApplicationScope context = new ApplicationScopeImpl( applicationId );
 
 
         final UUID entityId = UUIDGenerator.newTimeUUID();
@@ -428,11 +420,9 @@ public abstract class MvccEntitySerializationStrategyImplTest {
 
     @Test
     public void loadAscendingHistory()  throws ConnectionException  {
-        final Id organizationId = new SimpleId("organization");
-        final Id applicationId = new SimpleId("application");
-        final String name = "test";
+        final Id applicationId = new SimpleId( "application" );
 
-        CollectionScope context = new CollectionScopeImpl(organizationId, applicationId, name);
+         ApplicationScope context = new ApplicationScopeImpl( applicationId );
 
 
         final UUID entityId = UUIDGenerator.newTimeUUID();
@@ -470,11 +460,9 @@ public abstract class MvccEntitySerializationStrategyImplTest {
     @Test(expected = UnsupportedOperationException.class)
     public void writeLoadDeletePartial() throws ConnectionException {
 
-        final Id organizationId = new SimpleId( "organization" );
         final Id applicationId = new SimpleId( "application" );
-        final String name = "test";
 
-        CollectionScope context = new CollectionScopeImpl( organizationId,  applicationId, name );
+        ApplicationScope context = new ApplicationScopeImpl( applicationId );
 
 
         final UUID entityId = UUIDGenerator.newTimeUUID();
@@ -523,7 +511,7 @@ public abstract class MvccEntitySerializationStrategyImplTest {
     @Test(expected = NullPointerException.class)
     public void writeParamsEntity() throws ConnectionException {
         serializationStrategy.write(
-                new CollectionScopeImpl( new SimpleId( "organization" ), new SimpleId( "test" ), "test" ), null );
+                new ApplicationScopeImpl( new SimpleId( "organization" )), null );
     }
 
 
@@ -537,7 +525,7 @@ public abstract class MvccEntitySerializationStrategyImplTest {
     public void deleteParamEntityId() throws ConnectionException {
 
         serializationStrategy.delete(
-                new CollectionScopeImpl( new SimpleId( "organization" ), new SimpleId( "test" ), "test" ), null,
+                new ApplicationScopeImpl( new SimpleId( "organization" ) ), null,
                 UUIDGenerator.newTimeUUID() );
     }
 
@@ -546,7 +534,7 @@ public abstract class MvccEntitySerializationStrategyImplTest {
     public void deleteParamVersion() throws ConnectionException {
 
         serializationStrategy
-                .delete( new CollectionScopeImpl( new SimpleId( "organization" ), new SimpleId( "test" ), "test" ),
+                .delete( new ApplicationScopeImpl( new SimpleId( "organization" )),
                         new SimpleId( "test" ), null );
     }
 
@@ -561,7 +549,7 @@ public abstract class MvccEntitySerializationStrategyImplTest {
     public void loadParamEntityId() throws ConnectionException {
 
         serializationStrategy
-                .load( new CollectionScopeImpl(new SimpleId( "organization" ), new SimpleId( "test" ), "test" ), null, UUIDGenerator.newTimeUUID() );
+                .load( new ApplicationScopeImpl(new SimpleId( "organization" ) ), null, UUIDGenerator.newTimeUUID() );
     }
 
 
@@ -569,7 +557,7 @@ public abstract class MvccEntitySerializationStrategyImplTest {
     public void loadParamVersion() throws ConnectionException {
 
         serializationStrategy
-                .load( new CollectionScopeImpl(new SimpleId( "organization" ), new SimpleId( "test" ), "test" ), Collections.<Id>singleton( new SimpleId( "test" )), null );
+                .load( new ApplicationScopeImpl(new SimpleId( "organization" ) ), Collections.<Id>singleton( new SimpleId( "test" )), null );
     }
 
 
@@ -584,7 +572,7 @@ public abstract class MvccEntitySerializationStrategyImplTest {
 
         serializationStrategy
                 .loadDescendingHistory(
-                        new CollectionScopeImpl( new SimpleId( "organization" ), new SimpleId( "test" ), "test" ), null,
+                        new ApplicationScopeImpl( new SimpleId( "organization" ) ), null,
                         UUIDGenerator.newTimeUUID(), 1 );
     }
 
@@ -594,7 +582,7 @@ public abstract class MvccEntitySerializationStrategyImplTest {
 
         serializationStrategy
                 .loadDescendingHistory(
-                        new CollectionScopeImpl( new SimpleId( "organization" ), new SimpleId( "test" ), "test" ),
+                        new ApplicationScopeImpl( new SimpleId( "organization" ) ),
                         new SimpleId( "test" ), null, 1 );
     }
 
@@ -603,7 +591,7 @@ public abstract class MvccEntitySerializationStrategyImplTest {
     public void loadListParamSize() throws ConnectionException {
 
         serializationStrategy.loadDescendingHistory(
-                new CollectionScopeImpl( new SimpleId( "organization" ), new SimpleId( "test" ), "test" ),
+                new ApplicationScopeImpl( new SimpleId( "organization" ) ),
                 new SimpleId( "test" ), UUIDGenerator.newTimeUUID(), 0 );
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/6bf2d3d2/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV1ImplTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV1ImplTest.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV1ImplTest.java
index ff8d743..10e5b56 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV1ImplTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV1ImplTest.java
@@ -25,13 +25,12 @@ import java.util.UUID;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-import org.apache.usergrid.persistence.collection.CollectionScope;
 import org.apache.usergrid.persistence.collection.MvccEntity;
 import org.apache.usergrid.persistence.collection.guice.TestCollectionModule;
-import org.apache.usergrid.persistence.collection.impl.CollectionScopeImpl;
 import org.apache.usergrid.persistence.collection.mvcc.entity.impl.MvccEntityImpl;
 import org.apache.usergrid.persistence.collection.serialization.MvccEntitySerializationStrategy;
-import org.apache.usergrid.persistence.model.util.EntityUtils;
+import org.apache.usergrid.persistence.core.scope.ApplicationScope;
+import org.apache.usergrid.persistence.core.scope.ApplicationScopeImpl;
 import org.apache.usergrid.persistence.core.test.ITRunner;
 import org.apache.usergrid.persistence.core.test.UseModules;
 import org.apache.usergrid.persistence.model.entity.Entity;
@@ -43,6 +42,7 @@ import org.apache.usergrid.persistence.model.field.IntegerField;
 import org.apache.usergrid.persistence.model.field.LongField;
 import org.apache.usergrid.persistence.model.field.StringField;
 import org.apache.usergrid.persistence.model.field.UUIDField;
+import org.apache.usergrid.persistence.model.util.EntityUtils;
 import org.apache.usergrid.persistence.model.util.UUIDGenerator;
 
 import com.google.common.base.Optional;
@@ -73,11 +73,9 @@ public class MvccEntitySerializationStrategyV1ImplTest extends MvccEntitySeriali
     @Test
     public void writeLoadDeletePartial() throws ConnectionException {
 
-        final Id organizationId = new SimpleId( "organization" );
         final Id applicationId = new SimpleId( "application" );
-        final String name = "test";
 
-        CollectionScope context = new CollectionScopeImpl( organizationId,  applicationId, name );
+        ApplicationScope context = new ApplicationScopeImpl( applicationId );
 
 
         final UUID entityId = UUIDGenerator.newTimeUUID();

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/6bf2d3d2/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV2ImplTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV2ImplTest.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV2ImplTest.java
index c64940a..3d2e5cb 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV2ImplTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV2ImplTest.java
@@ -25,13 +25,12 @@ import java.util.UUID;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-import org.apache.usergrid.persistence.collection.CollectionScope;
 import org.apache.usergrid.persistence.collection.MvccEntity;
 import org.apache.usergrid.persistence.collection.guice.TestCollectionModule;
-import org.apache.usergrid.persistence.collection.impl.CollectionScopeImpl;
 import org.apache.usergrid.persistence.collection.mvcc.entity.impl.MvccEntityImpl;
 import org.apache.usergrid.persistence.collection.serialization.MvccEntitySerializationStrategy;
-import org.apache.usergrid.persistence.model.util.EntityUtils;
+import org.apache.usergrid.persistence.core.scope.ApplicationScope;
+import org.apache.usergrid.persistence.core.scope.ApplicationScopeImpl;
 import org.apache.usergrid.persistence.core.test.ITRunner;
 import org.apache.usergrid.persistence.core.test.UseModules;
 import org.apache.usergrid.persistence.model.entity.Entity;
@@ -43,6 +42,7 @@ import org.apache.usergrid.persistence.model.field.IntegerField;
 import org.apache.usergrid.persistence.model.field.LongField;
 import org.apache.usergrid.persistence.model.field.StringField;
 import org.apache.usergrid.persistence.model.field.UUIDField;
+import org.apache.usergrid.persistence.model.util.EntityUtils;
 import org.apache.usergrid.persistence.model.util.UUIDGenerator;
 
 import com.google.common.base.Optional;
@@ -70,11 +70,9 @@ public class MvccEntitySerializationStrategyV2ImplTest extends MvccEntitySeriali
         @Test
         public void writeLoadDeletePartial() throws ConnectionException {
 
-            final Id organizationId = new SimpleId( "organization" );
             final Id applicationId = new SimpleId( "application" );
-            final String name = "test";
 
-            CollectionScope context = new CollectionScopeImpl( organizationId,  applicationId, name );
+            ApplicationScope context = new ApplicationScopeImpl( applicationId );
 
 
             final UUID entityId = UUIDGenerator.newTimeUUID();

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/6bf2d3d2/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV2Test.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV2Test.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV2Test.java
index 0dcf427..1ed1668 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV2Test.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV2Test.java
@@ -22,7 +22,6 @@ package org.apache.usergrid.persistence.collection.serialization.impl;
 
 import java.util.Collections;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.Map;
 import java.util.UUID;
 
@@ -30,16 +29,16 @@ import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
-import org.apache.usergrid.persistence.collection.CollectionScope;
 import org.apache.usergrid.persistence.collection.EntitySet;
 import org.apache.usergrid.persistence.collection.MvccEntity;
 import org.apache.usergrid.persistence.collection.exception.EntityTooLargeException;
-import org.apache.usergrid.persistence.collection.impl.CollectionScopeImpl;
 import org.apache.usergrid.persistence.collection.mvcc.entity.impl.MvccEntityImpl;
 import org.apache.usergrid.persistence.collection.serialization.SerializationFig;
 import org.apache.usergrid.persistence.collection.util.EntityHelper;
 import org.apache.usergrid.persistence.core.astyanax.CassandraFig;
 import org.apache.usergrid.persistence.core.guicyfig.SetConfigTestBypass;
+import org.apache.usergrid.persistence.core.scope.ApplicationScope;
+import org.apache.usergrid.persistence.core.scope.ApplicationScopeImpl;
 import org.apache.usergrid.persistence.core.util.ValidationUtils;
 import org.apache.usergrid.persistence.model.entity.Entity;
 import org.apache.usergrid.persistence.model.entity.Id;
@@ -50,7 +49,6 @@ import com.google.inject.Inject;
 import com.netflix.astyanax.connectionpool.exceptions.ConnectionException;
 
 import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
 
 
 public abstract class MvccEntitySerializationStrategyV2Test extends MvccEntitySerializationStrategyImplTest {
@@ -94,8 +92,9 @@ public abstract class MvccEntitySerializationStrategyV2Test extends MvccEntitySe
         final Entity entity = EntityHelper.generateEntity( setSize );
 
         //now we have one massive, entity, save it and retrieve it.
-        CollectionScope context =
-                new CollectionScopeImpl( new SimpleId( "organization" ), new SimpleId( "parent" ), "tests" );
+        final Id applicationId = new SimpleId( "application" );
+
+        ApplicationScope context = new ApplicationScopeImpl( applicationId );
 
 
         final Id id = entity.getId();
@@ -134,8 +133,9 @@ public abstract class MvccEntitySerializationStrategyV2Test extends MvccEntitySe
         final Entity entity = EntityHelper.generateEntity( setSize );
 
         //now we have one massive, entity, save it and retrieve it.
-        CollectionScope context =
-                new CollectionScopeImpl( new SimpleId( "organization" ), new SimpleId( "parent" ), "tests" );
+        final Id applicationId = new SimpleId( "application" );
+
+              ApplicationScope context = new ApplicationScopeImpl( applicationId );
 
 
         final Id id = entity.getId();
@@ -175,8 +175,8 @@ public abstract class MvccEntitySerializationStrategyV2Test extends MvccEntitySe
 
         final HashMap<Id, MvccEntity> entities = new HashMap<>( size );
 
-        CollectionScope context =
-                new CollectionScopeImpl( new SimpleId( "organization" ), new SimpleId( "parent" ), "tests" );
+        ApplicationScope context =
+                new ApplicationScopeImpl( new SimpleId( "organization" ));
 
 
         for ( int i = 0; i < size; i++ ) {

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/6bf2d3d2/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV3ImplTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV3ImplTest.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV3ImplTest.java
index e5ea409..1df22f6 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV3ImplTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccEntitySerializationStrategyV3ImplTest.java
@@ -6,10 +6,10 @@ import java.util.UUID;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-import org.apache.usergrid.persistence.collection.CollectionScope;
 import org.apache.usergrid.persistence.collection.guice.TestCollectionModule;
-import org.apache.usergrid.persistence.collection.impl.CollectionScopeImpl;
 import org.apache.usergrid.persistence.collection.serialization.MvccEntitySerializationStrategy;
+import org.apache.usergrid.persistence.core.scope.ApplicationScope;
+import org.apache.usergrid.persistence.core.scope.ApplicationScopeImpl;
 import org.apache.usergrid.persistence.core.test.ITRunner;
 import org.apache.usergrid.persistence.core.test.UseModules;
 import org.apache.usergrid.persistence.model.entity.Id;
@@ -38,12 +38,10 @@ public class MvccEntitySerializationStrategyV3ImplTest extends MvccEntitySeriali
 
     @Test( expected = UnsupportedOperationException.class )
     public void loadAscendingHistory() throws ConnectionException {
-        final Id organizationId = new SimpleId( "organization" );
         final Id applicationId = new SimpleId( "application" );
-
         final String name = "test";
 
-        CollectionScope context = new CollectionScopeImpl( organizationId, applicationId, name );
+        ApplicationScope context = new ApplicationScopeImpl( applicationId );
 
 
         final Id entityId = new SimpleId( UUIDGenerator.newTimeUUID(), name );
@@ -55,20 +53,18 @@ public class MvccEntitySerializationStrategyV3ImplTest extends MvccEntitySeriali
 
     @Test( expected = UnsupportedOperationException.class )
     public void loadDescendingHistory() throws ConnectionException {
-        final Id organizationId = new SimpleId( "organization" );
-        final Id applicationId = new SimpleId( "application" );
+
 
         final String name = "test";
 
-        CollectionScope context = new CollectionScopeImpl( organizationId, applicationId, name );
+        final Id applicationId = new SimpleId( "application" );
 
+        ApplicationScope context = new ApplicationScopeImpl( applicationId );
 
         final Id entityId = new SimpleId( UUIDGenerator.newTimeUUID(), name );
         final UUID version1 = UUIDGenerator.newTimeUUID();
 
         serializationStrategy.loadDescendingHistory( context, entityId, version1, 20 );
     }
-
-
 }
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/6bf2d3d2/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccLESSTransientTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccLESSTransientTest.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccLESSTransientTest.java
index 5336b05..c92923a 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccLESSTransientTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccLESSTransientTest.java
@@ -29,16 +29,16 @@ import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-import org.apache.usergrid.persistence.collection.CollectionScope;
 import org.apache.usergrid.persistence.collection.MvccLogEntry;
-import org.apache.usergrid.persistence.core.guice.MigrationManagerRule;
 import org.apache.usergrid.persistence.collection.guice.TestCollectionModule;
-import org.apache.usergrid.persistence.collection.impl.CollectionScopeImpl;
-import org.apache.usergrid.persistence.collection.serialization.MvccLogEntrySerializationStrategy;
 import org.apache.usergrid.persistence.collection.mvcc.entity.Stage;
 import org.apache.usergrid.persistence.collection.mvcc.entity.impl.MvccLogEntryImpl;
+import org.apache.usergrid.persistence.collection.serialization.MvccLogEntrySerializationStrategy;
 import org.apache.usergrid.persistence.collection.serialization.SerializationFig;
+import org.apache.usergrid.persistence.core.guice.MigrationManagerRule;
 import org.apache.usergrid.persistence.core.guicyfig.SetConfigTestBypass;
+import org.apache.usergrid.persistence.core.scope.ApplicationScope;
+import org.apache.usergrid.persistence.core.scope.ApplicationScopeImpl;
 import org.apache.usergrid.persistence.core.test.ITRunner;
 import org.apache.usergrid.persistence.core.test.UseModules;
 import org.apache.usergrid.persistence.model.entity.Id;
@@ -78,25 +78,22 @@ public class MvccLESSTransientTest {
     public void setTimeout() {
         originalTimeout = serializationFig.getTimeout();
         //set the bypass options
-        SetConfigTestBypass.setValueByPass( serializationFig,"getTimeout", "1"  );
+        SetConfigTestBypass.setValueByPass( serializationFig, "getTimeout", "1" );
     }
 
+
     @After
-    public void resetTimeout(){
-        SetConfigTestBypass.setValueByPass( serializationFig,"getTimeout", originalTimeout + ""  );
+    public void resetTimeout() {
+        SetConfigTestBypass.setValueByPass( serializationFig, "getTimeout", originalTimeout + "" );
     }
 
 
-
-
     @Test
     public void transientTimeout() throws ConnectionException, InterruptedException {
-        final Id organizationId = new SimpleId( "organization" );
         final Id applicationId = new SimpleId( "application" );
-        final String name = "test";
 
 
-        CollectionScope context = new CollectionScopeImpl( organizationId, applicationId, name );
+        ApplicationScope context = new ApplicationScopeImpl( applicationId );
 
         final Id id = new SimpleId( "test" );
         final UUID version = UUIDGenerator.newTimeUUID();
@@ -111,7 +108,7 @@ public class MvccLESSTransientTest {
             Thread.sleep( 1000 );
 
             MvccLogEntry returned =
-                    logEntryStrategy.load( context, Collections.singleton( id ), version ).getMaxVersion( id );
+                logEntryStrategy.load( context, Collections.singleton( id ), version ).getMaxVersion( id );
 
 
             if ( stage.isTransient() ) {

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/6bf2d3d2/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccLogEntrySerializationStrategyImplTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccLogEntrySerializationStrategyImplTest.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccLogEntrySerializationStrategyImplTest.java
index 148fcf8..19a75fa 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccLogEntrySerializationStrategyImplTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/MvccLogEntrySerializationStrategyImplTest.java
@@ -24,20 +24,20 @@ import java.util.Collections;
 import java.util.List;
 import java.util.UUID;
 
-import org.apache.usergrid.persistence.core.test.UseModules;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-import org.apache.usergrid.persistence.collection.CollectionScope;
-import org.apache.usergrid.persistence.core.guice.MigrationManagerRule;
-import org.apache.usergrid.persistence.collection.guice.TestCollectionModule;
-import org.apache.usergrid.persistence.collection.impl.CollectionScopeImpl;
-import org.apache.usergrid.persistence.collection.serialization.MvccLogEntrySerializationStrategy;
 import org.apache.usergrid.persistence.collection.MvccLogEntry;
+import org.apache.usergrid.persistence.collection.guice.TestCollectionModule;
 import org.apache.usergrid.persistence.collection.mvcc.entity.Stage;
 import org.apache.usergrid.persistence.collection.mvcc.entity.impl.MvccLogEntryImpl;
+import org.apache.usergrid.persistence.collection.serialization.MvccLogEntrySerializationStrategy;
+import org.apache.usergrid.persistence.core.guice.MigrationManagerRule;
+import org.apache.usergrid.persistence.core.scope.ApplicationScope;
+import org.apache.usergrid.persistence.core.scope.ApplicationScopeImpl;
 import org.apache.usergrid.persistence.core.test.ITRunner;
+import org.apache.usergrid.persistence.core.test.UseModules;
 import org.apache.usergrid.persistence.model.entity.Id;
 import org.apache.usergrid.persistence.model.entity.SimpleId;
 import org.apache.usergrid.persistence.model.util.UUIDGenerator;
@@ -67,12 +67,9 @@ public class MvccLogEntrySerializationStrategyImplTest {
     @Test
     public void createAndDelete() throws ConnectionException {
 
-        final Id organizationId = new SimpleId( "organization" );
         final Id applicationId = new SimpleId( "application" );
-        final String name = "test";
-
 
-        CollectionScope context = new CollectionScopeImpl(organizationId, applicationId, name );
+        ApplicationScope context = new ApplicationScopeImpl( applicationId );
 
 
         final Id id = new SimpleId( "test" );
@@ -84,7 +81,8 @@ public class MvccLogEntrySerializationStrategyImplTest {
 
             //Read it back
 
-            MvccLogEntry returned = logEntryStrategy.load( context, Collections.singleton(id), version ).getMaxVersion( id );
+            MvccLogEntry returned =
+                logEntryStrategy.load( context, Collections.singleton( id ), version ).getMaxVersion( id );
 
             assertNotNull( "Returned value should not be null", returned );
 
@@ -96,19 +94,17 @@ public class MvccLogEntrySerializationStrategyImplTest {
     @Test
     public void loadNoData() throws ConnectionException {
 
-        final Id organizationId = new SimpleId( "organization" );
         final Id applicationId = new SimpleId( "application" );
-        final String name = "test";
-
 
-        CollectionScope context = new CollectionScopeImpl(organizationId, applicationId, name );
+        ApplicationScope context = new ApplicationScopeImpl( applicationId );
 
 
         final Id id = new SimpleId( "test" );
         final UUID version = UUIDGenerator.newTimeUUID();
 
 
-        MvccLogEntry returned = logEntryStrategy.load( context, Collections.singleton(id), version ).getMaxVersion( id );
+        MvccLogEntry returned =
+            logEntryStrategy.load( context, Collections.singleton( id ), version ).getMaxVersion( id );
 
         assertNull( "Returned value should not exist", returned );
     }
@@ -117,12 +113,9 @@ public class MvccLogEntrySerializationStrategyImplTest {
     @Test
     public void getMultipleEntries() throws ConnectionException {
 
-        final Id organizationId = new SimpleId( "organization" );
         final Id applicationId = new SimpleId( "application" );
-        final String name = "test";
 
-
-        CollectionScope context = new CollectionScopeImpl(organizationId, applicationId, name );
+        ApplicationScope context = new ApplicationScopeImpl( applicationId );
 
 
         final Id id = new SimpleId( "test" );
@@ -142,7 +135,8 @@ public class MvccLogEntrySerializationStrategyImplTest {
 
             //Read it back
 
-            MvccLogEntry returned = logEntryStrategy.load( context, Collections.singleton(id), versions[i] ).getMaxVersion( id );
+            MvccLogEntry returned =
+                logEntryStrategy.load( context, Collections.singleton( id ), versions[i] ).getMaxVersion( id );
 
             assertNotNull( "Returned value should not be null", returned );
 
@@ -173,94 +167,89 @@ public class MvccLogEntrySerializationStrategyImplTest {
     }
 
 
-    @Test(expected = NullPointerException.class)
+    @Test( expected = NullPointerException.class )
     public void writeParamsNoContext() throws ConnectionException {
         logEntryStrategy.write( null, mock( MvccLogEntry.class ) );
     }
 
 
-    @Test(expected = NullPointerException.class)
+    @Test( expected = NullPointerException.class )
     public void writeParams() throws ConnectionException {
-        logEntryStrategy.write( mock( CollectionScope.class ), null );
+        logEntryStrategy.write( mock( ApplicationScope.class ), null );
     }
 
 
-    @Test(expected = NullPointerException.class)
+    @Test( expected = NullPointerException.class )
     public void deleteParamContext() throws ConnectionException {
         logEntryStrategy.delete( null, new SimpleId( "test" ), UUIDGenerator.newTimeUUID() );
     }
 
 
-    @Test(expected = NullPointerException.class)
+    @Test( expected = NullPointerException.class )
     public void deleteParamEntityId() throws ConnectionException {
 
-        logEntryStrategy.delete(
-                new CollectionScopeImpl( new SimpleId( "organization" ), new SimpleId( "test" ), "test" ), null,
-                UUIDGenerator.newTimeUUID() );
+        logEntryStrategy
+            .delete( new ApplicationScopeImpl( new SimpleId( "organization" ) ), null, UUIDGenerator.newTimeUUID() );
     }
 
 
-    @Test(expected = NullPointerException.class)
+    @Test( expected = NullPointerException.class )
     public void deleteParamVersion() throws ConnectionException {
 
         logEntryStrategy
-                .delete( new CollectionScopeImpl( new SimpleId( "organization" ), new SimpleId( "test" ), "test" ),
-                        new SimpleId( "test" ), null );
+            .delete( new ApplicationScopeImpl( new SimpleId( "organization" ) ), new SimpleId( "test" ), null );
     }
 
 
-    @Test(expected = NullPointerException.class)
+    @Test( expected = NullPointerException.class )
     public void loadParamContext() throws ConnectionException {
         logEntryStrategy.load( null, Collections.<Id>emptyList(), UUIDGenerator.newTimeUUID() );
     }
 
 
-    @Test(expected = NullPointerException.class)
+    @Test( expected = NullPointerException.class )
     public void loadParamEntityId() throws ConnectionException {
 
         logEntryStrategy
-                .load( new CollectionScopeImpl(new SimpleId( "organization" ), new SimpleId( "test" ), "test" ), null, UUIDGenerator.newTimeUUID() );
+            .load( new ApplicationScopeImpl( new SimpleId( "organization" ) ), null, UUIDGenerator.newTimeUUID() );
     }
 
 
-    @Test(expected = NullPointerException.class)
+    @Test( expected = NullPointerException.class )
     public void loadParamVersion() throws ConnectionException {
 
-        logEntryStrategy
-                .load( new CollectionScopeImpl( new SimpleId( "organization" ), new SimpleId( "test" ), "test" ),
-                        Collections.<Id>singleton( new SimpleId( "test" )), null );
+        logEntryStrategy.load( new ApplicationScopeImpl( new SimpleId( "organization" ) ),
+            Collections.<Id>singleton( new SimpleId( "test" ) ), null );
     }
 
 
-    @Test(expected = NullPointerException.class)
+    @Test( expected = NullPointerException.class )
     public void loadListParamContext() throws ConnectionException {
         logEntryStrategy.load( null, new SimpleId( "test" ), UUIDGenerator.newTimeUUID(), 1 );
     }
 
 
-    @Test(expected = NullPointerException.class)
+    @Test( expected = NullPointerException.class )
     public void loadListParamEntityId() throws ConnectionException {
 
         logEntryStrategy
-                .load( new CollectionScopeImpl(new SimpleId( "organization" ), new SimpleId( "test" ), "test" ), null, UUIDGenerator.newTimeUUID(),
-                        1 );
+            .load( new ApplicationScopeImpl( new SimpleId( "organization" ) ), null, UUIDGenerator.newTimeUUID(), 1 );
     }
 
 
-    @Test(expected = NullPointerException.class)
+    @Test( expected = NullPointerException.class )
     public void loadListParamVersion() throws ConnectionException {
 
         logEntryStrategy
-                .load( new CollectionScopeImpl( new SimpleId( "organization" ), new SimpleId( "test" ), "test" ),
-                        new SimpleId( "test" ), null, 1 );
+            .load( new ApplicationScopeImpl( new SimpleId( "organization" ) ), new SimpleId( "test" ), null, 1 );
     }
 
 
-    @Test(expected = IllegalArgumentException.class)
+    @Test( expected = IllegalArgumentException.class )
     public void loadListParamSize() throws ConnectionException {
 
-        logEntryStrategy.load( new CollectionScopeImpl(new SimpleId( "organization" ), new SimpleId( "test" ), "test" ), new SimpleId( "test" ),
-                UUIDGenerator.newTimeUUID(), 0 );
+        logEntryStrategy.load( new ApplicationScopeImpl( new SimpleId( "organization" ) ), new SimpleId( "test" ),
+            UUIDGenerator.newTimeUUID(), 0 );
     }
 }
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/6bf2d3d2/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/ScopedRowKeySerializerTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/ScopedRowKeySerializerTest.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/ScopedRowKeySerializerTest.java
index a09b623..340cd80 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/ScopedRowKeySerializerTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/ScopedRowKeySerializerTest.java
@@ -50,7 +50,7 @@ public class ScopedRowKeySerializerTest {
                 ScopedRowKey.fromKey( applicationId, collectionPrefixedKey );
 
 
-        CollectionScopedRowKeySerializer<Id> collectionScopedRowKeySerializer =
+       CollectionScopedRowKeySerializer<Id> collectionScopedRowKeySerializer =
                 new CollectionScopedRowKeySerializer<Id>( IdRowCompositeSerializer.get() );
 
         ByteBuffer buff = collectionScopedRowKeySerializer.toByteBuffer( rowKey );

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/6bf2d3d2/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/SerializationComparison.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/SerializationComparison.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/SerializationComparison.java
index 6383e75..660a6a9 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/SerializationComparison.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/SerializationComparison.java
@@ -28,7 +28,6 @@ import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import org.apache.usergrid.persistence.model.util.EntityUtils;
 import org.apache.usergrid.persistence.model.entity.Entity;
 import org.apache.usergrid.persistence.model.entity.SimpleId;
 import org.apache.usergrid.persistence.model.field.BooleanField;
@@ -37,6 +36,7 @@ import org.apache.usergrid.persistence.model.field.IntegerField;
 import org.apache.usergrid.persistence.model.field.LongField;
 import org.apache.usergrid.persistence.model.field.StringField;
 import org.apache.usergrid.persistence.model.field.UUIDField;
+import org.apache.usergrid.persistence.model.util.EntityUtils;
 import org.apache.usergrid.persistence.model.util.UUIDGenerator;
 
 import com.fasterxml.jackson.databind.ObjectMapper;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/6bf2d3d2/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/SettingsValidationTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/SettingsValidationTest.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/SettingsValidationTest.java
index 807bc4e..273bec0 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/SettingsValidationTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/SettingsValidationTest.java
@@ -25,7 +25,6 @@ import org.junit.Test;
 import org.apache.usergrid.persistence.collection.serialization.SerializationFig;
 import org.apache.usergrid.persistence.core.astyanax.CassandraFig;
 
-import static org.junit.Assert.*;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/6bf2d3d2/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/migration/AbstractMvccEntityDataMigrationV1ToV3ImplTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/migration/AbstractMvccEntityDataMigrationV1ToV3ImplTest.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/migration/AbstractMvccEntityDataMigrationV1ToV3ImplTest.java
index 9938caf..986b740 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/migration/AbstractMvccEntityDataMigrationV1ToV3ImplTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/migration/AbstractMvccEntityDataMigrationV1ToV3ImplTest.java
@@ -26,20 +26,20 @@ import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
-import org.apache.usergrid.persistence.collection.CollectionScope;
 import org.apache.usergrid.persistence.collection.MvccEntity;
 import org.apache.usergrid.persistence.collection.guice.TestCollectionModule;
-import org.apache.usergrid.persistence.collection.impl.CollectionScopeImpl;
 import org.apache.usergrid.persistence.collection.mvcc.entity.impl.MvccEntityImpl;
 import org.apache.usergrid.persistence.collection.serialization.MvccEntitySerializationStrategy;
 import org.apache.usergrid.persistence.collection.serialization.impl.CollectionDataVersions;
 import org.apache.usergrid.persistence.core.guice.DataMigrationResetRule;
 import org.apache.usergrid.persistence.core.guice.MigrationManagerRule;
 import org.apache.usergrid.persistence.core.migration.data.DataMigrationManager;
-import org.apache.usergrid.persistence.core.migration.data.TestProgressObserver;
 import org.apache.usergrid.persistence.core.migration.data.MigrationDataProvider;
 import org.apache.usergrid.persistence.core.migration.data.MigrationRelationship;
+import org.apache.usergrid.persistence.core.migration.data.TestProgressObserver;
 import org.apache.usergrid.persistence.core.migration.data.VersionedMigrationSet;
+import org.apache.usergrid.persistence.core.scope.ApplicationScope;
+import org.apache.usergrid.persistence.core.scope.ApplicationScopeImpl;
 import org.apache.usergrid.persistence.core.test.ITRunner;
 import org.apache.usergrid.persistence.core.test.UseModules;
 import org.apache.usergrid.persistence.model.entity.Entity;
@@ -95,9 +95,8 @@ public abstract class AbstractMvccEntityDataMigrationV1ToV3ImplTest implements D
     public void testMigration() throws ConnectionException {
 
         final Id applicationId = createId( "application" );
-        final String collectionName = "things";
 
-        CollectionScope scope = new CollectionScopeImpl( applicationId, applicationId, collectionName );
+        ApplicationScope scope = new ApplicationScopeImpl( applicationId );
 
         final MvccEntity entity1 = getEntity( "thing" );
         final MvccEntity entity2 = getEntity( "thing" );

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/6bf2d3d2/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/migration/MvccEntityDataMigrationV1ToV3ImplTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/migration/MvccEntityDataMigrationV1ToV3ImplTest.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/migration/MvccEntityDataMigrationV1ToV3ImplTest.java
index 7d02b4b..453fe77 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/migration/MvccEntityDataMigrationV1ToV3ImplTest.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/serialization/impl/migration/MvccEntityDataMigrationV1ToV3ImplTest.java
@@ -38,12 +38,6 @@ import com.google.inject.Inject;
 
 import net.jcip.annotations.NotThreadSafe;
 
-import static org.apache.usergrid.persistence.core.util.IdGenerator.createId;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
-
 
 @NotThreadSafe
 @RunWith( ITRunner.class )

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/6bf2d3d2/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/util/EntityHelper.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/util/EntityHelper.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/util/EntityHelper.java
index 4dafbaf..6528c75 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/util/EntityHelper.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/util/EntityHelper.java
@@ -28,7 +28,6 @@ import org.apache.usergrid.persistence.model.entity.Entity;
 import org.apache.usergrid.persistence.model.entity.SimpleId;
 import org.apache.usergrid.persistence.model.field.Field;
 import org.apache.usergrid.persistence.model.field.StringField;
-import org.apache.usergrid.persistence.model.util.UUIDGenerator;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/6bf2d3d2/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/util/LogEntryMock.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/util/LogEntryMock.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/util/LogEntryMock.java
index ec27e8a..93de9d4 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/util/LogEntryMock.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/util/LogEntryMock.java
@@ -29,18 +29,17 @@ import java.util.UUID;
 import org.mockito.invocation.InvocationOnMock;
 import org.mockito.stubbing.Answer;
 
-import org.apache.usergrid.persistence.collection.CollectionScope;
-import org.apache.usergrid.persistence.collection.serialization.MvccLogEntrySerializationStrategy;
 import org.apache.usergrid.persistence.collection.MvccLogEntry;
 import org.apache.usergrid.persistence.collection.mvcc.entity.Stage;
 import org.apache.usergrid.persistence.collection.mvcc.entity.impl.MvccLogEntryImpl;
+import org.apache.usergrid.persistence.collection.serialization.MvccLogEntrySerializationStrategy;
+import org.apache.usergrid.persistence.core.scope.ApplicationScope;
 import org.apache.usergrid.persistence.model.entity.Id;
 
 import com.fasterxml.uuid.UUIDComparator;
 import com.netflix.astyanax.connectionpool.exceptions.ConnectionException;
 
 import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
 import static org.mockito.Matchers.same;
 import static org.mockito.Mockito.when;
 
@@ -78,7 +77,7 @@ public class LogEntryMock {
      * @param scope
      * @throws ConnectionException
      */
-    private void initMock(  final MvccLogEntrySerializationStrategy logEntrySerializationStrategy, final  CollectionScope scope )
+    private void initMock(  final MvccLogEntrySerializationStrategy logEntrySerializationStrategy, final ApplicationScope scope )
 
             throws ConnectionException {
 
@@ -131,7 +130,7 @@ public class LogEntryMock {
      * @param versions The versions to mock
      * @throws ConnectionException
      */
-    public static LogEntryMock createLogEntryMock(final MvccLogEntrySerializationStrategy logEntrySerializationStrategy, final  CollectionScope scope,final Id entityId, final List<UUID> versions )
+    public static LogEntryMock createLogEntryMock(final MvccLogEntrySerializationStrategy logEntrySerializationStrategy, final  ApplicationScope scope,final Id entityId, final List<UUID> versions )
 
             throws ConnectionException {
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/6bf2d3d2/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/util/UniqueValueEntryMock.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/util/UniqueValueEntryMock.java b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/util/UniqueValueEntryMock.java
index c06479b..201970a 100644
--- a/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/util/UniqueValueEntryMock.java
+++ b/stack/corepersistence/collection/src/test/java/org/apache/usergrid/persistence/collection/util/UniqueValueEntryMock.java
@@ -47,17 +47,16 @@ import java.util.Comparator;
 import java.util.List;
 import java.util.UUID;
 
-import org.apache.usergrid.persistence.collection.CollectionScope;
 import org.apache.usergrid.persistence.collection.serialization.UniqueValue;
 import org.apache.usergrid.persistence.collection.serialization.UniqueValueSerializationStrategy;
 import org.apache.usergrid.persistence.collection.serialization.impl.UniqueValueImpl;
+import org.apache.usergrid.persistence.core.scope.ApplicationScope;
 import org.apache.usergrid.persistence.model.entity.Id;
 import org.apache.usergrid.persistence.model.field.StringField;
 
 import com.fasterxml.uuid.UUIDComparator;
 import com.netflix.astyanax.connectionpool.exceptions.ConnectionException;
 
-import static org.mockito.Matchers.any;
 import static org.mockito.Matchers.same;
 import static org.mockito.Mockito.when;
 
@@ -101,7 +100,7 @@ public class UniqueValueEntryMock {
      * @param scope
      * @throws com.netflix.astyanax.connectionpool.exceptions.ConnectionException
      */
-    private void initMock(  final UniqueValueSerializationStrategy uniqueValueSerializationStrategy, final  CollectionScope scope )
+    private void initMock(  final UniqueValueSerializationStrategy uniqueValueSerializationStrategy, final  ApplicationScope scope )
 
             throws ConnectionException {
 
@@ -129,7 +128,7 @@ public class UniqueValueEntryMock {
      * @throws com.netflix.astyanax.connectionpool.exceptions.ConnectionException
      */
     public static UniqueValueEntryMock createUniqueMock(
-            final UniqueValueSerializationStrategy uniqueValueSerializationStrategy, final CollectionScope scope,
+            final UniqueValueSerializationStrategy uniqueValueSerializationStrategy, final ApplicationScope scope,
             final Id entityId, final List<UUID> versions ) throws ConnectionException {
 
         UniqueValueEntryMock mock = new UniqueValueEntryMock( entityId, versions );

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/6bf2d3d2/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/scope/ApplicationScopeImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/scope/ApplicationScopeImpl.java b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/scope/ApplicationScopeImpl.java
index e8dbb02..5733e3a 100644
--- a/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/scope/ApplicationScopeImpl.java
+++ b/stack/corepersistence/common/src/main/java/org/apache/usergrid/persistence/core/scope/ApplicationScopeImpl.java
@@ -22,6 +22,8 @@ package org.apache.usergrid.persistence.core.scope;
 
 import org.apache.usergrid.persistence.model.entity.Id;
 
+import com.google.common.base.Preconditions;
+
 
 /**
  *
@@ -33,6 +35,7 @@ public class ApplicationScopeImpl implements ApplicationScope {
 
 
     public ApplicationScopeImpl( final Id application ) {
+        Preconditions.checkNotNull(application, "application id is required");
         this.application = application;
     }
 


Mime
View raw message