public void testDuplicateConnection() throws Exception
{
InMemoryAdmireRegistry registry = new InMemoryAdmireRegistry();
registry.registerProcessingElement("a.A");
registry.registerProcessingElement("eu.admire.Results");
DISPELCompiler compiler = new DISPELCompiler();
DISPELGraphBuilder builder =
new DISPELGraphBuilder(registry, new SimpleDispelOptimiser());
compiler.setRequestBuilder(builder);
compiler.addErrorListener(new ErrorListener()
{
@Override
public void error(int line, int column, Throwable cause)
{
System.out.println("(" + line + ", " + column + ")");
cause.printStackTrace();
}
@Override
public void error(int line, int column, String message)
{
System.out.println("(" + line + ", " + column + "): " + message);
}
});
compiler.parse("use a.A; " +
"A a1 = new A; A a2 = new A; " +
"a1.output => a2.input; a1.output => a2.input; " +
"submit a1;");
Collection<Graph> submitted = builder.getSubmittedGraphs();
assertFalse("Compilation failed", submitted.isEmpty());