tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From spmalle...@apache.org
Subject [1/2] tinkerpop git commit: Added a check to ignore a test if graphml.org is down.
Date Sun, 28 Aug 2016 01:15:01 GMT
Repository: tinkerpop
Updated Branches:
  refs/heads/master b1afafa82 -> e31a2cb46


Added a check to ignore a test if graphml.org is down.

There is an xml validation check in the test and if that site is down the test will fail.
CTR


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

Branch: refs/heads/master
Commit: 4f6e76913f61e39ca31f2ee63a337642440bb43e
Parents: b1afafa
Author: Stephen Mallette <spmva@genoprime.com>
Authored: Sat Aug 27 21:11:44 2016 -0400
Committer: Stephen Mallette <spmva@genoprime.com>
Committed: Sat Aug 27 21:11:44 2016 -0400

----------------------------------------------------------------------
 .../tinkerpop/gremlin/structure/io/IoTest.java      | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4f6e7691/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
index 6d21c2b..ca79264 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/io/IoTest.java
@@ -72,6 +72,7 @@ import java.io.OutputStream;
 import java.io.Reader;
 import java.io.StringWriter;
 import java.io.Writer;
+import java.net.URL;
 import java.util.List;
 import java.util.UUID;
 
@@ -80,10 +81,12 @@ import static org.apache.tinkerpop.gremlin.structure.Graph.Features.VariableFeat
 import static org.apache.tinkerpop.gremlin.structure.Graph.Features.VertexFeatures.FEATURE_USER_SUPPLIED_IDS;
 import static org.apache.tinkerpop.gremlin.structure.Graph.Features.VertexPropertyFeatures.*;
 import static org.apache.tinkerpop.gremlin.structure.io.IoCore.graphson;
+import static org.hamcrest.core.Is.is;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
+import static org.junit.Assume.assumeThat;
 
 /**
  * @author Joshua Shinavier (http://fortytwo.net)
@@ -232,6 +235,8 @@ public class IoTest {
         @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature =
FEATURE_USER_SUPPLIED_IDS)
         @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature =
Graph.Features.VertexFeatures.FEATURE_STRING_IDS)
         public void shouldProperlyEncodeWithGraphML() throws Exception {
+            assumeThat("GraphML web site is down so XSD cannot be retrieved", is(isGraphMLXSDPresent()));
+
             final Vertex v = graph.addVertex(T.id, "1");
             v.property(VertexProperty.Cardinality.single, "text", "\u00E9");
 
@@ -286,6 +291,17 @@ public class IoTest {
             assertEquals(IteratorUtils.count(source.vertices()), IteratorUtils.count(target.vertices()));
             assertEquals(IteratorUtils.count(source.edges()), IteratorUtils.count(target.edges()));
         }
+
+        private boolean isGraphMLXSDPresent() {
+            // when the graphml website goes down then tests won't pass - this allows the
tests that rely on this
+            // resource to conditionally run
+            try {
+                new URL("http://graphml.graphdrawing.org/xmlns/1.1/graphml-structure.xsd").openConnection().connect();
+                return true;
+            } catch (Exception ex) {
+                return false;
+            }
+        }
     }
 
     public static final class GryoTest extends AbstractGremlinTest {


Mime
View raw message