use of org.neo4j.values.virtual.NodeValue in project neo4j by neo4j.
the class BoltResponseMessageTest method shouldSerializeNode.
@Test
void shouldSerializeNode() throws Throwable {
NodeValue nodeValue = nodeValue(12L, stringArray("User", "Banana"), VirtualValues.map(new String[] { "name", "age" }, new AnyValue[] { stringValue("Bob"), intValue(14) }));
assertThat(serialized(nodeValue)).isEqualTo("B1 71 91 B3 4E 0C 92 84 55 73 65 72 86 42 61 6E" + lineSeparator() + "61 6E 61 A2 84 6E 61 6D 65 83 42 6F 62 83 61 67" + lineSeparator() + "65 0E");
}
use of org.neo4j.values.virtual.NodeValue in project neo4j by neo4j.
the class PrimitiveOnlyValueWriterTest method newRelationshipValue.
private static RelationshipValue newRelationshipValue() {
NodeValue startNode = nodeValue(24, stringArray("Person"), EMPTY_MAP);
NodeValue endNode = nodeValue(42, stringArray("Person"), EMPTY_MAP);
return relationshipValue(42, startNode, endNode, stringValue("KNOWS"), EMPTY_MAP);
}
use of org.neo4j.values.virtual.NodeValue in project neo4j by neo4j.
the class PathValueBuilderTest method shouldHandleEmptyMultiRel.
@Test
void shouldHandleEmptyMultiRel() {
// Given (n1)<--(n2)-->(n3)
NodeValue n1 = node(42);
PathValueBuilder builder = builder(n1);
// When (n1)<--(n2)--(n3)
builder.addNode(n1);
builder.addMultipleUndirected(EMPTY_LIST);
// Then
assertEquals(path(n1), builder.build());
}
use of org.neo4j.values.virtual.NodeValue in project neo4j by neo4j.
the class PathValueBuilderTest method shouldHandleLongerPathWithMultiRelWhereEndNodeIsKnown.
@Test
void shouldHandleLongerPathWithMultiRelWhereEndNodeIsKnown() {
// Given (n1)<--(n2)-->(n3)
NodeValue n1 = node(42);
NodeValue n2 = node(43);
NodeValue n3 = node(44);
RelationshipValue r1 = relationship(1337, n2, n1);
RelationshipValue r2 = relationship(1338, n2, n3);
PathValueBuilder builder = builder(n1, n2, n3, r1, r2);
// When (n1)<--(n2)--(n3)
builder.addNode(n1);
builder.addMultipleUndirected(list(r1, r2), n3);
// Then
assertEquals(path(n1, r1, n2, r2, n3), builder.build());
}
use of org.neo4j.values.virtual.NodeValue in project neo4j by neo4j.
the class PathValueBuilderTest method shouldHandleNoValue.
@Test
void shouldHandleNoValue() {
// Given (n1)<--(n2)-->(n3)
NodeValue node = node(42);
RelationshipValue relationship = relationship(1337, node(43), node);
PathValueBuilder builder = builder(node, relationship);
// When (n1)<--(n2)--(n3)
builder.addNode(node);
builder.addIncoming(relationship);
builder.addUndirected(NO_VALUE);
// Then
assertEquals(NO_VALUE, builder.build());
}
Aggregations