Search in sources :

Example 21 with SqlgVertexStep

use of org.umlg.sqlg.step.SqlgVertexStep in project sqlg by pietermartin.

the class BaseTest method assertStep.

protected void assertStep(Step<?, ?> step, boolean isGraph, boolean isEagerLoad, boolean isForMultipleQueries, boolean comparatorsNotOnDb) {
    if (isGraph) {
        Assert.assertTrue("Expected SqlgGraphStep, found " + step.getClass().getName(), step instanceof SqlgGraphStep);
    } else {
        Assert.assertTrue("Expected SqlgVertexStep, found " + step.getClass().getName(), step instanceof SqlgVertexStep);
    }
    SqlgStep sqlgStep = (SqlgStep) step;
    Assert.assertEquals("isEagerLoad should be " + isEagerLoad, isEagerLoad, sqlgStep.isEargerLoad());
    Assert.assertEquals("isForMultipleQueries should be " + isForMultipleQueries, isForMultipleQueries, sqlgStep.isForMultipleQueries());
    Assert.assertEquals("comparatorsNotOnDb should be " + comparatorsNotOnDb, comparatorsNotOnDb, sqlgStep.getReplacedSteps().stream().allMatch(r -> r.getDbComparators().isEmpty()));
}
Also used : Configuration(org.apache.commons.configuration.Configuration) CoreMatchers(org.hamcrest.CoreMatchers) Io(org.apache.tinkerpop.gremlin.structure.io.Io) java.util(java.util) Connection(java.sql.Connection) SqlgUtil(org.umlg.sqlg.util.SqlgUtil) TestRule(org.junit.rules.TestRule) URL(java.net.URL) LoggerFactory(org.slf4j.LoggerFactory) GraphSONIo(org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONIo) SqlgGraph(org.umlg.sqlg.structure.SqlgGraph) SqlgVertexStep(org.umlg.sqlg.step.SqlgVertexStep) SqlgStep(org.umlg.sqlg.step.SqlgStep) PropertyVetoException(java.beans.PropertyVetoException) SQLException(java.sql.SQLException) AbstractGremlinTest(org.apache.tinkerpop.gremlin.AbstractGremlinTest) ResultSet(java.sql.ResultSet) org.apache.tinkerpop.gremlin.structure(org.apache.tinkerpop.gremlin.structure) Assert.fail(org.junit.Assert.fail) PropertiesConfiguration(org.apache.commons.configuration.PropertiesConfiguration) IteratorUtils(org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils) MapHelper(org.apache.tinkerpop.gremlin.process.traversal.step.util.MapHelper) GraphSONVersion(org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONVersion) Logger(org.slf4j.Logger) Description(org.junit.runner.Description) IOException(java.io.IOException) StopWatch(org.apache.commons.lang3.time.StopWatch) GraphTraversal(org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal) Collectors(java.util.stream.Collectors) Step(org.apache.tinkerpop.gremlin.process.traversal.Step) TestWatcher(org.junit.rules.TestWatcher) TimeUnit(java.util.concurrent.TimeUnit) ReplacedStep(org.umlg.sqlg.sql.parse.ReplacedStep) Traversal(org.apache.tinkerpop.gremlin.process.traversal.Traversal) Statement(java.sql.Statement) org.junit(org.junit) GraphReader(org.apache.tinkerpop.gremlin.structure.io.GraphReader) ConfigurationException(org.apache.commons.configuration.ConfigurationException) GraphTraversalSource(org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource) SqlgGraphStep(org.umlg.sqlg.step.SqlgGraphStep) Assert.assertEquals(org.junit.Assert.assertEquals) InputStream(java.io.InputStream) SqlgStep(org.umlg.sqlg.step.SqlgStep) SqlgGraphStep(org.umlg.sqlg.step.SqlgGraphStep) SqlgVertexStep(org.umlg.sqlg.step.SqlgVertexStep)

Aggregations

SqlgVertexStep (org.umlg.sqlg.step.SqlgVertexStep)21 DefaultGraphTraversal (org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.DefaultGraphTraversal)19 Vertex (org.apache.tinkerpop.gremlin.structure.Vertex)19 Test (org.junit.Test)19 BaseTest (org.umlg.sqlg.test.BaseTest)19 SqlgLocalStepBarrier (org.umlg.sqlg.step.barrier.SqlgLocalStepBarrier)16 Path (org.apache.tinkerpop.gremlin.process.traversal.Path)12 SqlgGraphStep (org.umlg.sqlg.step.SqlgGraphStep)9 Traversal (org.apache.tinkerpop.gremlin.process.traversal.Traversal)8 SqlgOptionalStepBarrier (org.umlg.sqlg.step.barrier.SqlgOptionalStepBarrier)7 List (java.util.List)6 Collectors (java.util.stream.Collectors)6 org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__ (org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__)6 OrderGlobalStep (org.apache.tinkerpop.gremlin.process.traversal.step.map.OrderGlobalStep)6 IdentityStep (org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.IdentityStep)6 T (org.apache.tinkerpop.gremlin.structure.T)6 Assert (org.junit.Assert)6 Predicate (java.util.function.Predicate)5 Order (org.apache.tinkerpop.gremlin.process.traversal.Order)5 LocalStep (org.apache.tinkerpop.gremlin.process.traversal.step.branch.LocalStep)5