use of org.jenkinsci.test.acceptance.junit.Resource in project acceptance-test-harness by jenkinsci.
the class GlobalPublishPluginTest method publish_with_own_pattern.
@Test
public void publish_with_own_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().patternSeparator.set("[;]+");
fps.getDefaultTransfer().sourceFile.set("te,st.txt;odes.txt");
}
j.save();
j.startBuild().shouldSucceed();
assertThat(dock.cp("/tmp/te,st.txt", "/tmp"), is(true));
assertThat(dock.cp("/tmp/odes.txt", "/tmp"), is(true));
assertThat(new File("/tmp/te,st.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_without_flatten_files.
@Test
@Ignore
public void publish_without_flatten_files() {
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("flat/odes.txt,odes.txt");
}
j.save();
j.startBuild().shouldSucceed();
assertThat(dock.cp("/tmp/flat/odes.txt", "/tmp/flat"), is(true));
assertThat(dock.cp("/tmp/odes.txt", "/tmp/"), is(true));
}
use of org.jenkinsci.test.acceptance.junit.Resource in project acceptance-test-harness by jenkinsci.
the class GlobalPublishPluginTest method publish_with_empty_directory.
@Test
public void publish_with_empty_directory() throws IOException {
DockerContainer dock = container.get();
Resource cpTxt = resource("/ftp_plugin/odes.txt");
File tmpDir = createTempDirectory();
File nestedEmptyDir = new File(tmpDir + "/empty");
nestedEmptyDir.mkdir();
FreeStyleJob j = jenkins.jobs.create();
configurePublisher("asd", dock);
j.configure();
{
j.copyResource(cpTxt);
j.copyFile(tmpDir);
PublishGlobalPublisher fp = addGlobalPublisher(j);
PublishGlobalPublisher.GlobalPublishSite fps = fp.getDefault();
fps.getDefaultTransfer().sourceFile.set("empty/,odes.txt");
fps.getDefaultTransfer().makeEmptyDirs.check();
}
j.save();
j.startBuild().shouldSucceed();
assertThat(dock.cp("/tmp/odes.txt", "/tmp/"), is(true));
assertThat(dock.cp("/tmp/empty", "/tmp/"), is(true));
}
use of org.jenkinsci.test.acceptance.junit.Resource in project acceptance-test-harness by jenkinsci.
the class GlobalPublishPluginTest method publish_multiple_servers.
@Test
@Ignore
public void publish_multiple_servers() {
DockerContainer dock = container.get();
DockerContainer dock2 = injector.getInstance(DockerContainerHolder.class).get();
Resource cpTxt = resource("/ftp_plugin/odes.txt");
FreeStyleJob j = jenkins.jobs.create();
configurePublisher("docker1", dock);
configurePublisher("docker2", dock2);
j.configure();
{
j.copyResource(cpTxt);
PublishGlobalPublisher fp = addGlobalPublisher(j);
PublishGlobalPublisher.GlobalPublishSite fps = fp.getDefault();
fps.configName.select("docker1");
fps.getDefaultTransfer().sourceFile.set("odes.txt");
PublishGlobalPublisher.GlobalPublishSite fps2 = fp.addServer();
fps2.configName.select("docker2");
fps2.getDefaultTransfer().sourceFile.set("odes.txt");
}
j.save();
j.startBuild().shouldSucceed();
assertThat(dock.cp("/tmp/odes.txt", "/tmp/dockertmp"), is(true));
assertThat(dock.cp("/tmp/odes.txt", "/tmp/dockertmp2"), is(true));
}
use of org.jenkinsci.test.acceptance.junit.Resource 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));
}
Aggregations