use of org.neo4j.cypher.internal.javacompat.ExecutionResult in project neo4j by neo4j.
the class ExportTest method testFromSimpleCypherResult.
@Test
public void testFromSimpleCypherResult() throws Exception {
Node n = gdb.createNode();
final ExecutionResult result = result("node", n);
final SubGraph graph = CypherResultSubGraph.from(result, gdb, false);
assertEquals("create (_" + n.getId() + ")" + lineSeparator() + ";" + lineSeparator(), doExportGraph(graph));
}
use of org.neo4j.cypher.internal.javacompat.ExecutionResult in project neo4j by neo4j.
the class ExportTest method testExportConstraintsViaCypherResult.
@Test
public void testExportConstraintsViaCypherResult() throws Exception {
final Label label = Label.label("Foo");
gdb.schema().constraintFor(label).assertPropertyIsUnique("bar").create();
gdb.schema().constraintFor(label).assertPropertyIsUnique("bar2").create();
commitAndStartNewTransactionAfterSchemaChanges();
Node n = gdb.createNode(label);
final ExecutionResult result = result("node", n);
final SubGraph graph = CypherResultSubGraph.from(result, gdb, true);
assertEquals("create constraint on (n:`Foo`) assert n.`bar2` is unique;" + lineSeparator() + "create constraint on (n:`Foo`) assert n.`bar` is unique;" + lineSeparator() + "create (_0:`Foo`)" + lineSeparator() + ";" + lineSeparator(), doExportGraph(graph));
}
use of org.neo4j.cypher.internal.javacompat.ExecutionResult in project neo4j by neo4j.
the class ExportTest method testEscapingOfNodeStringArrayPropertyValue.
@Test
public void testEscapingOfNodeStringArrayPropertyValue() throws Exception {
Node n = gdb.createNode();
n.setProperty("name", new String[] { "Brutus \"Brutal\" Howell", "Dr." });
final ExecutionResult result = result("node", n);
final SubGraph graph = CypherResultSubGraph.from(result, gdb, false);
assertEquals("create (_" + n.getId() + " {`name`:[\"Brutus \\\"Brutal\\\" Howell\", \"Dr.\"]})" + lineSeparator() + ";" + lineSeparator(), doExportGraph(graph));
}
use of org.neo4j.cypher.internal.javacompat.ExecutionResult in project neo4j by neo4j.
the class ExportTest method testEscapingStringPropertyWithBackslashAndDoubleQuote.
@Test
public void testEscapingStringPropertyWithBackslashAndDoubleQuote() 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 testSingleNode.
@Test
public void testSingleNode() throws Exception {
Node n = gdb.createNode();
final ExecutionResult result = result("node", n);
final SubGraph graph = CypherResultSubGraph.from(result, gdb, false);
assertEquals("create (_" + n.getId() + ")" + lineSeparator() + ";" + lineSeparator(), doExportGraph(graph));
}
Aggregations