use of org.jenkinsci.test.acceptance.plugins.publish_over.PublishGlobalPublisher in project acceptance-test-harness by jenkinsci.
the class GlobalPublishPluginTest method publish_jenkins_variables.
@Test
public void publish_jenkins_variables() throws IOException {
DockerContainer dock = container.get();
Resource cpFile = resource("/ftp_plugin/odes.txt");
String randomName = jenkins.jobs.createRandomName();
String randomPath = "/tmp/" + randomName + "/";
FreeStyleJob j = jenkins.jobs.create(FreeStyleJob.class, randomName);
configurePublisher("asd", dock);
j.configure();
{
j.copyResource(cpFile);
PublishGlobalPublisher fp = addGlobalPublisher(j);
PublishGlobalPublisher.GlobalPublishSite fps = fp.getDefault();
fps.getDefaultTransfer().remoteDirectory.set("${JOB_NAME}/");
fps.getDefaultTransfer().sourceFile.set("odes.txt");
}
j.save();
j.startBuild().shouldSucceed();
assertThat(dock.cp(randomPath + "odes.txt", "/tmp/"), is(true));
assertThat(FileUtils.readFileToString(new File("/tmp/odes.txt")), CoreMatchers.is(cpFile.asText()));
}
use of org.jenkinsci.test.acceptance.plugins.publish_over.PublishGlobalPublisher in project acceptance-test-harness by jenkinsci.
the class GlobalPublishPluginTest method publish_resources.
@Test
public void publish_resources() throws IOException {
DockerContainer dock = container.get();
Resource cpFile = resource("/ftp_plugin/odes.txt");
FreeStyleJob j = jenkins.jobs.create();
configurePublisher("asd", dock);
j.configure();
{
j.copyResource(cpFile);
PublishGlobalPublisher fp = addGlobalPublisher(j);
PublishGlobalPublisher.GlobalPublishSite fps = fp.getDefault();
fps.getDefaultTransfer().sourceFile.set("odes.txt");
}
j.save();
j.startBuild().shouldSucceed();
assertThat(dock.cp("/tmp/odes.txt", "/tmp/"), is(true));
assertThat(FileUtils.readFileToString(new File("/tmp/odes.txt")), CoreMatchers.is(cpFile.asText()));
}
use of org.jenkinsci.test.acceptance.plugins.publish_over.PublishGlobalPublisher in project acceptance-test-harness by jenkinsci.
the class GlobalPublishPluginTest method publish_with_default_exclude.
@Test
public void publish_with_default_exclude() {
DockerContainer dock = container.get();
Resource cpTxt = resource("/ftp_plugin/odes.txt");
FreeStyleJob j = jenkins.jobs.create();
configurePublisher("asd", dock);
j.configure();
{
j.copyResource(cpTxt, ".svn");
j.copyResource(cpTxt, "CVS");
j.copyResource(cpTxt);
PublishGlobalPublisher fp = addGlobalPublisher(j);
PublishGlobalPublisher.GlobalPublishSite fps = fp.getDefault();
fps.getDefaultTransfer().sourceFile.set(".svn,CVS,odes.txt");
}
j.save();
j.startBuild().shouldSucceed();
assertThat(dock.cp("/tmp/odes.txt", "/tmp/"), is(true));
assertThat(!dock.cp("/tmp/.svn", "/tmp/"), is(true));
assertThat(!dock.cp("/tmp/CVS", "/tmp/"), is(true));
}
use of org.jenkinsci.test.acceptance.plugins.publish_over.PublishGlobalPublisher in project acceptance-test-harness by jenkinsci.
the class GlobalPublishPluginTest method publish_with_no_default_exclude.
@Test
public void publish_with_no_default_exclude() {
DockerContainer dock = container.get();
Resource cpTxt = resource("/ftp_plugin/odes.txt");
FreeStyleJob j = jenkins.jobs.create();
configurePublisher("asd", dock);
j.configure();
{
j.copyResource(cpTxt, ".svn");
j.copyResource(cpTxt, "CVS");
j.copyResource(cpTxt);
PublishGlobalPublisher fp = addGlobalPublisher(j);
PublishGlobalPublisher.GlobalPublishSite fps = fp.getDefault();
fps.getDefaultTransfer().sourceFile.set(".svn,CVS,odes.txt");
fps.getDefaultTransfer().noDefaultExcludes.check();
}
j.save();
j.startBuild().shouldSucceed();
assertThat(dock.cp("/tmp/odes.txt", "/tmp/"), is(true));
assertThat(dock.cp("/tmp/.svn", "/tmp/"), is(true));
assertThat(dock.cp("/tmp/CVS", "/tmp/"), is(true));
}
use of org.jenkinsci.test.acceptance.plugins.publish_over.PublishGlobalPublisher in project acceptance-test-harness by jenkinsci.
the class GlobalPublishPluginTest method publish_slave_resourses.
@Test
public void publish_slave_resourses() throws IOException, InterruptedException, ExecutionException {
DockerContainer dock = container.get();
Resource cpFile = resource("/ftp_plugin/odes.txt");
Slave s = slaves.get().install(jenkins).get();
s.configure();
s.save();
FreeStyleJob j = jenkins.jobs.create();
configurePublisher("asd", dock);
j.configure();
{
j.copyResource(cpFile);
PublishGlobalPublisher fp = addGlobalPublisher(j);
PublishGlobalPublisher.GlobalPublishSite fps = fp.getDefault();
fps.getDefaultTransfer().sourceFile.set("odes.txt");
}
j.save();
j.startBuild().shouldSucceed();
assertThat(dock.cp("/tmp/odes.txt", "/tmp"), is(true));
assertThat(FileUtils.readFileToString(new File("/tmp/odes.txt")), CoreMatchers.is(cpFile.asText()));
}
Aggregations