Skip to content
Permalink
Browse files

[JENKINS-14266] Confirming fix with a test.

  • Loading branch information
jglick committed May 1, 2013
1 parent 4a99b91 commit 8d3a3c84b3aa8d499adb77b4345badbe98e73f25
Showing with 23 additions and 0 deletions.
  1. +23 −0 src/test/java/hudson/plugins/copyartifact/SpecificBuildSelectorTest.java
@@ -0,0 +1,23 @@
package hudson.plugins.copyartifact;

import hudson.EnvVars;
import hudson.model.FreeStyleProject;
import org.jvnet.hudson.test.Bug;
import org.jvnet.hudson.test.HudsonTestCase;

public class SpecificBuildSelectorTest extends HudsonTestCase {

@Bug(14266)
public void testUnsetVar() throws Exception {
FreeStyleProject p = createFreeStyleProject();
assertBuildStatusSuccess(p.scheduleBuild2(0));
assertBuildStatusSuccess(p.scheduleBuild2(0));
assertBuildStatusSuccess(p.scheduleBuild2(0));
assertEquals(3, p.getLastBuild().number);
BuildSelector s = new SpecificBuildSelector("$NUM");
BuildFilter f = new BuildFilter();
assertEquals(p.getBuildByNumber(2), s.getBuild(p, new EnvVars("NUM", "2"), f, null));
assertEquals(null, s.getBuild(p, new EnvVars("HUM", "two"), f, null));
}

}

0 comments on commit 8d3a3c8

Please sign in to comment.
You can’t perform that action at this time.