usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From toddn...@apache.org
Subject [1/4] incubator-usergrid git commit: Pushed migration tests down to core tiers. WIP
Date Wed, 04 Mar 2015 17:28:36 GMT
Repository: incubator-usergrid
Updated Branches:
  refs/heads/USERGRID-405 d000e7776 -> 802dcdec4 (forced update)


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/802dcdec/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/comparators/TargetDirectedEdgeDescendingComparatorTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/comparators/TargetDirectedEdgeDescendingComparatorTest.java
b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/comparators/TargetDirectedEdgeDescendingComparatorTest.java
index 15df661..4ec1486 100644
--- a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/comparators/TargetDirectedEdgeDescendingComparatorTest.java
+++ b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/impl/shard/impl/comparators/TargetDirectedEdgeDescendingComparatorTest.java
@@ -26,11 +26,12 @@ import java.util.UUID;
 
 import org.junit.Test;
 
+import org.apache.usergrid.persistence.core.util.IdGenerator;
 import org.apache.usergrid.persistence.graph.impl.SimpleMarkedEdge;
 import org.apache.usergrid.persistence.model.entity.Id;
 import org.apache.usergrid.persistence.model.util.UUIDGenerator;
 
-import static org.apache.usergrid.persistence.graph.test.util.EdgeTestUtils.createId;
+import static org.apache.usergrid.persistence.core.util.IdGenerator.createId;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
@@ -43,8 +44,8 @@ public class TargetDirectedEdgeDescendingComparatorTest {
     @Test
     public void sameEdges() {
 
-        final Id sourceId = createId( "source" );
-        final Id targetId = createId( "target" );
+        final Id sourceId = IdGenerator.createId( "source" );
+        final Id targetId = IdGenerator.createId( "target" );
         final String type = "type";
         final long timestamp = 10000;
 
@@ -65,8 +66,8 @@ public class TargetDirectedEdgeDescendingComparatorTest {
     @Test
     public void timestampDifferent() {
 
-        final Id sourceId = createId( "source" );
-        final Id targetId = createId( "target" );
+        final Id sourceId = IdGenerator.createId( "source" );
+        final Id targetId = IdGenerator.createId( "target" );
         final String type = "type";
         final long timestamp = 10000;
 
@@ -88,9 +89,9 @@ public class TargetDirectedEdgeDescendingComparatorTest {
     @Test
     public void uuidDifferent() {
 
-        final Id sourceId = createId( "source" );
-        final Id targetId1 = createId( "target" );
-        final Id targetId2 = createId( "target" );
+        final Id sourceId = IdGenerator.createId( "source" );
+        final Id targetId1 = IdGenerator.createId( "target" );
+        final Id targetId2 = IdGenerator.createId( "target" );
         final String type = "type";
         final long timestamp = 10000;
 
@@ -114,9 +115,9 @@ public class TargetDirectedEdgeDescendingComparatorTest {
 
         final UUID targetId = UUIDGenerator.newTimeUUID();
 
-        final Id sourceId = createId( "source" );
-        final Id targetId1 = createId( targetId, "target1" );
-        final Id targetId2 = createId( targetId, "target2" );
+        final Id sourceId = IdGenerator.createId( "source" );
+        final Id targetId1 = IdGenerator.createId( targetId, "target1" );
+        final Id targetId2 = IdGenerator.createId( targetId, "target2" );
         final String type = "type";
         final long timestamp = 10000;
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/802dcdec/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/test/util/EdgeTestUtils.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/test/util/EdgeTestUtils.java
b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/test/util/EdgeTestUtils.java
index ca82b8d..cc0bb51 100644
--- a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/test/util/EdgeTestUtils.java
+++ b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/test/util/EdgeTestUtils.java
@@ -21,8 +21,8 @@ package org.apache.usergrid.persistence.graph.test.util;
 
 
 import java.util.Random;
-import java.util.UUID;
 
+import org.apache.usergrid.persistence.core.util.IdGenerator;
 import org.apache.usergrid.persistence.graph.Edge;
 import org.apache.usergrid.persistence.graph.MarkedEdge;
 import org.apache.usergrid.persistence.graph.SearchByEdge;
@@ -36,8 +36,6 @@ import org.apache.usergrid.persistence.graph.impl.SimpleSearchByIdType;
 import org.apache.usergrid.persistence.graph.impl.SimpleSearchEdgeType;
 import org.apache.usergrid.persistence.graph.impl.SimpleSearchIdType;
 import org.apache.usergrid.persistence.model.entity.Id;
-import org.apache.usergrid.persistence.model.entity.SimpleId;
-import org.apache.usergrid.persistence.model.util.UUIDGenerator;
 
 
 /**
@@ -61,7 +59,7 @@ public class EdgeTestUtils {
      * @return an Edge for testing
      */
     public static MarkedEdge createEdge( final String sourceType, final String edgeType,
final String targetType ) {
-        return createEdge( createId( sourceType ), edgeType, createId( targetType ), System.currentTimeMillis()
);
+        return createEdge( IdGenerator.createId( sourceType ), edgeType, IdGenerator.createId(
targetType ), System.currentTimeMillis() );
     }
 
 
@@ -76,7 +74,7 @@ public class EdgeTestUtils {
      * @return an Edge for testing
      */
     public static MarkedEdge createEdge( final String sourceType, final String edgeType,
final String targetType, final long timestamp ) {
-        return createEdge( createId( sourceType ), edgeType, createId( targetType ), timestamp
);
+        return createEdge( IdGenerator.createId( sourceType ), edgeType, IdGenerator.createId(
targetType ), timestamp );
     }
 
 
@@ -92,7 +90,7 @@ public class EdgeTestUtils {
      */
     public static MarkedEdge createMarkedEdge( final String sourceType, final String edgeType,
                                                final String targetType ) {
-        return createEdge( createId( sourceType ), edgeType, createId( targetType ), System.currentTimeMillis(),
+        return createEdge( IdGenerator.createId( sourceType ), edgeType, IdGenerator.createId(
targetType ), System.currentTimeMillis(),
                 true );
     }
 
@@ -140,25 +138,6 @@ public class EdgeTestUtils {
 
 
     /**
-     * Create the id
-     */
-    public static Id createId( String type ) {
-        return createId(UUIDGenerator.newTimeUUID(), type );
-    }
-
-
-    /**
-     * Generate an ID with the type and id
-     *
-     * @param id The uuid in the id
-     * @param type The type of id
-     */
-    public static Id createId( UUID id, String type ) {
-        return new SimpleId( id, type );
-    }
-
-
-    /**
      *
      * @param sourceId
      * @param type


Mime
View raw message