use of hudson.plugins.promoted_builds.conditions.ManualCondition in project promoted-builds-plugin by jenkinsci.
the class PromotionTargetActionTest method test1.
/**
* When a project is created, built, and renamed, then the old build is created,
* that results in NPE.
*/
public void test1() throws Exception {
FreeStyleProject up = createFreeStyleProject("up");
up.setCustomWorkspace(createTmpDir().getPath());
// promote if the downstream passes
JobPropertyImpl promotion = new JobPropertyImpl(up);
up.addProperty(promotion);
PromotionProcess proc = promotion.addProcess("promo");
proc.conditions.add(new ManualCondition());
FreeStyleBuild b = assertBuildStatusSuccess(up.scheduleBuild2(0));
b.addAction(new ManualApproval(proc.getName(), Collections.<ParameterValue>emptyList()));
b.save();
// check for promotion
Promotion p = assertBuildStatusSuccess(proc.considerPromotion2(b));
up.renameTo("up2");
assertSame(b, p.getTarget());
}
use of hudson.plugins.promoted_builds.conditions.ManualCondition in project promoted-builds-plugin by jenkinsci.
the class Status method isManuallyApproved.
public boolean isManuallyApproved() {
final PromotionProcess process = getProcess();
if (process == null) {
// Should not be processed
return false;
}
ManualCondition manualCondition = (ManualCondition) process.getPromotionCondition(ManualCondition.class.getName());
return manualCondition != null;
}
Aggregations