use of org.jvnet.hudson.test.Bug in project hudson-2.x by hudson.
the class CronTabTest method testFloor4.
@Bug(8401)
public void testFloor4() throws Exception {
// conflict between DoM and DoW. In this we need to find a day that's the first day of a month and Sunday in 2010
CronTab x = new CronTab("0 0 1 * 0");
Calendar c = new GregorianCalendar(2011, 0, 1, 15, 55);
c.setFirstDayOfWeek(MONDAY);
// the last such day in 2010 is Aug 1st
GregorianCalendar answer = new GregorianCalendar(2010, 7, 1, 0, 0);
answer.setFirstDayOfWeek(MONDAY);
compare(answer, x.floor(c));
}
use of org.jvnet.hudson.test.Bug in project promoted-builds-plugin by jenkinsci.
the class SelfPromotionTest method testPromotionEnvironmentShouldIncludeTargetParameters.
@Bug(22679)
public // @Bug(34826) // Can be reproduced in Jenkins 2.3 +
void testPromotionEnvironmentShouldIncludeTargetParameters() throws Exception {
String paramName = "param";
FreeStyleProject p = createFreeStyleProject();
p.addProperty(new ParametersDefinitionProperty(new StringParameterDefinition(paramName, "")));
// promote if the downstream passes
JobPropertyImpl promotion = new JobPropertyImpl(p);
p.addProperty(promotion);
PromotionProcess promo1 = promotion.addProcess("promo1");
promo1.conditions.add(new SelfPromotionCondition(false));
// ensure that the data survives the roundtrip
configRoundtrip(p);
// rebind
promotion = p.getProperty(JobPropertyImpl.class);
promo1 = promotion.getItem("promo1");
String paramValue = "someString";
FreeStyleBuild b = assertBuildStatusSuccess(p.scheduleBuild2(0, new Cause.UserCause(), new ParametersAction(new StringParameterValue(paramName, paramValue))));
// internally, the promotion is still an asynchronous process. It just happens
// right away after the build is complete.
Thread.sleep(1000);
// verify that the promotion's environment contains the parameter from the target build.
Promotion pb = promo1.getBuildByNumber(1);
assertEquals(paramValue, pb.getEnvironment(TaskListener.NULL).get(paramName, null));
}
use of org.jvnet.hudson.test.Bug in project promoted-builds-plugin by jenkinsci.
the class ConfigurationRoundtripTest method testLoad.
@LocalData
@Bug(17341)
public void testLoad() throws Exception {
FreeStyleProject j = jenkins.getItemByFullName("j", FreeStyleProject.class);
assertNotNull(j);
Promotion p = j.getProperty(JobPropertyImpl.class).getItem("OK").getBuildByNumber(1);
assertNotNull(p);
}
Aggregations