Search in sources :

Example 6 with CLICommandInvoker

use of hudson.cli.CLICommandInvoker in project workflow-job-plugin by jenkinsci.

the class CLITest method console.

@Issue("JENKINS-41527")
@Test
public void console() throws Exception {
    WorkflowJob p = r.createProject(WorkflowJob.class, "p");
    p.setDefinition(new CpsFlowDefinition("echo 'this is what I said'", true));
    r.buildAndAssertSuccess(p);
    CLICommandInvoker.Result res = new CLICommandInvoker(r, "console").invokeWithArgs("p");
    assertThat(res, CLICommandInvoker.Matcher.succeeded());
    assertThat(res.stdout(), containsString("this is what I said"));
}
Also used : CpsFlowDefinition(org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition) CLICommandInvoker(hudson.cli.CLICommandInvoker) Issue(org.jvnet.hudson.test.Issue) Test(org.junit.Test)

Aggregations

CLICommandInvoker (hudson.cli.CLICommandInvoker)6 Test (org.junit.Test)6 CpsFlowDefinition (org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition)5 Issue (org.jvnet.hudson.test.Issue)3 WebRequest (com.gargoylesoftware.htmlunit.WebRequest)1 HtmlCheckBoxInput (com.gargoylesoftware.htmlunit.html.HtmlCheckBoxInput)1 HtmlForm (com.gargoylesoftware.htmlunit.html.HtmlForm)1 File (java.io.File)1 JenkinsRule (org.jvnet.hudson.test.JenkinsRule)1