use of org.neo4j.driver.Record in project neo4j by neo4j.
the class TableOutputFormatterTest method prettyPrintPoint.
@Test
public void prettyPrintPoint() {
// given
List<String> keys = asList("p1", "p2");
Value point2d = new PointValue(new InternalPoint2D(4326, 42.78, 56.7));
Value point3d = new PointValue(new InternalPoint3D(4326, 1.7, 26.79, 34.23));
Record record = new InternalRecord(keys, new Value[] { point2d, point3d });
// when
String actual = verbosePrinter.format(new ListBoltResult(asList(record), mock(ResultSummary.class)));
// then
assertThat(actual, containsString("| point({srid:4326, x:42.78, y:56.7}) |"));
assertThat(actual, containsString("| point({srid:4326, x:1.7, y:26.79, z:34.23}) |"));
}
use of org.neo4j.driver.Record in project neo4j by neo4j.
the class TableOutputFormatterTest method prettyPrintDuration.
@Test
public void prettyPrintDuration() {
// given
List<String> keys = asList("d");
Value duration = new DurationValue(new InternalIsoDuration(1, 2, 3, 4));
Record record = new InternalRecord(keys, new Value[] { duration });
// when
String actual = verbosePrinter.format(new ListBoltResult(asList(record), mock(ResultSummary.class)));
// then
assertThat(actual, containsString("| P1M2DT3.000000004S |"));
}
use of org.neo4j.driver.Record in project neo4j by neo4j.
the class TableOutputFormatterTest method prettyPrintNode.
@Test
public void prettyPrintNode() {
// given
List<String> labels = asList("label1", "label2");
Map<String, Value> propertiesAsMap = new HashMap<>();
propertiesAsMap.put("prop1", Values.value("prop1_value"));
propertiesAsMap.put("prop2", Values.value("prop2_value"));
List<String> keys = asList("col1", "col2");
Value value = new NodeValue(new InternalNode(1, labels, propertiesAsMap));
Record record = new InternalRecord(keys, new Value[] { value });
// when
String actual = verbosePrinter.format(new ListBoltResult(asList(record), mock(ResultSummary.class)));
// then
assertThat(actual, containsString("| (:label1:label2 {prop2: \"prop2_value\", prop1: \"prop1_value\"}) |"));
}
Aggregations