@Test
public void testSimple() throws Exception
{
InsertCompositeProcessingElements insert = new InsertCompositeProcessingElements();
InMemoryAdmireRegistry registry = new InMemoryAdmireRegistry();
registry.registerProcessingElement("eu.admire.A");
registry.registerProcessingElement("eu.admire.C");
registry.registerProcessingElement("eu.admire.D");
registry.registerProcessingElement("eu.admire.E");
ProcessingElementDescriptor desc =
new SimpleProcessingElementDescriptor(
"B",
Collections.<ProcessingElementInputDescriptor>emptyList(),
Collections.<ProcessingElementOutputDescriptor>emptyList());
String implementation = "use eu.admire.D; use eu.admire.E; D d = new D; E e = new E; d.out => e.in; " +
"PE(<Connection in> => <Connection out>) B = PE(<Connection in=d.in> => <Connection out=e.out>);" +
"register B;";
registry.registerProcessingElement(desc, implementation);
insert.setAdmireRegistry(registry);
insert.setDispelOptimiser(new SimpleDispelOptimiser());
RequestContext context = new MockRequestContext();
Graph graph = new Graph();
ProcessingElementNode a = new ProcessingElementNode("eu.admire.A");