Package com.dtolabs.rundeck.core.utils

Examples of com.dtolabs.rundeck.core.utils.NodeSet$SetSelector


    public void testMultipleNodes() throws Exception{

        {
            //test jobref item
            final NodeSet nodeset = new NodeSet();
            nodeset.createInclude().setName(".*");
            final ArrayList<StepExecutionItem> commands = new ArrayList<StepExecutionItem>();
            final testWorkflowCmdItem item = new testWorkflowCmdItem();
            item.type = "my-type";
            commands.add(item);
            final WorkflowImpl workflow = new WorkflowImpl(commands, 1, false,
View Full Code Here


    public void testMultipleNodesExtFile() throws Exception{

        {
            //test jobref item
            final NodeSet nodeset = new NodeSet();
            nodeset.createInclude().setName(".*");
            final ArrayList<StepExecutionItem> commands = new ArrayList<StepExecutionItem>();
            final testWorkflowCmdItem item = new testWorkflowCmdItem();
            item.type = "my-type";
            commands.add(item);
            final WorkflowImpl workflow = new WorkflowImpl(commands, 1, false,
View Full Code Here

        commands.add(item);
        final WorkflowImpl workflow = new WorkflowImpl(commands, 1, false,
            WorkflowStrategy.NODE_FIRST);
        final WorkflowExecutionItemImpl executionItem = new WorkflowExecutionItemImpl(workflow);
        final NodeFirstWorkflowStrategy strategy = new NodeFirstWorkflowStrategy(testFramework);
        final NodeSet nodeset = new NodeSet();
        nodeset.createInclude().setName(".*");
        final ExecutionContextImpl.Builder builder = new ExecutionContextImpl.Builder();
        if(null!=nodeRankOrderAscending){
            builder.nodeRankOrderAscending(nodeRankOrderAscending); //rank order
        }
        builder.nodeRankAttribute(rankAttribute); //rank attribute
View Full Code Here

    public void testMultipleItemsAndNodes() throws Exception{

        {
            //test jobref item
            final NodeSet nodeset = new NodeSet();
            nodeset.createInclude().setName(".*");
            final ArrayList<StepExecutionItem> commands = new ArrayList<StepExecutionItem>();
            final testWorkflowCmdItem item = new testWorkflowCmdItem();
            item.flag = 0;
            item.type = "my-type";
            commands.add(item);
View Full Code Here

                           final List<Map<String, Object>> expected,
                           final boolean expectedSuccess,
                           final List<Object> returnResults, final boolean expectStepException) {

        //test success 1 item
        final NodeSet nodeset = new NodeSet();

        testWorkflowStrategy strategy = new testWorkflowStrategy(testFramework);

        strategy.getResults().addAll(returnResults);
View Full Code Here

        }

    public void testAddNodeSetParamsThreadcount() throws Exception {
            //test empty nodeset, only has threadcount & keepgoing
            HashMap<String, String> params = new HashMap<String, String>();
            NodeSet nodeset = new NodeSet();
            RundeckAPICentralDispatcher.addAPINodeSetParams(params, null, null, 1, null);
            assertEquals(1, params.size());
            assertTrue(params.containsKey("nodeThreadcount"));
            assertEquals("1", params.get("nodeThreadcount"));
View Full Code Here

        }
    public void testAddNodeSetParamsKeepgoing() throws Exception {
            //test empty nodeset, only has threadcount & keepgoing
            HashMap<String, String> params = new HashMap<String, String>();
            NodeSet nodeset = new NodeSet();
            RundeckAPICentralDispatcher.addAPINodeSetParams(params, false, null, -1, null);
            assertEquals(1, params.size());
            assertTrue(params.containsKey("nodeKeepgoing"));
            assertEquals("false", params.get("nodeKeepgoing"));
        }
View Full Code Here

        }

    public void testAddNodeSetParamsBasic2() throws Exception {
            //test empty nodeset, only has threadcount & keepgoing
            HashMap<String, String> params = new HashMap<String, String>();
            NodeSet nodeset = new NodeSet();
            nodeset.setThreadCount(2);
            RundeckAPICentralDispatcher.addAPINodeSetParams(params, true, null, 2, null);
            assertEquals(2, params.size());
            assertTrue(params.containsKey("nodeThreadcount"));
            assertEquals("2", params.get("nodeThreadcount"));
            assertTrue(params.containsKey("nodeKeepgoing"));
View Full Code Here

        {
            ExecTool main = newExecTool();
            main.parseArgs(new String[]{"-p", TEST_EXEC_TOOL_PROJECT, "-X", "homestar", "-I", "os-name=Testux"});
            Map exmap = main.parseExcludeArgs(nodeKeys);
            Map incmap = main.parseIncludeArgs(nodeKeys);
            NodeSet nodeset = main.createNodeSet(incmap, exmap);
            assertTrue(nodeset.getExclude().isDominant());
            assertFalse(nodeset.getInclude().isDominant());
            final Collection c = main.filterNodes().getNodes();
            assertEquals("wrong size", 1, c.size());
        }

        {
View Full Code Here

        {
            ExecTool main = newExecTool();
            main.parseArgs(new String[]{"-p", TEST_EXEC_TOOL_PROJECT, "-X", "homestar", "-I", "os-name=Testux"});
            Map exmap = main.parseExcludeArgs(nodeKeys);
            Map incmap = main.parseIncludeArgs(nodeKeys);
            NodeSet nodeset = main.createNodeSet(incmap, exmap);
            assertTrue(nodeset.getExclude().isDominant());
            assertFalse(nodeset.getInclude().isDominant());
            final Collection c = main.filterNodes().getNodes();
            assertEquals("wrong size", 1, c.size());
            final String result = new ExecTool.DefaultNodeFormatter().formatResults(c).toString();
            assertNotNull(result);
            assertEquals("doesn't contain correct result", "cheat", result);
View Full Code Here

TOP

Related Classes of com.dtolabs.rundeck.core.utils.NodeSet$SetSelector

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.