use of com.datastax.dse.driver.api.core.graph.SocialTraversalSource in project java-driver by datastax.
the class GraphTraversalITBase method should_allow_use_of_dsl_graph_binary.
/**
* A simple smoke test to ensure that a user can supply a custom {@link GraphTraversalSource} for
* use with DSLs.
*
* @test_category dse:graph
*/
@Test
public void should_allow_use_of_dsl_graph_binary() throws Exception {
Assumptions.assumeThat(isGraphBinary()).isTrue();
SocialTraversalSource gSocial = socialTraversalSource();
GraphStatement gs = newInstance(gSocial.persons("marko").knows("vadas").elementMap("name", "age"));
GraphResultSet rs = session().execute(gs);
List<GraphNode> results = rs.all();
assertThat(results.size()).isEqualTo(1);
assertThatContainsProperties(results.get(0).asMap(), "name", "marko", "age", 29);
Assertions.assertThat(results.get(0).asMap().values()).contains("person");
}
use of com.datastax.dse.driver.api.core.graph.SocialTraversalSource in project java-driver by datastax.
the class GraphTraversalITBase method should_allow_use_of_dsl_graphson.
/**
* A simple smoke test to ensure that a user can supply a custom {@link GraphTraversalSource} for
* use with DSLs.
*
* @test_category dse:graph
*/
@Test
public void should_allow_use_of_dsl_graphson() throws Exception {
Assumptions.assumeThat(isGraphBinary()).isFalse();
SocialTraversalSource gSocial = socialTraversalSource();
GraphStatement gs = newInstance(gSocial.persons("marko").knows("vadas"));
GraphResultSet rs = session().execute(gs);
List<GraphNode> results = rs.all();
assertThat(results.size()).isEqualTo(1);
assertThat(results.get(0).asVertex()).hasProperty("name", "marko").hasProperty("age", 29).hasLabel("person");
}
Aggregations