use of org.jenkinsci.test.acceptance.plugins.scriptler.Script in project acceptance-test-harness by jenkinsci.
the class ScriptlerPluginTest method parameterized.
@Test
public void parameterized() {
HashMap<String, String> params = new HashMap<>();
params.put("lhs", "7");
params.put("rhs", "11");
Script script = scriptler.create("script1", "println lhs + ' + ' + rhs;", params);
params = new HashMap<>();
params.put("rhs", "9");
assertThat(script.run(params).output(jenkins), equalTo("7 + 9"));
}
use of org.jenkinsci.test.acceptance.plugins.scriptler.Script in project acceptance-test-harness by jenkinsci.
the class ScriptlerPluginTest method run_new_script.
@Test
public void run_new_script() {
Script script = scriptler.upload(SIMPLE_SCRIPT);
assertThat(script.exists(), is(true));
String output = script.run().output(jenkins);
assertThat(output, containsString("Hello world!"));
script.delete();
assertThat(script.exists(), is(false));
}
use of org.jenkinsci.test.acceptance.plugins.scriptler.Script in project acceptance-test-harness by jenkinsci.
the class ScriptlerPluginTest method run_on_all_slaves.
@Test
public void run_on_all_slaves() throws Exception {
Slave slaveA = slaves.install(jenkins).get();
Slave slaveB = slaves.install(jenkins).get();
Script script = scriptler.upload(SIMPLE_SCRIPT);
ScriptResult output = script.runOnAllSlaves();
assertThat(output.output(jenkins), nullValue());
assertThat(output.output(slaveA), equalTo("Hello world!"));
assertThat(output.output(slaveB), equalTo("Hello world!"));
}
use of org.jenkinsci.test.acceptance.plugins.scriptler.Script in project acceptance-test-harness by jenkinsci.
the class ScriptlerPluginTest method run_on_slave.
@Test
public void run_on_slave() throws Exception {
Slave slave = slaves.install(jenkins).get();
Script script = scriptler.upload(SIMPLE_SCRIPT);
String output = script.runOn(slave).output(slave);
assertThat(output, equalTo("Hello world!"));
}
Aggregations