usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject [1/4] git commit: Updated security rules for tests. Also updated configuration for batch set sizes
Date Wed, 05 Feb 2014 02:20:39 GMT
Updated Branches:
  refs/heads/two-dot-o ef9f0f2c7 -> 4d610b071


Updated security rules for tests.  Also updated configuration for batch set sizes


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

Branch: refs/heads/two-dot-o
Commit: ffefd72a658461e21aba4f611912fd0996d046d1
Parents: ef9f0f2
Author: Todd Nine <tnine@apigee.com>
Authored: Tue Feb 4 14:22:41 2014 -0700
Committer: Todd Nine <tnine@apigee.com>
Committed: Tue Feb 4 14:22:41 2014 -0700

----------------------------------------------------------------------
 stack/corepersistence/collection/pom.xml        |  14 +--
 stack/corepersistence/graph/pom.xml             | 109 +++++++++++-----
 .../usergrid/persistence/graph/GraphFig.java    |  19 +++
 .../persistence/graph/guice/GraphModule.java    |   6 +
 .../impl/EdgeMetadataSerializationImpl.java     |  13 +-
 .../impl/EdgeSerializationImpl.java             |  10 +-
 .../EdgeSerializationChopTest.java              | 126 +++++++++++++++++++
 .../graph/test/util/EdgeTestUtils.java          |  60 ++++-----
 .../src/test/resources/usergrid-CHOP.properties |  12 ++
 .../src/test/resources/usergrid-UNIT.properties |   1 +
 stack/corepersistence/pom.xml                   | 122 ++++++++++--------
 11 files changed, 349 insertions(+), 143 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ffefd72a/stack/corepersistence/collection/pom.xml
----------------------------------------------------------------------
diff --git a/stack/corepersistence/collection/pom.xml b/stack/corepersistence/collection/pom.xml
index 31ceec0..e279d99 100644
--- a/stack/corepersistence/collection/pom.xml
+++ b/stack/corepersistence/collection/pom.xml
@@ -43,18 +43,6 @@
         </testResources>
 
         <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-jar-plugin</artifactId>
-                <version>2.4</version>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>test-jar</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
 
         <plugin>
           <groupId>org.safehaus.chop</groupId>
@@ -90,7 +78,7 @@
               but please do this in the settings.xml file .. essentially
               all parameters should be in the settings.xml file.
               -->
-              <param>${myip.address}/32:8080</param>
+              <param>${myip.address}/32:24981</param>
               <param>${myip.address}/32:22</param>
             </securityGroupExceptions>
           </configuration>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ffefd72a/stack/corepersistence/graph/pom.xml
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/pom.xml b/stack/corepersistence/graph/pom.xml
index 86147bf..e04d92f 100644
--- a/stack/corepersistence/graph/pom.xml
+++ b/stack/corepersistence/graph/pom.xml
@@ -21,44 +21,89 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <parent>
-        <artifactId>persistence</artifactId>
-        <groupId>org.apache.usergrid</groupId>
-        <version>1.0-SNAPSHOT</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <artifactId>persistence</artifactId>
+    <groupId>org.apache.usergrid</groupId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
 
-    <artifactId>graph</artifactId>
+  <artifactId>graph</artifactId>
 
-    <dependencies>
+  <dependencies>
 
-        <dependency>
-            <groupId>org.apache.usergrid</groupId>
-            <artifactId>collection</artifactId>
-            <version>${project.version}</version>
-        </dependency>
+    <dependency>
+      <groupId>org.apache.usergrid</groupId>
+      <artifactId>collection</artifactId>
+      <version>${project.version}</version>
+    </dependency>
 
-        <dependency>
-            <groupId>org.apache.usergrid</groupId>
-            <artifactId>collection</artifactId>
-            <version>${project.version}</version>
-            <type>test-jar</type>
-            <scope>test</scope>
-        </dependency>
+    <dependency>
+      <groupId>org.apache.usergrid</groupId>
+      <artifactId>collection</artifactId>
+      <version>${project.version}</version>
+      <type>test-jar</type>
+      <scope>test</scope>
+    </dependency>
 
-        <dependency>
-            <groupId>org.jukito</groupId>
-            <artifactId>jukito</artifactId>
-            <version>${jukito.version}</version>
-            <scope>test</scope>
-        </dependency>
+    <dependency>
+      <groupId>org.jukito</groupId>
+      <artifactId>jukito</artifactId>
+      <version>${jukito.version}</version>
+      <scope>test</scope>
+    </dependency>
 
-        <dependency>
-            <groupId>com.netflix.hystrix</groupId>
-            <artifactId>hystrix-core</artifactId>
-            <version>${hystrix.version}</version>
-        </dependency>
+    <dependency>
+      <groupId>com.netflix.hystrix</groupId>
+      <artifactId>hystrix-core</artifactId>
+      <version>${hystrix.version}</version>
+    </dependency>
 
-    </dependencies>
+  </dependencies>
 
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.safehaus.chop</groupId>
+        <artifactId>chop-maven-plugin</artifactId>
+        <version>${chop.version}</version>
+
+        <!--
+        NOTE: you should be putting most of these variables into your settings.xml
+        as an automatically activated profile.
+        -->
+
+        <configuration>
+          <accessKey>${aws.s3.key}</accessKey>
+          <secretKey>${aws.s3.secret}</secretKey>
+          <availabilityZone>${availabilityZone}</availabilityZone>
+          <bucketName>${aws.s3.bucket}</bucketName>
+          <managerAppUsername>admin</managerAppUsername>
+          <managerAppPassword>${manager.app.password}</managerAppPassword>
+          <testPackageBase>org.apache.usergrid</testPackageBase>
+          <runnerSSHKeyFile>${runner.ssh.key.file}</runnerSSHKeyFile>
+          <failIfCommitNecessary>false</failIfCommitNecessary>
+          <amiID>${ami.id}</amiID>
+          <instanceType>m1.large</instanceType>
+          <resultsDirectory>${resultsDirectory}</resultsDirectory>
+          <dumpType>${dumpType}</dumpType>
+          <coldRestartTomcat>true</coldRestartTomcat>
+          <awsSecurityGroup>${security.group}</awsSecurityGroup>
+          <runnerKeyPairName>${runner.keypair.name}</runnerKeyPairName>
+          <runnerCount>6</runnerCount>
+          <runnerName>${runner.name}</runnerName>
+          <securityGroupExceptions>
+            <!--
+            Add your own IP address as an exception to allow access
+            but please do this in the settings.xml file .. essentially
+            all parameters should be in the settings.xml file.
+            -->
+            <param>${myip.address}/32:24981</param>
+            <param>${myip.address}/32:22</param>
+          </securityGroupExceptions>
+        </configuration>
+      </plugin>
+
+    </plugins>
+  </build>
 </project>

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ffefd72a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/GraphFig.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/GraphFig.java
b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/GraphFig.java
new file mode 100644
index 0000000..e96f22e
--- /dev/null
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/GraphFig.java
@@ -0,0 +1,19 @@
+package org.apache.usergrid.persistence.graph;
+
+
+import org.safehaus.guicyfig.Default;
+import org.safehaus.guicyfig.GuicyFig;
+import org.safehaus.guicyfig.Key;
+
+
+/**
+ *
+ *
+ */
+public interface GraphFig extends GuicyFig {
+
+    @Default( "1000" )
+    @Key( "usergrid.graph.scan.page.size" )
+    int getScanPageSize();
+}
+

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ffefd72a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/guice/GraphModule.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/guice/GraphModule.java
b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/guice/GraphModule.java
index 6690356..87ae453 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/guice/GraphModule.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/guice/GraphModule.java
@@ -20,11 +20,14 @@
 package org.apache.usergrid.persistence.graph.guice;
 
 
+import org.safehaus.guicyfig.GuicyFigModule;
+
 import org.apache.usergrid.persistence.collection.guice.CollectionModule;
 import org.apache.usergrid.persistence.collection.migration.Migration;
 import org.apache.usergrid.persistence.collection.mvcc.event.PostProcessObserver;
 import org.apache.usergrid.persistence.graph.EdgeManager;
 import org.apache.usergrid.persistence.graph.EdgeManagerFactory;
+import org.apache.usergrid.persistence.graph.GraphFig;
 import org.apache.usergrid.persistence.graph.impl.CollectionIndexObserver;
 import org.apache.usergrid.persistence.graph.impl.EdgeManagerImpl;
 import org.apache.usergrid.persistence.graph.serialization.EdgeMetadataSerialization;
@@ -49,6 +52,9 @@ public class GraphModule extends AbstractModule {
         //configure collections and our core astyanax framework
         install(new CollectionModule());
 
+        //install our configuration
+        install (new GuicyFigModule( GraphFig.class ));
+
         bind( PostProcessObserver.class ).to( CollectionIndexObserver.class );
 
         bind( EdgeMetadataSerialization.class).to( EdgeMetadataSerializationImpl.class);

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ffefd72a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgeMetadataSerializationImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgeMetadataSerializationImpl.java
b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgeMetadataSerializationImpl.java
index c9d3f6c..0323a1f 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgeMetadataSerializationImpl.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgeMetadataSerializationImpl.java
@@ -37,6 +37,7 @@ import org.apache.usergrid.persistence.collection.astyanax.ScopedRowKey;
 import org.apache.usergrid.persistence.collection.migration.Migration;
 import org.apache.usergrid.persistence.collection.mvcc.entity.ValidationUtils;
 import org.apache.usergrid.persistence.graph.Edge;
+import org.apache.usergrid.persistence.graph.GraphFig;
 import org.apache.usergrid.persistence.graph.SearchEdgeType;
 import org.apache.usergrid.persistence.graph.SearchIdType;
 import org.apache.usergrid.persistence.graph.serialization.EdgeMetadataSerialization;
@@ -66,8 +67,6 @@ public class EdgeMetadataSerializationImpl implements EdgeMetadataSerialization,
 
     private static final byte[] HOLDER = new byte[] { 0 };
 
-    //TODO, make this a config property?
-    private static final int PAGE_SIZE = 100;
 
     //row key serializers
     private static final IdRowCompositeSerializer ID_SER = IdRowCompositeSerializer.get();
@@ -103,12 +102,16 @@ public class EdgeMetadataSerializationImpl implements EdgeMetadataSerialization,
                     EDGE_TYPE_ROW_KEY, STRING_SERIALIZER );
 
 
+
     protected final Keyspace keyspace;
+    private final GraphFig graphFig;
+
 
 
     @Inject
-    public EdgeMetadataSerializationImpl( final Keyspace keyspace ) {
+    public EdgeMetadataSerializationImpl( final Keyspace keyspace, final GraphFig graphFig)
{
         this.keyspace = keyspace;
+        this.graphFig = graphFig;
     }
 
 
@@ -291,7 +294,7 @@ public class EdgeMetadataSerializationImpl implements EdgeMetadataSerialization,
 
 
         final RangeBuilder rangeBuilder =
-                new RangeBuilder().setLimit( PAGE_SIZE ).setStart( search.getLast().or( ""
) );
+                new RangeBuilder().setLimit( graphFig.getScanPageSize() ).setStart( search.getLast().or(
"" ) );
 
         RowQuery<ScopedRowKey<OrganizationScope, Id>, String> query =
                 keyspace.prepareQuery( cf ).getKey( sourceKey ).autoPaginate( true )
@@ -333,7 +336,7 @@ public class EdgeMetadataSerializationImpl implements EdgeMetadataSerialization,
 
         //resume from the last if specified.  Also set the range
         final ByteBufferRange searchRange =
-                new RangeBuilder().setLimit( PAGE_SIZE ).setStart( search.getLast().or( ""
) ).build();
+                new RangeBuilder().setLimit( graphFig.getScanPageSize() ).setStart( search.getLast().or(
"" ) ).build();
 
         RowQuery<ScopedRowKey<OrganizationScope, EdgeIdTypeKey>, String> query
=
                 keyspace.prepareQuery( cf ).getKey( sourceTypeKey ).autoPaginate( true ).withColumnRange(
searchRange );

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ffefd72a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgeSerializationImpl.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgeSerializationImpl.java
b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgeSerializationImpl.java
index 73bf96a..7cd0753 100644
--- a/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgeSerializationImpl.java
+++ b/stack/corepersistence/graph/src/main/java/org/apache/usergrid/persistence/graph/serialization/impl/EdgeSerializationImpl.java
@@ -41,6 +41,7 @@ import org.apache.usergrid.persistence.collection.cassandra.ColumnTypes;
 import org.apache.usergrid.persistence.collection.migration.Migration;
 import org.apache.usergrid.persistence.collection.mvcc.entity.ValidationUtils;
 import org.apache.usergrid.persistence.graph.Edge;
+import org.apache.usergrid.persistence.graph.GraphFig;
 import org.apache.usergrid.persistence.graph.SearchByEdge;
 import org.apache.usergrid.persistence.graph.SearchByEdgeType;
 import org.apache.usergrid.persistence.graph.SearchByIdType;
@@ -76,8 +77,7 @@ import com.netflix.astyanax.util.RangeBuilder;
 @Singleton
 public class EdgeSerializationImpl implements EdgeSerialization, Migration {
 
-    //TODO, make this a config property?
-    private static final int PAGE_SIZE = 100;
+
 
     //holder to put data into col value
     private static final byte[] HOLDER = new byte[] { 0 };
@@ -128,11 +128,13 @@ public class EdgeSerializationImpl implements EdgeSerialization, Migration
{
 
 
     protected final Keyspace keyspace;
+    protected final GraphFig graphFig;
 
 
     @Inject
-    public EdgeSerializationImpl( final Keyspace keyspace ) {
+    public EdgeSerializationImpl( final Keyspace keyspace, final GraphFig graphFig ) {
         this.keyspace = keyspace;
+        this.graphFig = graphFig;
     }
 
 
@@ -452,7 +454,7 @@ public class EdgeSerializationImpl implements EdgeSerialization, Migration
{
          * If the edge is present, we need to being seeking from this
          */
 
-        final RangeBuilder rangeBuilder = new RangeBuilder().setLimit( PAGE_SIZE );
+        final RangeBuilder rangeBuilder = new RangeBuilder().setLimit( graphFig.getScanPageSize()
);
 
 
         //set the range into the search

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ffefd72a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/EdgeSerializationChopTest.java
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/EdgeSerializationChopTest.java
b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/EdgeSerializationChopTest.java
new file mode 100644
index 0000000..95346ce
--- /dev/null
+++ b/stack/corepersistence/graph/src/test/java/org/apache/usergrid/persistence/graph/serialization/EdgeSerializationChopTest.java
@@ -0,0 +1,126 @@
+package org.apache.usergrid.persistence.graph.serialization;
+
+
+import java.util.Iterator;
+import java.util.UUID;
+
+import org.jukito.JukitoRunner;
+import org.jukito.UseModules;
+import org.junit.Before;
+import org.junit.ClassRule;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.safehaus.chop.api.IterationChop;
+
+import org.apache.usergrid.persistence.collection.OrganizationScope;
+import org.apache.usergrid.persistence.collection.cassandra.CassandraRule;
+import org.apache.usergrid.persistence.collection.guice.MigrationManagerRule;
+import org.apache.usergrid.persistence.graph.Edge;
+import org.apache.usergrid.persistence.graph.SearchByEdge;
+import org.apache.usergrid.persistence.graph.guice.GraphModule;
+import org.apache.usergrid.persistence.model.entity.Id;
+import org.apache.usergrid.persistence.model.util.UUIDGenerator;
+
+import com.google.inject.Inject;
+import com.netflix.astyanax.connectionpool.exceptions.ConnectionException;
+
+import static org.apache.usergrid.persistence.graph.test.util.EdgeTestUtils.createEdge;
+import static org.apache.usergrid.persistence.graph.test.util.EdgeTestUtils.createGetByEdge;
+import static org.apache.usergrid.persistence.graph.test.util.EdgeTestUtils.createId;
+import static org.apache.usergrid.persistence.graph.test.util.EdgeTestUtils.createSearchByEdge;
+import static org.apache.usergrid.persistence.graph.test.util.EdgeTestUtils.createSearchByEdgeAndId;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+
+/**
+ * Test for use with Judo CHOP to stress test
+ *
+ */
+@IterationChop( iterations = 10, threads = 2 )
+@RunWith( JukitoRunner.class )
+@UseModules( { GraphModule.class } )
+public class EdgeSerializationChopTest {
+
+    @ClassRule
+    public static CassandraRule rule = new CassandraRule();
+
+
+    @Inject
+    @Rule
+    public MigrationManagerRule migrationManagerRule;
+
+
+    @Inject
+    protected EdgeSerialization serialization;
+
+    protected OrganizationScope scope;
+
+
+
+    /**
+     * Static UUID so ALL nodes write to this as the source
+     */
+    private static final UUID ORG_ID = UUID.fromString("5697ad38-8dd8-11e3-8436-600308a690e3");
+
+
+
+    /**
+     * Static UUID so ALL nodes write to this as the source
+     */
+    private static final UUID SOURCE_NODE_ID = UUID.fromString("5697ad38-8dd8-11e3-8436-600308a690e2");
+
+
+    @Before
+    public void setup() {
+        scope = mock( OrganizationScope.class );
+
+        Id orgId = mock( Id.class );
+
+        when( orgId.getType() ).thenReturn( "organization" );
+        when( orgId.getUuid() ).thenReturn( ORG_ID );
+
+        when( scope.getOrganization() ).thenReturn( orgId );
+    }
+
+
+    /**
+     * Tests loading elements and retrieving them from the same source
+     */
+    @Test
+    public void mixedEdgeTypes() throws ConnectionException {
+
+
+        final Id sourceId = createId( SOURCE_NODE_ID, "source");
+        final Id targetId = createId("target");
+
+
+        final Edge edge = createEdge( sourceId, "edge", targetId );
+
+        serialization.writeEdge( scope, edge ).execute();
+
+
+        UUID now = UUIDGenerator.newTimeUUID();
+
+        //get our edges out by name
+
+        Iterator<Edge> results = serialization.getEdgesFromSource( scope, createSearchByEdge(
sourceId, "edge", now, null ) );
+
+        boolean found = false;
+
+        while(!found && results.hasNext()){
+            if(edge.equals(results.next())){
+                found = true;
+                break;
+            }
+        }
+
+        assertTrue("Found entity", found);
+
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ffefd72a/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 b196844..012c8b8 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
@@ -39,17 +39,18 @@ import org.apache.usergrid.persistence.model.util.UUIDGenerator;
 
 
 /**
- *  Simple class for edge testing generation
- *
+ * Simple class for edge testing generation
  */
 public class EdgeTestUtils {
 
 
     /**
      * Create an edge for testing
+     *
      * @param sourceType The source type to use in the id
      * @param edgeType The edge type to use
      * @param targetType The target type to use
+     *
      * @return an Edge for testing
      */
     public static Edge createEdge( final String sourceType, final String edgeType, final
String targetType ) {
@@ -59,35 +60,36 @@ public class EdgeTestUtils {
 
     /**
      * Create an edge for testing
-     * @param sourceId
-     * @param edgeType
-     * @param targetId
-     * @return
      */
-    public static Edge createEdge(final Id sourceId, final String edgeType, final Id targetId){
-        return  createEdge( sourceId, edgeType, targetId, UUIDGenerator.newTimeUUID() );
+    public static Edge createEdge( final Id sourceId, final String edgeType, final Id targetId
) {
+        return createEdge( sourceId, edgeType, targetId, UUIDGenerator.newTimeUUID() );
     }
 
+
     /**
      * Create an edge with the specified params
-     * @param sourceId
-     * @param edgeType
-     * @param targetId
-     * @param version
-     * @return
      */
-    public static Edge createEdge(final Id sourceId, final String edgeType, final Id targetId,
final UUID version){
-       return new SimpleEdge( sourceId, edgeType, targetId, version );
+    public static Edge createEdge( final Id sourceId, final String edgeType, final Id targetId,
final UUID version ) {
+        return new SimpleEdge( sourceId, edgeType, targetId, version );
     }
 
 
     /**
      * Create the id
-     * @param type
-     * @return
      */
-    public static Id createId(String type){
-       return new SimpleId( UUIDGenerator.newTimeUUID(), type );
+    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 );
     }
 
 
@@ -100,7 +102,7 @@ public class EdgeTestUtils {
      * @return
      */
     public static SearchByEdgeType createSearchByEdge( final Id sourceId, final String type,
final UUID maxVersion,
-                                                 final Edge last ) {
+                                                       final Edge last ) {
         return new SimpleSearchByEdgeType( sourceId, type, maxVersion, last );
     }
 
@@ -115,7 +117,7 @@ public class EdgeTestUtils {
      * @return
      */
     public static SearchByIdType createSearchByEdgeAndId( final Id sourceId, final String
type, final UUID maxVersion,
-                                                    final String idType, final Edge last
) {
+                                                          final String idType, final Edge
last ) {
         return new SimpleSearchByIdType( sourceId, type, maxVersion, idType, last );
     }
 
@@ -133,11 +135,6 @@ public class EdgeTestUtils {
 
     /**
      * Create the search by Id type
-     *
-     * @param sourceId
-     * @param type
-     * @param last
-     * @return
      */
     public static SimpleSearchIdType createSearchIdType( final Id sourceId, final String
type, final String last ) {
         return new SimpleSearchIdType( sourceId, type, last );
@@ -146,18 +143,11 @@ public class EdgeTestUtils {
 
     /**
      * Get the edge by type
-     * @param sourceId
-     * @param type
-     * @param targetId
-     * @param maxVersion
-     * @param last
-     * @return
      */
-    public static SearchByEdge createGetByEdge( final Id sourceId, final String type, final
Id targetId, final UUID maxVersion,
-                                                 final Edge last ) {
+    public static SearchByEdge createGetByEdge( final Id sourceId, final String type, final
Id targetId,
+                                                final UUID maxVersion, final Edge last )
{
         return new SimpleSearchByEdge( sourceId, type, targetId, maxVersion, last );
     }
-
 }
 
 

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ffefd72a/stack/corepersistence/graph/src/test/resources/usergrid-CHOP.properties
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/test/resources/usergrid-CHOP.properties b/stack/corepersistence/graph/src/test/resources/usergrid-CHOP.properties
new file mode 100644
index 0000000..d9c72be
--- /dev/null
+++ b/stack/corepersistence/graph/src/test/resources/usergrid-CHOP.properties
@@ -0,0 +1,12 @@
+# These are for CHOP environment settings
+
+cassandra.connections=20
+cassandra.port=9160
+cassandra.version=1.2
+
+# a comma delimited private IP address list to your chop cassandra cluster
+# define this in your settings.xml and have it as an always active profile
+cassandra.hosts=${chop.cassandra.hosts}
+cassandra.cluster_name=Usergrid
+collections.keyspace=Usergrid_Collections
+cassandra.timeout=5000

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ffefd72a/stack/corepersistence/graph/src/test/resources/usergrid-UNIT.properties
----------------------------------------------------------------------
diff --git a/stack/corepersistence/graph/src/test/resources/usergrid-UNIT.properties b/stack/corepersistence/graph/src/test/resources/usergrid-UNIT.properties
new file mode 100644
index 0000000..6a5013c
--- /dev/null
+++ b/stack/corepersistence/graph/src/test/resources/usergrid-UNIT.properties
@@ -0,0 +1 @@
+# Keep nothing but overriding test defaults in here
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/ffefd72a/stack/corepersistence/pom.xml
----------------------------------------------------------------------
diff --git a/stack/corepersistence/pom.xml b/stack/corepersistence/pom.xml
index 16288a7..c21de90 100644
--- a/stack/corepersistence/pom.xml
+++ b/stack/corepersistence/pom.xml
@@ -2,68 +2,82 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
+  <modelVersion>4.0.0</modelVersion>
 
-    <name>core-persistence</name>
-    <description>Prototype for refactoring persistence of usergrid</description>
+  <name>core-persistence</name>
+  <description>Prototype for refactoring persistence of usergrid</description>
 
-    <groupId>org.apache.usergrid</groupId>
-    <artifactId>persistence</artifactId>
-    <packaging>pom</packaging>
-    <version>1.0-SNAPSHOT</version>
+  <groupId>org.apache.usergrid</groupId>
+  <artifactId>persistence</artifactId>
+  <packaging>pom</packaging>
+  <version>1.0-SNAPSHOT</version>
 
-    <properties>
-        <astyanax.version>1.56.48</astyanax.version>
-        <jukito.version>1.4-UG</jukito.version>
-        <guice.version>3.0</guice.version>
-        <archaius.version>0.5.12</archaius.version>
-        <slf4j.version>1.7.2</slf4j.version>
-        <log4j.version>1.2.17</log4j.version>
-        <rx.version>0.15.1</rx.version>
-        <hystrix.version>1.3.8</hystrix.version>
-        <guicyfig.version>3.2</guicyfig.version>
-    </properties>
+  <properties>
+    <astyanax.version>1.56.48</astyanax.version>
+    <jukito.version>1.4-UG</jukito.version>
+    <guice.version>3.0</guice.version>
+    <archaius.version>0.5.12</archaius.version>
+    <slf4j.version>1.7.2</slf4j.version>
+    <log4j.version>1.2.17</log4j.version>
+    <rx.version>0.15.1</rx.version>
+    <hystrix.version>1.3.8</hystrix.version>
+    <guicyfig.version>3.2</guicyfig.version>
+    <chop.version>1.0</chop.version>
+  </properties>
 
-    <modules>
-        <module>model</module>
-        <module>graph</module>
-        <module>collection</module>
-    </modules>
+  <modules>
+    <module>model</module>
+    <module>graph</module>
+    <module>collection</module>
+  </modules>
 
-    <build>
+  <build>
 
-        <pluginManagement>
-            <plugins>
-                <plugin>
-                    <groupId>org.apache.maven.plugins</groupId>
-                    <artifactId>maven-surefire-plugin</artifactId>
-                    <version>2.16</version>
-                </plugin>
-            </plugins>
-        </pluginManagement>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-surefire-plugin</artifactId>
+          <version>2.16</version>
+        </plugin>
+      </plugins>
+    </pluginManagement>
 
-        <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-surefire-plugin</artifactId>
-                <version>2.16</version>
-                <configuration>
-                    <includes>
-                        <include>**/*Test.java</include>
-                        <include>**/*IT.java</include>
-                    </includes>
-                </configuration>
-            </plugin>
-        </plugins>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <version>2.16</version>
+        <configuration>
+          <includes>
+            <include>**/*Test.java</include>
+            <include>**/*IT.java</include>
+          </includes>
+        </configuration>
+      </plugin>
 
-    </build>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jar-plugin</artifactId>
+        <version>2.4</version>
+        <executions>
+          <execution>
+            <goals>
+              <goal>test-jar</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
 
-    <repositories>
-        <repository>
-            <id>local-dependencies</id>
-            <name>local-depedendencies</name>
-            <url>file://${project.basedir}/../m2/repository</url>
-        </repository>
-    </repositories>
+  </build>
+
+  <repositories>
+    <repository>
+      <id>local-dependencies</id>
+      <name>local-depedendencies</name>
+      <url>file://${project.basedir}/../m2/repository</url>
+    </repository>
+  </repositories>
 
 </project>


Mime
View raw message