| /* |
| * 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.hugegraph.tinkerpop; |
| |
| import org.apache.hugegraph.dist.RegisterUtil; |
| import org.apache.tinkerpop.gremlin.AbstractGremlinSuite; |
| import org.apache.tinkerpop.gremlin.GraphManager; |
| import org.apache.tinkerpop.gremlin.GraphProvider; |
| import org.apache.tinkerpop.gremlin.algorithm.generator.CommunityGeneratorTest; |
| import org.apache.tinkerpop.gremlin.algorithm.generator.DistributionGeneratorTest; |
| import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine; |
| import org.apache.tinkerpop.gremlin.structure.EdgeTest; |
| import org.apache.tinkerpop.gremlin.structure.FeatureSupportTest; |
| import org.apache.tinkerpop.gremlin.structure.GraphConstructionTest; |
| import org.apache.tinkerpop.gremlin.structure.GraphTest; |
| import org.apache.tinkerpop.gremlin.structure.PropertyTest; |
| import org.apache.tinkerpop.gremlin.structure.SerializationTest; |
| import org.apache.tinkerpop.gremlin.structure.TransactionTest; |
| import org.apache.tinkerpop.gremlin.structure.VariablesTest; |
| import org.apache.tinkerpop.gremlin.structure.VertexPropertyTest; |
| import org.apache.tinkerpop.gremlin.structure.VertexTest; |
| import org.apache.tinkerpop.gremlin.structure.io.IoCustomTest; |
| import org.apache.tinkerpop.gremlin.structure.io.IoEdgeTest; |
| import org.apache.tinkerpop.gremlin.structure.io.IoGraphTest; |
| import org.apache.tinkerpop.gremlin.structure.io.IoPropertyTest; |
| import org.apache.tinkerpop.gremlin.structure.io.IoTest; |
| import org.apache.tinkerpop.gremlin.structure.io.IoVertexTest; |
| import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedEdgeTest; |
| import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedGraphTest; |
| import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedPropertyTest; |
| import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertexPropertyTest; |
| import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertexTest; |
| import org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceEdgeTest; |
| import org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceGraphTest; |
| import org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceVertexPropertyTest; |
| import org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceVertexTest; |
| import org.apache.tinkerpop.gremlin.structure.util.star.StarGraphTest; |
| import org.junit.runners.model.InitializationError; |
| import org.junit.runners.model.RunnerBuilder; |
| import org.junit.runners.model.Statement; |
| |
| /** |
| * Standard structure test suite for tinkerpop graph |
| * |
| * @author Stephen Mallette (http://stephen.genoprime.com) |
| */ |
| public class StructureBasicSuite extends AbstractGremlinSuite { |
| /** |
| * This list of tests in the suite that will be executed. |
| * Gremlin developers should add to this list |
| * as needed to enforce tests upon implementations. |
| */ |
| private static final Class<?>[] ALL_TESTS = new Class<?>[] { |
| CommunityGeneratorTest.class, |
| DetachedGraphTest.class, |
| DetachedEdgeTest.class, |
| DetachedVertexPropertyTest.class, |
| DetachedPropertyTest.class, |
| DetachedVertexTest.class, |
| DistributionGeneratorTest.class, |
| EdgeTest.class, |
| FeatureSupportTest.class, |
| IoCustomTest.class, |
| IoEdgeTest.class, |
| IoGraphTest.class, |
| IoVertexTest.class, |
| IoPropertyTest.class, |
| GraphTest.class, |
| GraphConstructionTest.class, |
| IoTest.class, |
| VertexPropertyTest.class, |
| VariablesTest.class, |
| PropertyTest.class, |
| ReferenceGraphTest.class, |
| ReferenceEdgeTest.class, |
| ReferenceVertexPropertyTest.class, |
| ReferenceVertexTest.class, |
| SerializationTest.class, |
| StarGraphTest.class, |
| TransactionTest.class, |
| VertexTest.class |
| }; |
| |
| public StructureBasicSuite(final Class<?> klass, |
| final RunnerBuilder builder) |
| throws InitializationError { |
| super(klass, builder, ALL_TESTS, null, true, |
| TraversalEngine.Type.STANDARD); |
| |
| RegisterUtil.registerBackends(); |
| } |
| |
| @Override |
| protected Statement withAfterClasses(final Statement statement) { |
| Statement wrappedStatement = new Statement() { |
| @Override |
| public void evaluate() throws Throwable { |
| statement.evaluate(); |
| GraphProvider gp = GraphManager.setGraphProvider(null); |
| ((TestGraphProvider) gp).clear(); |
| GraphManager.setGraphProvider(gp); |
| } |
| }; |
| return super.withAfterClasses(wrappedStatement); |
| } |
| } |