Search in sources :

Example 1 with InternalPoint2D

use of org.neo4j.driver.internal.InternalPoint2D 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}) |"));
}
Also used : InternalRecord(org.neo4j.driver.internal.InternalRecord) ListBoltResult(org.neo4j.shell.state.ListBoltResult) PointValue(org.neo4j.driver.internal.value.PointValue) Value(org.neo4j.driver.Value) RelationshipValue(org.neo4j.driver.internal.value.RelationshipValue) NodeValue(org.neo4j.driver.internal.value.NodeValue) DurationValue(org.neo4j.driver.internal.value.DurationValue) PathValue(org.neo4j.driver.internal.value.PathValue) PointValue(org.neo4j.driver.internal.value.PointValue) InternalPoint3D(org.neo4j.driver.internal.InternalPoint3D) InternalRecord(org.neo4j.driver.internal.InternalRecord) Record(org.neo4j.driver.Record) StringContains.containsString(org.hamcrest.core.StringContains.containsString) InternalPoint2D(org.neo4j.driver.internal.InternalPoint2D) Test(org.junit.Test)

Aggregations

StringContains.containsString (org.hamcrest.core.StringContains.containsString)1 Test (org.junit.Test)1 Record (org.neo4j.driver.Record)1 Value (org.neo4j.driver.Value)1 InternalPoint2D (org.neo4j.driver.internal.InternalPoint2D)1 InternalPoint3D (org.neo4j.driver.internal.InternalPoint3D)1 InternalRecord (org.neo4j.driver.internal.InternalRecord)1 DurationValue (org.neo4j.driver.internal.value.DurationValue)1 NodeValue (org.neo4j.driver.internal.value.NodeValue)1 PathValue (org.neo4j.driver.internal.value.PathValue)1 PointValue (org.neo4j.driver.internal.value.PointValue)1 RelationshipValue (org.neo4j.driver.internal.value.RelationshipValue)1 ListBoltResult (org.neo4j.shell.state.ListBoltResult)1