use of org.jenkinsci.test.acceptance.junit.Resource in project acceptance-test-harness by jenkinsci.
the class GlobalPublishPluginTest method publish_with_default_pattern.
@Test
public void publish_with_default_pattern() {
DockerContainer dock = container.get();
Resource cpDir = resource("/ftp_plugin/");
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,odes.txt");
}
j.save();
j.startBuild().shouldSucceed();
assertThat(dock.cp("/tmp/prefix_/test.txt", "/tmp"), is(true));
assertThat(dock.cp("/tmp/odes.txt", "/tmp"), is(true));
assertThat(new File("/tmp/test.txt").exists(), is(true));
assertThat(new File("/tmp/odes.txt").exists(), is(true));
}
use of org.jenkinsci.test.acceptance.junit.Resource 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.junit.Resource 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.junit.Resource 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.junit.Resource 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));
}
Aggregations