Class EmbeddedRemoteConnection

  • All Implemented Interfaces:
    AutoCloseable, RemoteConnection

    public class EmbeddedRemoteConnection
    extends Object
    implements RemoteConnection
    Allows a RemoteConnection to be submitted to a "local" Graph instance thus simulating a connection to a remote source. Basic usage is as follows:
     // Using TinkerGraph here but any embedded Graph instance would suffice
     Graph graph = TinkerFactory.createModern();
     GraphTraversalSource g = graph.traversal();
     // setup the remote as normal but give it the embedded "g" so that it executes against that
     GraphTraversalSource simulatedRemoteG = TraversalSourceFactory.traversal(new EmbeddedRemoteConnection(g));
     assertEquals(6, simulatedRemoteG.V().count().next().intValue());
    Stephen Mallette (