Package com.dtolabs.rundeck.core.common

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


            assertNull(br.readLine());

    }

    public void testReplaceTokensInScript9() throws Exception {
        Framework fwk = getFrameworkInstance();
        //test content
        final HashMap<String, Map<String, String>> data = new HashMap<String, Map<String, String>>();
        final HashMap<String, String> testdata = new HashMap<String, String>();
        testdata.put("data", "this is a test");
        testdata.put("data2", "2this is a test2");
View Full Code Here


        catch (NullPointerException ex) {
        }
    }

    public void testReplaceTokensInFile_nodata() throws Exception {
        Framework fwk = getFrameworkInstance();
            assertTrue(testfile1.length() > 0);
            //null data context is ok
            File temp = null;
            try {
                temp = DataContextUtils.replaceTokensInFile(testfile1, null, fwk, null);
View Full Code Here

            assertTrue(temp.length() > 0);
            temp.delete();
    }

    public void testReplaceTokensInFile_emptydata() throws Exception {
        Framework fwk = getFrameworkInstance();
            //test empty data context
            File temp = DataContextUtils.replaceTokensInFile(testfile1,
                new HashMap<String, Map<String, String>>(),
                fwk, null);
            assertNotNull(temp);
View Full Code Here

            assertTrue(temp.length() > 0);
            temp.delete();
    }

    public void testReplaceTokensInFile_testfile_emptycontext() throws Exception {
        Framework fwk = getFrameworkInstance();
            //test content
        File temp = DataContextUtils.replaceTokensInFile(testfile1,
            new HashMap<String, Map<String, String>>(),
            fwk, null);
        assertNotNull(temp);
View Full Code Here

        assertNull(br.readLine());

    }

    public void testReplaceTokensInFile_testfile_emptydata() throws Exception {
        Framework fwk = getFrameworkInstance();
            //test content
            final HashMap<String, Map<String, String>> data = new HashMap<String, Map<String, String>>();
            data.put("test", new HashMap<String, String>());
            File temp = DataContextUtils.replaceTokensInFile(testfile1,
                data,
View Full Code Here

            assertNull(br.readLine());

    }

    public void testReplaceTokensInFile_testfile_withdata1() throws Exception {
        Framework fwk = getFrameworkInstance();
            //test content
            final HashMap<String, Map<String, String>> data = new HashMap<String, Map<String, String>>();
            final HashMap<String, String> testdata = new HashMap<String, String>();
            testdata.put("data1", "this is a test");
            data.put("test", testdata);
View Full Code Here

            assertNull(br.readLine());

    }

    public void testReplaceTokensInFile_testfile_withdata2() throws Exception {
        Framework fwk = getFrameworkInstance();
        //test content
        final HashMap<String, Map<String, String>> data = new HashMap<String, Map<String, String>>();
        final HashMap<String, String> testdata = new HashMap<String, String>();
        testdata.put("data1", "this is a test");
        data.put("test", testdata);
View Full Code Here

        assertFalse(br.ready());
        assertNull(br.readLine());

    }
    public void testReplaceTokensInFile_testfile_withdata_destination() throws Exception {
        Framework fwk = getFrameworkInstance();
        //test content
        final HashMap<String, Map<String, String>> data = new HashMap<String, Map<String, String>>();
        final HashMap<String, String> testdata = new HashMap<String, String>();
        testdata.put("data1", "this is a test");
        data.put("test", testdata);
View Full Code Here

            public ExecutionDetail getExecution(String execId) throws CentralDispatcherException {
                fail("unexpected call to getExecution");
                return null;
            }
        }
        final Framework framework = getFrameworkInstance();
        {
            final QueueTool tool = new QueueTool(framework);
            final boolean[] actionCalled = new boolean[]{false};
            framework.setCentralDispatcherMgr(new FailDispatcher(){
                public Collection<QueuedItem> listDispatcherQueue(final String project) throws CentralDispatcherException {
                    //
                    actionCalled[0] = true;
                    return new ArrayList<QueuedItem>();
                }

            });

            //test list action without required -p

            try{
                tool.run(new String[]{"list"});

                fail("should have thrown argument exception.");
            } catch (CLIToolOptionsException e) {
                assertNotNull(e);
            } catch (QueueToolException e) {
                fail("unexpected exception: " + e.getMessage());
            }
            assertFalse("list action was not called", actionCalled[0]);


            //exec the dispatch

            tool.run(new String[]{"list","-p","test"});
            assertTrue("list action was not called", actionCalled[0]);

        }
        {

            final QueueTool tool = new QueueTool(framework);
            final boolean[] actionCalled = new boolean[]{false};
            final String[] idCalled = new String[]{"wrong"};
            framework.setCentralDispatcherMgr(new FailDispatcher() {
                public DispatcherResult killDispatcherExecution(final String id) throws CentralDispatcherException {
                    actionCalled[0] = true;
                    idCalled[0] = id;
                    return new DispatcherResult() {
                        public String getMessage() {
View Full Code Here

            throw new IllegalArgumentException(
                "Cannot executeWorkflowStep: step is not a NodeStepExecutionItem: " + executionItem);
        }
        NodeStepExecutionItem item = (NodeStepExecutionItem) executionItem;

        final Framework framework = context.getFramework();
        try {
            return wrapDispatcherResult(framework.getExecutionService().dispatchToNodes(context, item));
        } catch (DispatcherException e) {
            return wrapDispatcherException(e);
        } catch (ExecutionServiceException e) {
            //internal error if failure using node dispatchers
            throw new CoreException(e);
View Full Code Here

TOP

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

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.