Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #200 from raul-arabaolaza/JENKINS-38788
[JENKINS-37276] Path atributes can change values if reordered
- Loading branch information
Showing
3 changed files
with
85 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package core; | ||
|
||
import org.apache.commons.lang.SystemUtils; | ||
import org.jenkinsci.test.acceptance.junit.AbstractJUnitTest; | ||
import org.jenkinsci.test.acceptance.po.AggregateDownstreamTestResults; | ||
import org.jenkinsci.test.acceptance.po.ArtifactArchiver; | ||
import org.jenkinsci.test.acceptance.po.BuildTrigger; | ||
import org.jenkinsci.test.acceptance.po.Fingerprint; | ||
import org.jenkinsci.test.acceptance.po.FreeStyleJob; | ||
import org.jenkinsci.test.acceptance.po.JUnitPublisher; | ||
import org.junit.Test; | ||
|
||
public class PublisherOrderTest extends AbstractJUnitTest { | ||
|
||
@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(); | ||
} | ||
|
||
@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"); | ||
} | ||
} |