Package com.dtolabs.rundeck.core.common

Examples of com.dtolabs.rundeck.core.common.NodeSetImpl


     * Perform the query and return the set of instances
     *
     * @param nodeSet
     */
    public INodeSet performQuery() {
        final NodeSetImpl nodeSet = new NodeSetImpl();
        final AmazonEC2Client ec2 = new AmazonEC2Client(credentials);
        if (null != getEndpoint()) {
            ec2.setEndpoint(getEndpoint());
        }
        final ArrayList<Filter> filters = buildFilters();
View Full Code Here


            }

            public INodeSet get() throws InterruptedException, ExecutionException {
                DescribeInstancesResult describeInstancesResult = describeInstancesRequest.get();

                final NodeSetImpl nodeSet = new NodeSetImpl();
                final Set<Instance> instances = examineResult(describeInstancesResult);

                mapInstances(nodeSet, instances);
                return nodeSet;
            }

            public INodeSet get(final long l, final TimeUnit timeUnit) throws InterruptedException, ExecutionException,
                TimeoutException {
                DescribeInstancesResult describeInstancesResult = describeInstancesRequest.get(l, timeUnit);

                final NodeSetImpl nodeSet = new NodeSetImpl();
                final Set<Instance> instances = examineResult(describeInstancesResult);

                mapInstances(nodeSet, instances);
                return nodeSet;
            }
View Full Code Here

    }

    public void testEventsBeginWorkflowExecution() {
        HashMap<String, INodeEntry> nodes = new HashMap<String, INodeEntry>();
        nodes.put("test1", new NodeEntryImpl("test1"));
        NodeSetImpl nodeSet = new NodeSetImpl(nodes);
        test.beginWorkflowExecution(ExecutionContextImpl.builder().nodes(nodeSet).build(), null);

        assertEquals(1, testListener1.events.size());
        Object[] o = (Object[]) testListener1.events.get(0);
        assertWorkflowStateEvent(o, ExecutionState.RUNNING, "test1");
View Full Code Here

    }

    public void testEventsFinishWorkflowExecution() {
        HashMap<String, INodeEntry> nodes = new HashMap<String, INodeEntry>();
        nodes.put("test1", new NodeEntryImpl("test1"));
        test.beginWorkflowExecution(ExecutionContextImpl.builder().nodes(new NodeSetImpl(nodes)).build(), null);
        test.finishWorkflowExecution(wfresult.forSuccess(true), ExecutionContextImpl.builder().nodes(new NodeSetImpl
                (nodes)).build(), null);

        assertEquals(2, testListener1.events.size());
        Object[] o = (Object[]) testListener1.events.get(0);
        assertWorkflowStateEvent(o, ExecutionState.RUNNING, "test1");
View Full Code Here

    public void testFinishExecuteNodeStepNullResult() {
        HashMap<String, INodeEntry> nodes = new HashMap<String, INodeEntry>();
        NodeEntryImpl node1 = new NodeEntryImpl("test1");
        nodes.put("test1", node1);
        test.beginWorkflowExecution(ExecutionContextImpl.builder().nodes(new NodeSetImpl(nodes)).build(), null);

        test.beginWorkflowItem(1, testitem);
        test.beginExecuteNodeStep(null, null, node1);
        testReason reason1 = new testReason("Unknown");
        //simulate exception thrown with null result
View Full Code Here

                reason1.map(), 1);
    }
    public void testEventsBeginWorkflowItem() {
        HashMap<String, INodeEntry> nodes = new HashMap<String, INodeEntry>();
        nodes.put("test1", new NodeEntryImpl("test1"));
        test.beginWorkflowExecution(ExecutionContextImpl.builder().nodes(new NodeSetImpl(nodes)).build(), null);

        test.beginWorkflowItem(1, testitem);

        assertEquals(2, testListener1.events.size());
        Object[] o = (Object[]) testListener1.events.get(0);
View Full Code Here

        assertStepStateEvent(o2, ExecutionState.RUNNING, null,1);
    }
    public void testEventsFinishWorkflowItem() {
        HashMap<String, INodeEntry> nodes = new HashMap<String, INodeEntry>();
        nodes.put("test1", new NodeEntryImpl("test1"));
        test.beginWorkflowExecution(ExecutionContextImpl.builder().nodes(new NodeSetImpl(nodes)).build(), null);

        test.beginWorkflowItem(1, testitem);
        test.finishWorkflowItem(1, testitem, successResult());

        assertEquals(3, testListener1.events.size());
View Full Code Here

    public void testEventsWorkflowItemErrorHandler() {
        HashMap<String, INodeEntry> nodes = new HashMap<String, INodeEntry>();
        NodeEntryImpl node1 = new NodeEntryImpl("test1");
        nodes.put("test1", node1);
        test.beginWorkflowExecution(ExecutionContextImpl.builder().nodes(new NodeSetImpl(nodes)).build(), null);

        test.beginWorkflowItem(1, testitem);
        test.beginExecuteNodeStep(null, null, node1);
        testReason reason1 = new testReason("reason1");
        test.finishExecuteNodeStep(failureNodeResult(node1,"blah", reason1), null, null, node1);
View Full Code Here

    public void testEventsSubflowWithErrorHandler() {
        HashMap<String, INodeEntry> nodes = new HashMap<String, INodeEntry>();
        NodeEntryImpl node1 = new NodeEntryImpl("test1");
        nodes.put("test1", node1);
        test.beginWorkflowExecution(ExecutionContextImpl.builder().nodes(new NodeSetImpl(nodes)).build(), null);
        test.beginWorkflowItem(1, testitem);
        //sub workflow
        test.beginWorkflowExecution(ExecutionContextImpl.builder().nodes(new NodeSetImpl(nodes)).build(), null);

        test.beginWorkflowItem(1, testitem);
        test.beginExecuteNodeStep(null, null, node1);
        testReason reason1 = new testReason("reason1");
        test.finishExecuteNodeStep(failureNodeResult(node1,"blah", reason1), null, null, node1);
View Full Code Here

        NodeEntryImpl node1 = new NodeEntryImpl("test1");
        nodes.put("test1", node1);
        HashMap<String, INodeEntry> nodes2 = new HashMap<String, INodeEntry>();
        NodeEntryImpl node2 = new NodeEntryImpl("test2");
        nodes2.put("test2", node2);
        test.beginWorkflowExecution(ExecutionContextImpl.builder().nodes(new NodeSetImpl(nodes)).build(), null);

        test.beginWorkflowItem(1, testitem);
        //sub workflow
        test.beginWorkflowExecution(ExecutionContextImpl.builder().nodes(new NodeSetImpl(nodes2)).build(), null);

        test.beginWorkflowItem(1, testitem);
        assertEquals(4, testListener1.events.size());
        assertWorkflowStateEvent((Object[]) testListener1.events.get(0), ExecutionState.RUNNING, "test1");
        assertStepStateEvent((Object[]) testListener1.events.get(1), ExecutionState.RUNNING, null, 1);
View Full Code Here

TOP

Related Classes of com.dtolabs.rundeck.core.common.NodeSetImpl

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.