You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2015/08/13 22:03:33 UTC

[16/22] incubator-tinkerpop git commit: Fixed conflicting jettison version issue. Now generating test resources for all graphs in TP2 legacy GraphSON format. Still need to do adjacency flavor of legacy GraphSON.

Fixed conflicting jettison version issue. Now generating test resources for all graphs in TP2 legacy GraphSON format. Still need to do adjacency flavor of legacy GraphSON.


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

Branch: refs/heads/tp30-legson
Commit: 8119bc81b5cac42f29d7eab0d0bafc6b05230894
Parents: f11b4a4
Author: ebice <eb...@behaviormatrix.com>
Authored: Mon Jul 6 13:28:15 2015 -0400
Committer: ebice <eb...@behaviormatrix.com>
Committed: Mon Jul 6 13:28:15 2015 -0400

----------------------------------------------------------------------
 gremlin-core/pom.xml                            |  2 +-
 .../io/graphson/ElementPropertyConfig.java      | 26 +++++++++++---
 .../apache/tinkerpop/gremlin/LoadGraphWith.java | 37 +++++++++++++-------
 .../gremlin/hadoop/HadoopGraphProvider.java     | 15 ++++++--
 .../GraphSONLegacyRecordReaderTest.java         |  2 +-
 .../structure/IoDataGenerationTest.java         |  3 ++
 6 files changed, 64 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/8119bc81/gremlin-core/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-core/pom.xml b/gremlin-core/pom.xml
index af6c342..d67ddd8 100644
--- a/gremlin-core/pom.xml
+++ b/gremlin-core/pom.xml
@@ -106,7 +106,7 @@ limitations under the License.
         <dependency>
             <groupId>org.codehaus.jettison</groupId>
             <artifactId>jettison</artifactId>
-            <version>1.3.5</version>
+            <version>1.1</version>
         </dependency>
     </dependencies>
     <build>

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/8119bc81/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/ElementPropertyConfig.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/ElementPropertyConfig.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/ElementPropertyConfig.java
index 3c27560..57bb241 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/ElementPropertyConfig.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/ElementPropertyConfig.java
@@ -1,9 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.tinkerpop.gremlin.structure.io.graphson;
 
-        import java.util.ArrayList;
-        import java.util.Collections;
-        import java.util.List;
-        import java.util.Set;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
 
 /**
  * Configure how the GraphSON utility treats edge and vertex properties.

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/8119bc81/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/LoadGraphWith.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/LoadGraphWith.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/LoadGraphWith.java
index 944a972..b11c999 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/LoadGraphWith.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/LoadGraphWith.java
@@ -62,6 +62,11 @@ public @interface LoadGraphWith {
         CLASSIC,
 
         /**
+         * Classic in TinkerPop2 legacy format.
+         */
+        CLASSIC_TP2,
+
+        /**
          * Loads the "modern" TinkerPop toy graph which is like "classic", but with the "weight" value on edges stored
          * as double and labels added for vertices.  This should be the most commonly used graph instance for testing
          * as graphs that support string, double and int should comprise the largest number of implementations.
@@ -69,20 +74,30 @@ public @interface LoadGraphWith {
         MODERN,
 
         /**
+         * Modern in TinkerPop2 legacy format.
+         */
+        MODERN_TP2,
+
+        /**
          * Load "The Crew" TinkerPop3 toy graph which includes {@link org.apache.tinkerpop.gremlin.structure.VertexProperty} data.
          */
         CREW,
 
         /**
+         * Crew in TinkerPop2 legacy format.
+         */
+        CREW_TP2,
+
+        /**
          * Loads the "grateful dead" graph which is a "large" graph which provides for the construction of more
          * complex traversals.
          */
         GRATEFUL,
 
         /**
-         * Loads the "Graph of the Gods" graph which is a "toy" graph with 12 vertices and 17 edges.
+         * Grateful in TinkerPop2 legacy format.
          */
-        GODS;
+        GRATEFUL_TP2;
 
         private static final List<FeatureRequirement> featuresRequiredByClassic = new ArrayList<FeatureRequirement>() {{
             add(FeatureRequirement.Factory.create(FEATURE_STRING_VALUES, VertexPropertyFeatures.class));
@@ -109,14 +124,6 @@ public @interface LoadGraphWith {
             add(FeatureRequirement.Factory.create(FEATURE_INTEGER_VALUES, VertexPropertyFeatures.class));
         }};
 
-        private static final List<FeatureRequirement> featuresRequiredByGods = new ArrayList<FeatureRequirement>() {{
-            add(FeatureRequirement.Factory.create(FEATURE_STRING_VALUES, VertexPropertyFeatures.class));
-            add(FeatureRequirement.Factory.create(FEATURE_INTEGER_VALUES, VertexPropertyFeatures.class));
-            add(FeatureRequirement.Factory.create(FEATURE_BOOLEAN_VALUES, VertexPropertyFeatures.class));
-            add(FeatureRequirement.Factory.create(FEATURE_META_PROPERTIES, Graph.Features.VertexFeatures.class));
-            add(FeatureRequirement.Factory.create(FEATURE_MULTI_PROPERTIES, Graph.Features.VertexFeatures.class));
-        }};
-
         public String location() {
             switch (this) {
                 case CLASSIC:
@@ -136,14 +143,20 @@ public @interface LoadGraphWith {
             switch (this) {
                 case CLASSIC:
                     return featuresRequiredByClassic;
+                case CLASSIC_TP2:
+                    return featuresRequiredByClassic;
                 case CREW:
                     return featuresRequiredByCrew;
+                case CREW_TP2:
+                    return featuresRequiredByCrew;
                 case MODERN:
                     return featuresRequiredByModern;
+                case MODERN_TP2:
+                    return featuresRequiredByModern;
                 case GRATEFUL:
                     return featuresRequiredByGrateful;
-                case GODS:
-                    return featuresRequiredByGods;
+                case GRATEFUL_TP2:
+                    return featuresRequiredByGrateful;
             }
 
             throw new RuntimeException("No features for this GraphData type");

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/8119bc81/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/HadoopGraphProvider.java
----------------------------------------------------------------------
diff --git a/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/HadoopGraphProvider.java b/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/HadoopGraphProvider.java
index 65bb87b..68f62cd 100644
--- a/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/HadoopGraphProvider.java
+++ b/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/HadoopGraphProvider.java
@@ -68,10 +68,13 @@ public class HadoopGraphProvider extends AbstractGraphProvider {
 
             final List<String> graphsonResources = Arrays.asList(
                     "tinkerpop-modern.json",
+                    "tinkerpop2-modern.json",
                     "grateful-dead.json",
+                    "grateful-dead-tp2.json",
                     "tinkerpop-classic.json",
+                    "tinkerpop2-classic.json",
                     "tinkerpop-crew.json",
-                    "graph-of-gods.json");
+                    "tinkerpop2-crew.json");
             for (final String fileName : graphsonResources) {
                 PATHS.put(fileName, TestHelper.generateTempFileFromResource(GraphSONResourceAccess.class, fileName, "").getAbsolutePath());
             }
@@ -142,14 +145,20 @@ public class HadoopGraphProvider extends AbstractGraphProvider {
 
         if (graphData.equals(LoadGraphWith.GraphData.GRATEFUL)) {
             ((HadoopGraph) g).configuration().setInputLocation(PATHS.get("grateful-dead." + type));
+        } else if (graphData.equals(LoadGraphWith.GraphData.GRATEFUL_TP2) && type.equals("json")) {
+            ((HadoopGraph) g).configuration().setInputLocation(PATHS.get("grateful-dead-tp2." + type));
         } else if (graphData.equals(LoadGraphWith.GraphData.MODERN)) {
             ((HadoopGraph) g).configuration().setInputLocation(PATHS.get("tinkerpop-modern." + type));
+        } else if (graphData.equals(LoadGraphWith.GraphData.MODERN_TP2) && type.equals("json")) {
+            ((HadoopGraph) g).configuration().setInputLocation(PATHS.get("tinkerpop2-modern." + type));
         } else if (graphData.equals(LoadGraphWith.GraphData.CLASSIC)) {
             ((HadoopGraph) g).configuration().setInputLocation(PATHS.get("tinkerpop-classic." + type));
+        } else if (graphData.equals(LoadGraphWith.GraphData.CLASSIC_TP2) && type.equals("json")) {
+            ((HadoopGraph) g).configuration().setInputLocation(PATHS.get("tinkerpop2-classic." + type));
         } else if (graphData.equals(LoadGraphWith.GraphData.CREW)) {
             ((HadoopGraph) g).configuration().setInputLocation(PATHS.get("tinkerpop-crew." + type));
-        } else if (graphData.equals(LoadGraphWith.GraphData.GODS) && type.equals("json")) {
-            ((HadoopGraph) g).configuration().setInputLocation(PATHS.get("graph-of-gods." + type));
+        } else if (graphData.equals(LoadGraphWith.GraphData.CREW_TP2) && type.equals("json")) {
+            ((HadoopGraph) g).configuration().setInputLocation(PATHS.get("tinkerpop2-crew." + type));
         } else {
             throw new RuntimeException("Could not load graph with " + graphData);
         }

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/8119bc81/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/graphson/GraphSONLegacyRecordReaderTest.java
----------------------------------------------------------------------
diff --git a/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/graphson/GraphSONLegacyRecordReaderTest.java b/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/graphson/GraphSONLegacyRecordReaderTest.java
index 47fde12..618c414 100644
--- a/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/graphson/GraphSONLegacyRecordReaderTest.java
+++ b/hadoop-gremlin/src/test/java/org/apache/tinkerpop/gremlin/hadoop/structure/io/graphson/GraphSONLegacyRecordReaderTest.java
@@ -32,7 +32,7 @@ public class GraphSONLegacyRecordReaderTest extends RecordReaderWriterTest {
 
     @Override
     protected String getInputFilename() {
-        return "graph-of-gods.json";
+        return "grateful-dead-tp2.json";
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/8119bc81/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/IoDataGenerationTest.java
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/IoDataGenerationTest.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/IoDataGenerationTest.java
index 7882778..9111b80 100644
--- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/IoDataGenerationTest.java
+++ b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/IoDataGenerationTest.java
@@ -35,6 +35,7 @@ import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONWriter;
 import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoReader;
 import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoWriter;
 import org.junit.BeforeClass;
+import org.junit.Ignore;
 import org.junit.Test;
 
 import java.io.*;
@@ -110,6 +111,7 @@ public class IoDataGenerationTest {
     }
 
     /**
+     *
      * No assertions.  Just write out the graph for convenience.
      */
     @Test
@@ -162,6 +164,7 @@ public class IoDataGenerationTest {
     /**
      * No assertions.  Just write out the graph for convenience.
      */
+    @Ignore
     @Test
     public void shouldWriteCrewGraphAsTP2GraphSONNoTypes() throws IOException {
         final OutputStream os = new FileOutputStream(tempPath + "tinkerpop2-crew.json");