use of org.neo4j.cypher.internal.javacompat.ExecutionResult in project neo4j by neo4j.
the class ExportTest method testEscapingStringPropertyWithBackslash.
@Test
public void testEscapingStringPropertyWithBackslash() throws Exception {
Node n = gdb.createNode();
n.setProperty("name", "Some\\thing");
final ExecutionResult result = result("node", n);
final SubGraph graph = CypherResultSubGraph.from(result, gdb, false);
assertEquals("create (_" + n.getId() + " {`name`:\"Some\\\\thing\"})" + lineSeparator() + ";" + lineSeparator(), doExportGraph(graph));
}
use of org.neo4j.cypher.internal.javacompat.ExecutionResult in project neo4j by neo4j.
the class ExportTest method testFromPathCypherResult.
@Test
public void testFromPathCypherResult() throws Exception {
Node n1 = gdb.createNode();
Node n2 = gdb.createNode();
final Relationship rel = n1.createRelationshipTo(n2, RelationshipType.withName("REL"));
final Path path = new PathImpl.Builder(n1).push(rel).build();
final ExecutionResult result = result("path", path);
final SubGraph graph = CypherResultSubGraph.from(result, gdb, true);
assertEquals("create (_0)" + lineSeparator() + "create (_1)" + lineSeparator() + "create (_0)-[:`REL`]->(_1)" + lineSeparator() + ";" + lineSeparator(), doExportGraph(graph));
}
use of org.neo4j.cypher.internal.javacompat.ExecutionResult in project neo4j by neo4j.
the class ExportTest method testEscapingOfRelationshipStringArrayPropertyValue.
@Test
public void testEscapingOfRelationshipStringArrayPropertyValue() throws Exception {
Node n = gdb.createNode();
final Relationship rel = n.createRelationshipTo(n, RelationshipType.withName("REL"));
rel.setProperty("name", new String[] { "Brutus \"Brutal\" Howell", "Dr." });
final ExecutionResult result = result("rel", rel);
final SubGraph graph = CypherResultSubGraph.from(result, gdb, true);
assertEquals("create (_0)" + lineSeparator() + "create (_0)-[:`REL` {`name`:[\"Brutus \\\"Brutal\\\" Howell\", \"Dr.\"]}]->(_0)" + lineSeparator() + ";" + lineSeparator(), doExportGraph(graph));
}
use of org.neo4j.cypher.internal.javacompat.ExecutionResult in project neo4j by neo4j.
the class ExportTest method testSingleNodeLabels.
@Test
public void testSingleNodeLabels() throws Exception {
Node n = gdb.createNode();
n.addLabel(Label.label("Foo"));
n.addLabel(Label.label("Bar"));
final ExecutionResult result = result("node", n);
final SubGraph graph = CypherResultSubGraph.from(result, gdb, false);
assertEquals("create (_" + n.getId() + ":`Foo`:`Bar`)" + lineSeparator() + ";" + lineSeparator(), doExportGraph(graph));
}
use of org.neo4j.cypher.internal.javacompat.ExecutionResult in project neo4j by neo4j.
the class ExportTest method testSingleNodeWithArrayProperties.
@Test
public void testSingleNodeWithArrayProperties() throws Exception {
Node n = gdb.createNode();
n.setProperty("name", new String[] { "a", "b" });
n.setProperty("age", new int[] { 1, 2 });
final ExecutionResult result = result("node", n);
final SubGraph graph = CypherResultSubGraph.from(result, gdb, false);
assertEquals("create (_" + n.getId() + " {`age`:[1, 2], `name`:[\"a\", \"b\"]})" + lineSeparator() + ";" + lineSeparator(), doExportGraph(graph));
}
Aggregations