DispelEngineResult result = engine.processDispel(dispel);
Collection<Graph> graphs = result.getExecutionGraphs();
assertEquals("Expect a single execution graph", 1, graphs.size());
Graph graph = graphs.iterator().next();
RequestNode echo = null;
for (RequestNode node : graph.getNodes())
{
if (node.getName().equals("uk.org.ogsadai.Echo"))
{
echo = node;
}
}
assertNotNull(echo);
// test that the converter has been inserted correctly
Connection echoInput = echo.getInput("input", 0);
RequestNode converter = echoInput.getSource();
assertNotNull(converter);
assertEquals(SimpleTupleTypeConverter.TUPLE_CONVERT, converter.getName());
RequestNode node = converter.getInput("expressions", 0).getSource();
assertTrue(node instanceof LiteralValuesNode);
List<Object> values = ((LiteralValuesNode)node).getValues();
assertEquals(3, values.size());
assertEquals(ListMarker.BEGIN, values.get(0));
assertEquals("min+273.15", values.get(1));
assertEquals(ListMarker.END, values.get(2));
node = converter.getInput("columnNames", 0).getSource();
assertTrue(node instanceof LiteralValuesNode);
values = ((LiteralValuesNode)node).getValues();
assertEquals(3, values.size());
assertEquals(ListMarker.BEGIN, values.get(0));
assertEquals("min", values.get(1));
assertEquals(ListMarker.END, values.get(2));
RequestNode sequence = converter.getInput("data", 0).getSource();
assertTrue(sequence instanceof LiteralValuesNode);
values = ((LiteralValuesNode)sequence).getValues();
assertEquals(3, values.size());
assertEquals(ListMarker.BEGIN, values.get(0));
assertTrue(values.get(1) instanceof Map<?,?>);