Package hudson.cli

Examples of hudson.cli.CLI


    private void successfulCommand(String... args) throws Exception {
        assertEquals(0, command(args));
    }

    private int command(String... args) throws Exception {
        CLI cli = new CLI(getURL());
        try {
            return cli.execute(args);
        } finally {
            cli.close();
        }
    }
View Full Code Here


    }

    public void testNodeOfflineCli() throws Exception {
        DumbSlave s = createSlave();

        CLI cli = new CLI(getURL());
        try {
            assertTrue(cli.execute("wait-node-offline","xxx")!=0);
            assertTrue(cli.execute("wait-node-online",s.getNodeName())==0);

            s.toComputer().disconnect().get();

            assertTrue(cli.execute("wait-node-offline",s.getNodeName())==0);
        } finally {
            cli.close();
        }
    }
View Full Code Here

    }

    public void testOnCreatedViaCLI() throws Exception {
        ByteArrayOutputStream buf = new ByteArrayOutputStream();
        PrintStream out = new PrintStream(buf);
        CLI cli = new CLI(getURL());
        try {
            cli.execute(Arrays.asList("create-job", "testJob"),
                    new ByteArrayInputStream(("<project><actions/><builders/><publishers/>"
                            + "<buildWrappers/></project>").getBytes()),
                    out, out);
            out.flush();
            assertNotNull("job should be created: " + buf, hudson.getItem("testJob"));
            assertEquals("onCreated event should be triggered: " + buf, "C", events.toString());
        } finally {
            cli.close();
        }
    }
View Full Code Here

TOP

Related Classes of hudson.cli.CLI

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.