use of org.jenkinsci.test.acceptance.plugins.publish_over.PublishGlobalPublisher in project acceptance-test-harness by jenkinsci.
the class GlobalPublishPluginTest method publish_with_clean_remote.
@Test
public void publish_with_clean_remote() {
DockerContainer dock = container.get();
Resource cpTxt = resource("/ftp_plugin/odes.txt");
FreeStyleJob j = jenkins.jobs.create();
configurePublisher("asd", dock);
j.configure();
{
j.copyResource(cpTxt);
PublishGlobalPublisher fp = addGlobalPublisher(j);
PublishGlobalPublisher.GlobalPublishSite fps = fp.getDefault();
fps.getDefaultTransfer().cleanRemote.check();
fps.getDefaultTransfer().sourceFile.set("odes.txt");
}
j.save();
j.startBuild().shouldSucceed();
assertThat(dock.cp("/tmp/odes.txt", "/tmp/"), is(true));
assertThat(!dock.cp("/tmp/old.txt", "/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_resources_and_remove_prefix.
@Test
public void publish_resources_and_remove_prefix() throws IOException {
DockerContainer dock = container.get();
Resource cpDir = resource("/ftp_plugin/");
Resource test = resource("/ftp_plugin/prefix_/test.txt");
FreeStyleJob j = jenkins.jobs.create();
configurePublisher("asd", dock);
j.configure();
{
j.copyDir(cpDir);
PublishGlobalPublisher fp = addGlobalPublisher(j);
PublishGlobalPublisher.GlobalPublishSite fps = fp.getDefault();
fps.getDefaultTransfer().sourceFile.set("prefix_/test.txt");
fps.getDefaultTransfer().removePrefix.set("prefix_");
}
j.save();
j.startBuild().shouldSucceed();
assertThat(dock.cp("/tmp/test.txt", "/tmp"), is(true));
assertThat(FileUtils.readFileToString(new File("/tmp/test.txt")), CoreMatchers.is(test.asText()));
}
Aggregations