Search in sources :

Example 1 with Fingerprint

use of org.jenkinsci.test.acceptance.po.Fingerprint in project acceptance-test-harness by jenkinsci.

the class PublisherOrderTest method testOrdered.

@Test
public void testOrdered() {
    FreeStyleJob upstream = jenkins.jobs.create(FreeStyleJob.class);
    upstream.configure();
    String command = "echo 'hello' > aggregate.txt";
    if (SystemUtils.IS_OS_UNIX) {
        upstream.addShellStep(command);
    } else {
        upstream.addBatchStep(command);
    }
    AggregateDownstreamTestResults aggregate = upstream.addPublisher(AggregateDownstreamTestResults.class);
    aggregate.specify.check();
    ArtifactArchiver archiver = upstream.addPublisher(ArtifactArchiver.class);
    archiver.includes("aggregate.txt");
    BuildTrigger trigger = upstream.addPublisher(BuildTrigger.class);
    trigger.childProjects.set("projectName");
    Fingerprint fingerprint = upstream.addPublisher(Fingerprint.class);
    fingerprint.targets.set("aggregate.txt");
    upstream.save();
}
Also used : AggregateDownstreamTestResults(org.jenkinsci.test.acceptance.po.AggregateDownstreamTestResults) Fingerprint(org.jenkinsci.test.acceptance.po.Fingerprint) ArtifactArchiver(org.jenkinsci.test.acceptance.po.ArtifactArchiver) BuildTrigger(org.jenkinsci.test.acceptance.po.BuildTrigger) FreeStyleJob(org.jenkinsci.test.acceptance.po.FreeStyleJob) AbstractJUnitTest(org.jenkinsci.test.acceptance.junit.AbstractJUnitTest) Test(org.junit.Test)

Example 2 with Fingerprint

use of org.jenkinsci.test.acceptance.po.Fingerprint in project acceptance-test-harness by jenkinsci.

the class PublisherOrderTest method testUnordered.

@Test
public void testUnordered() {
    FreeStyleJob upstream = jenkins.jobs.create(FreeStyleJob.class);
    upstream.configure();
    String command = "echo 'hello' > aggregate.txt";
    if (SystemUtils.IS_OS_UNIX) {
        upstream.addShellStep(command);
    } else {
        upstream.addBatchStep(command);
    }
    ArtifactArchiver archiver = upstream.addPublisher(ArtifactArchiver.class);
    archiver.includes("aggregate.txt");
    BuildTrigger trigger = upstream.addPublisher(BuildTrigger.class);
    trigger.childProjects.set("projectName");
    Fingerprint fingerprint = upstream.addPublisher(Fingerprint.class);
    fingerprint.targets.set("aggregate.txt");
    AggregateDownstreamTestResults aggregate = upstream.addPublisher(AggregateDownstreamTestResults.class);
    aggregate.specify.check();
    fingerprint.targets.set("another.txt");
    upstream.save();
    upstream.configure();
    archiver.includes("another.txt");
    JUnitPublisher junit = upstream.addPublisher(JUnitPublisher.class);
    fingerprint.targets.set("yetanother");
}
Also used : AggregateDownstreamTestResults(org.jenkinsci.test.acceptance.po.AggregateDownstreamTestResults) JUnitPublisher(org.jenkinsci.test.acceptance.po.JUnitPublisher) Fingerprint(org.jenkinsci.test.acceptance.po.Fingerprint) ArtifactArchiver(org.jenkinsci.test.acceptance.po.ArtifactArchiver) BuildTrigger(org.jenkinsci.test.acceptance.po.BuildTrigger) FreeStyleJob(org.jenkinsci.test.acceptance.po.FreeStyleJob) AbstractJUnitTest(org.jenkinsci.test.acceptance.junit.AbstractJUnitTest) Test(org.junit.Test)

Aggregations

AbstractJUnitTest (org.jenkinsci.test.acceptance.junit.AbstractJUnitTest)2 AggregateDownstreamTestResults (org.jenkinsci.test.acceptance.po.AggregateDownstreamTestResults)2 ArtifactArchiver (org.jenkinsci.test.acceptance.po.ArtifactArchiver)2 BuildTrigger (org.jenkinsci.test.acceptance.po.BuildTrigger)2 Fingerprint (org.jenkinsci.test.acceptance.po.Fingerprint)2 FreeStyleJob (org.jenkinsci.test.acceptance.po.FreeStyleJob)2 Test (org.junit.Test)2 JUnitPublisher (org.jenkinsci.test.acceptance.po.JUnitPublisher)1