org.apache.tinkerpop.gremlin.structure.util.wrapped.WrappedGraph Java Examples

The following examples show how to use org.apache.tinkerpop.gremlin.structure.util.wrapped.WrappedGraph. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AbstractTitanGraphProvider.java    From titan1withtp3.1 with Apache License 2.0 6 votes vote down vote up
@Override
public void clear(Graph g, final Configuration configuration) throws Exception {
    if (null != g) {
        while (g instanceof WrappedGraph) g = ((WrappedGraph<? extends Graph>) g).getBaseGraph();
        TitanGraph graph = (TitanGraph) g;
        if (graph.isOpen()) {
            if (g.tx().isOpen()) g.tx().rollback();
            g.close();
        }
    }

    WriteConfiguration config = new CommonsConfiguration(configuration);
    BasicConfiguration readConfig = new BasicConfiguration(GraphDatabaseConfiguration.ROOT_NS, config, BasicConfiguration.Restriction.NONE);
    if (readConfig.has(GraphDatabaseConfiguration.STORAGE_BACKEND)) {
        TitanGraphBaseTest.clearGraph(config);
    }
}
 
Example #2
Source File: DelegatingTransactionTest.java    From Ferma with Apache License 2.0 4 votes vote down vote up
@Test
public void testGetGraph() {
    WrappedGraph actualDelegate = delegatingTx.getGraph();
    Mockito.verifyZeroInteractions(gremlinTx, framedGraph);
    Assert.assertEquals(framedGraph, actualDelegate);
}