org.apache.tinkerpop.gremlin.process.traversal.step.map.WriteTest Java Examples

The following examples show how to use org.apache.tinkerpop.gremlin.process.traversal.step.map.WriteTest. 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: TestIo.java    From sqlg with MIT License 6 votes vote down vote up
@Test
public void g_io_write_withXwriter_graphsonX() throws IOException {
    loadModern();
    final String fileToWrite = TestHelper.generateTempFile(WriteTest.class, "tinkerpop-modern-v3d0", ".json").getAbsolutePath().replace('\\', '/');

    final File f = new File(fileToWrite);
    assertThat(f.length() == 0, is(true));

    final Traversal<Object, Object> traversal = this.sqlgGraph.traversal().io(fileToWrite)
            .with(IO.writer, IO.graphson)
            .with(IO.registry, SqlgIoRegistryV3.instance())
            .write();
    printTraversalForm(traversal);
    traversal.iterate();

    assertThat(f.length() > 0, is(true));
}
 
Example #2
Source File: TestIo.java    From sqlg with MIT License 6 votes vote down vote up
@Test
public void g_io_writeXjsonX() throws IOException {
    loadModern();
    final String fileToWrite = TestHelper.generateTempFile(WriteTest.class,"tinkerpop-modern-v3d0", ".json").getAbsolutePath().replace('\\', '/');

    final File f = new File(fileToWrite);
    assertThat(f.length() == 0, is(true));

    final Traversal<Object,Object> traversal =  this.sqlgGraph.traversal()
            .io(fileToWrite)
            .with(IO.writer, IO.graphson)
            .with(IO.registry, SqlgIoRegistryV3.instance())
            .write();
    printTraversalForm(traversal);
    traversal.iterate();

    assertThat(f.length() > 0, is(true));
}
 
Example #3
Source File: TestIo.java    From sqlg with MIT License 6 votes vote down vote up
@Test
public void g_io_writeXkryoX() throws IOException {
    loadModern();
    final String fileToWrite = TestHelper.generateTempFile(WriteTest.class, "tinkerpop-modern-v3d0", ".kryo").getAbsolutePath().replace('\\', '/');

    final File f = new File(fileToWrite);
    assertThat(f.length() == 0, is(true));

    final Traversal<Object,Object> traversal = this.sqlgGraph.traversal()
            .io(fileToWrite)
            .with(IO.writer, IO.gryo)
            .with(IO.registry, SqlgIoRegistryV3.instance())
            .write();
    printTraversalForm(traversal);
    traversal.iterate();

    assertThat(f.length() > 0, is(true));
}
 
Example #4
Source File: TestIo.java    From sqlg with MIT License 5 votes vote down vote up
@Test
public void g_io_write_withXwrite_gryoX() throws IOException {
    loadModern();
    final String fileToWrite = TestHelper.generateTempFile(WriteTest.class, "tinkerpop-modern-v3d0", ".kryo").getAbsolutePath().replace('\\', '/');
    final File f = new File(fileToWrite);
    assertThat(f.length() == 0, is(true));
    final Traversal<Object, Object> traversal = this.sqlgGraph.traversal().io(fileToWrite)
            .with(IO.writer, IO.gryo)
            .with(IO.registry, SqlgIoRegistryV3.instance())
            .write();
    printTraversalForm(traversal);
    traversal.iterate();
    assertThat(f.length() > 0, is(true));
}