Search in sources :

Example 1 with SqlgStep

use of org.umlg.sqlg.step.SqlgStep 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

PropertyVetoException (java.beans.PropertyVetoException)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 URL (java.net.URL)1 Connection (java.sql.Connection)1 ResultSet (java.sql.ResultSet)1 SQLException (java.sql.SQLException)1 Statement (java.sql.Statement)1 java.util (java.util)1 TimeUnit (java.util.concurrent.TimeUnit)1 Collectors (java.util.stream.Collectors)1 Configuration (org.apache.commons.configuration.Configuration)1 ConfigurationException (org.apache.commons.configuration.ConfigurationException)1 PropertiesConfiguration (org.apache.commons.configuration.PropertiesConfiguration)1 StopWatch (org.apache.commons.lang3.time.StopWatch)1 AbstractGremlinTest (org.apache.tinkerpop.gremlin.AbstractGremlinTest)1 Step (org.apache.tinkerpop.gremlin.process.traversal.Step)1 Traversal (org.apache.tinkerpop.gremlin.process.traversal.Traversal)1 GraphTraversal (org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal)1 GraphTraversalSource (org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource)1