Package eu.admire.dispel.graph

Examples of eu.admire.dispel.graph.ProcessingElementNode


            if (node instanceof ProcessingElementNode)
            {
                if (node.getName().equals("uk.org.ogsadai.SQLQuery"))
                {
                    haveSQLQueryNode = true;
                    ProcessingElementNode peNode = (ProcessingElementNode)node;
                   
                    Set<String> candidatePEs = peNode.getCandidatePEs();
                    assertEquals(
                        "Size of candidate PE set", 2, candidatePEs.size());
                    assertTrue(
                        "Candidate PE set must contain com.me.SQLQueryA",
                        candidatePEs.contains("com.me.SQLQueryA"));
                    assertTrue(
                        "Candidate PE set must contain com.me.SQLQueryB",
                        candidatePEs.contains("com.me.SQLQueryB"));
                   
                    Map<String, Set<String>> gatewayPEDetails =
                        peNode.getCandidateGateways();
                   
                    assertTrue(
                        "Must get candidate gateways for PE com.me.SQLQueryA",
                        gatewayPEDetails.containsKey("com.me.SQLQueryA"));
                    assertEquals(
View Full Code Here


    }

    public void testSameNameInputs() throws Exception
    {
        Graph graph = new Graph();
        ProcessingElementNode nodeA = new ProcessingElementNode("uk.org.ogsadai.SQLQuery");
        graph.add(nodeA);
        ProcessingElementNode nodeB = new ProcessingElementNode("uk.org.ogsadai.TupleToWebRowSetCharArrays");
        graph.add(nodeB);
        ProcessingElementNode nodeC = new ProcessingElementNode("uk.org.ogsadai.DeliverToRequestStatus");
        graph.add(nodeC);
        Connection connection = new TeeConnection();
        nodeA.connectOutput("out1", 0, connection);
        nodeB.connectInput("in1", 0, connection);
        Connection connection2 = new TeeConnection();
        nodeB.connectOutput("data", 0, connection2);
        nodeC.connectInput("in1", 0, connection2);
        Connection connection3 = new TeeConnection();
        nodeA.connectOutput("data", 0, connection3);
        nodeC.connectInput("data", 0, connection3);
        String dot = DotGenerator.generate(graph);
//        writeFile(dot);
        System.out.println(dot);
    }
View Full Code Here

       
        for( RequestNode graphNode : graph.getNodes())
        {
            if (graphNode instanceof ProcessingElementNode)
            {
                ProcessingElementNode peNode =
                    (ProcessingElementNode) graphNode;

                if (peNode.getName().equals(expectedNodeName))
                {
                    assertEquals(
                        "Node " + expectedNodeName + " should have single PE",
                        1, peNode.getCandidatePEs().size());
                   
                    assertEquals(
                        "Node " + expectedNodeName + " PE name",
                        expectedPEName,
                        peNode.getCandidatePEs().iterator().next());
                   
                    assertEquals(
                        "Node " + expectedNodeName +
                            " should have single gateway",
                        1,
                        peNode.getCandidateGateways().get(
                            expectedPEName).size());

                    assertEquals(
                        "Node " + expectedNodeName + "  gateway name",
                        expectedGatewayName,
                        peNode.getCandidateGateways().get(
                            expectedPEName).iterator().next());

                    found = true;
                    break;
                }
View Full Code Here

    }

    public void testLiteral() throws Exception
    {
        Graph graph = new Graph();
        ProcessingElementNode nodeA = new ProcessingElementNode("uk.org.ogsadai.SQLQuery");
        graph.add(nodeA);
        LiteralValuesNode nodeB = new LiteralValuesNode(1, 2, 3);
        graph.add(nodeB);
        LiteralValuesNode nodeC = new LiteralValuesNode(
                ListMarker.BEGIN,
                "this is a string that is too long",
                "another very long string that doesn't fit",
                "and a \\\"string\\\" with quotes",
                ListMarker.END,
                ListMarker.BEGIN,
                new Repeater(null, Arrays.asList(ListMarker.BEGIN, "X", "Y", 2, ListMarker.END)),
                ListMarker.END);
        graph.add(nodeC);
        nodeA.connectInput("in1", 0, nodeB.getOutput());
        nodeA.connectInput("in2", 0, nodeC.getOutput());
        String dot = DotGenerator.generate(graph);
//        writeFile(dot);
        System.out.println(dot);
    }
View Full Code Here

        super.tearDown();
    }
   
    public void testOneWorkflow() throws Exception
    {
        ProcessingElementNode node1 = new ProcessingElementNode("1");
        node1.addAnnotation(AnnotationKeys.LOCATION, mLocation);
        ProcessingElementNode node2 = new ProcessingElementNode("2");
        node2.addAnnotation(AnnotationKeys.LOCATION, mLocation);
        ProcessingElementNode node3 = new ProcessingElementNode("3");
        node3.addAnnotation(AnnotationKeys.LOCATION, mLocation);
        node1.connectOutput("output", 0, node2.getInput("input", 0));
        node2.connectOutput("output", 0, node3.getInput("input", 0));
        Graph graph = new Graph();
        graph.add(node1);
        graph.add(node2);
        graph.add(node3);
        ExchangeFactory factory = new TestExchangeFactory();
View Full Code Here

   
    public void testTwoWorkflows() throws Exception
    {
        Location location1 = new MockLocation("A");
        Location location2 = new MockLocation("B");
        ProcessingElementNode node1 = new ProcessingElementNode("1");
        node1.addAnnotation(AnnotationKeys.LOCATION, location1);
        ProcessingElementNode node2 = new ProcessingElementNode("2");
        node2.addAnnotation(AnnotationKeys.LOCATION, location1);
        ProcessingElementNode node3 = new ProcessingElementNode("3");
        node3.addAnnotation(AnnotationKeys.LOCATION, location2);
        node1.connectOutput("output", 0, node2.getInput("input", 0));
        node2.connectOutput("output", 0, node3.getInput("input", 0));
        Graph graph = new Graph();
        graph.add(node1);
        graph.add(node2);
        graph.add(node3);
        ExchangeFactory factory = new TestExchangeFactory();
View Full Code Here

   
    public void testTwoWorkflowsWithResults() throws Exception
    {
        Location location1 = new SimpleLocation(null);
        Location location2 = new SimpleLocation(null);
        ProcessingElementNode node1 = new ProcessingElementNode("1");
        node1.addAnnotation(AnnotationKeys.LOCATION, location1);
        ProcessingElementNode node2 = new ProcessingElementNode("2");
        node2.addAnnotation(AnnotationKeys.LOCATION, location1);
        ProcessingElementNode node3 = new ProcessingElementNode("3");
        node3.addAnnotation(AnnotationKeys.LOCATION, location2);
        ResultNode result = new ResultNode("name");
        result.addAnnotation(AnnotationKeys.LOCATION, location2);
        node1.connectOutput("output", 0, node2.getInput("input", 0));
        node2.connectOutput("output", 0, node3.getInput("input", 0));
        node3.connectOutput("output", 0, result.getInput());
        Graph graph = new Graph();
        graph.add(node1);
        graph.add(node2);
        graph.add(node3);
        graph.add(result);
View Full Code Here

        literal.add(ListMarker.END);
        TupleSType stype = new TupleSType();
        stype.addElement("a", new PrimitiveSType("Integer"));
        stype.addElement("b", new PrimitiveSType("String"));
        literal.setOutputDescriptor(new ListSType(stype), null);
        ProcessingElementNode node2 = new ProcessingElementNode("2");
        node2.addAnnotation(AnnotationKeys.LOCATION, mLocation);
        literal.connectOutput("output", 0, node2.getInput("input", 0));
        Graph graph = new Graph();
        graph.add(literal);
        graph.add(node2);
        ExchangeFactory factory = new TestExchangeFactory();
        ProcessingElementMapper mapper = new SimpleProcessingElementMapper();
View Full Code Here

    public void testRepeatEnough() throws Exception
    {
        LiteralValuesNode literal = new LiteralValuesNode();
        literal.addAnnotation(AnnotationKeys.LOCATION, mLocation);
        literal.add(new Repeater(null, "X"));
        ProcessingElementNode node1 = new ProcessingElementNode("1");
        node1.addAnnotation(AnnotationKeys.LOCATION, mLocation);
        literal.connectOutput("output", 0, node1.getInput("input", 0));
        ProcessingElementNode node2 = new ProcessingElementNode("2");
        node2.addAnnotation(AnnotationKeys.LOCATION, mLocation);
        node2.connectOutput("output", 0, node1.getInput("control", 0));
        Graph graph = new Graph();
        graph.add(literal);
        graph.add(node1);
        graph.add(node2);
        ExchangeFactory factory = new TestExchangeFactory();
View Full Code Here

    public void testRepeatEnoughWithTee() throws Exception
    {
        LiteralValuesNode literal = new LiteralValuesNode();
        literal.addAnnotation(AnnotationKeys.LOCATION, mLocation);
        literal.add(new Repeater(null, "X"));
        ProcessingElementNode node1 = new ProcessingElementNode("1");
        node1.addAnnotation(AnnotationKeys.LOCATION, mLocation);
        literal.connectOutput("output", 0, node1.getInput("input", 0));
        ProcessingElementNode node2 = new ProcessingElementNode("2");
        node2.addAnnotation(AnnotationKeys.LOCATION, mLocation);
        node2.connectOutput("output", 0, node1.getInput("control", 0));
        ProcessingElementNode node3 = new ProcessingElementNode("3");
        node3.addAnnotation(AnnotationKeys.LOCATION, mLocation);
        node3.connectInput("input", 0, literal.getOutput());
        ProcessingElementNode node4 = new ProcessingElementNode("4");
        node4.addAnnotation(AnnotationKeys.LOCATION, mLocation);
        node4.connectOutput("output", 0, node3.getInput("control", 0));
        Graph graph = new Graph();
        graph.add(literal);
        graph.add(node1);
        graph.add(node2);
        graph.add(node3);
View Full Code Here

TOP

Related Classes of eu.admire.dispel.graph.ProcessingElementNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.