use of hudson.model.FreeStyleProject 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);
}
use of hudson.model.FreeStyleProject in project promoted-builds-plugin by jenkinsci.
the class KeepBuildForeverActionTest method createProject.
private FreeStyleProject createProject(String name) throws Exception {
FreeStyleProject project = createFreeStyleProject(name);
project.getPublishersList().replaceBy(createFingerprinters());
return project;
}
use of hudson.model.FreeStyleProject in project promoted-builds-plugin by jenkinsci.
the class LastBuildPromotionStatusColumnTest method shouldDisplayStars.
@Test
public void shouldDisplayStars() throws Exception {
// Create project
FreeStyleProject p = j.createFreeStyleProject();
JobPropertyImpl base = new JobPropertyImpl(p);
p.addProperty(base);
PromotionProcess foo = base.addProcess("foo");
foo.icon = "star-blue";
view.add(p);
// Promote a build
FreeStyleBuild b1 = j.assertBuildStatusSuccess(p.scheduleBuild2(0));
foo.promote(b1, new Cause.UserIdCause(), new ManualPromotionBadge());
// Check column contents
LastBuildPromotionStatusColumn retrieved = view.getColumns().get(LastBuildPromotionStatusColumn.class);
assertEquals("Columns should be same", column, retrieved);
List<String> promotionIcons = retrieved.getPromotionIcons(p);
assertEquals("Expected only 1 promotion icon", 1, promotionIcons.size());
assertTrue("Promotion should assign the blue star", promotionIcons.get(0).contains("star-blue"));
}
use of hudson.model.FreeStyleProject in project promoted-builds-plugin by jenkinsci.
the class ItemPathResolverTest method shouldRetainTheLegacyBehaviorIfEnabled.
@Test
public void shouldRetainTheLegacyBehaviorIfEnabled() throws Exception {
assertsPath("prj", null, projectInTop);
// FOO exists on both top level and within the folder
final MockFolder folder = rule.createFolder("F");
final FreeStyleProject prjInRoot = rule.createFreeStyleProject("FOO");
final FreeStyleProject prjInFolder = folder.createProject(FreeStyleProject.class, "FOO");
// Raw addressing with different roots, should always point to the root
assertsPath("FOO", null, prjInRoot);
assertsPath("FOO", prjInRoot, prjInRoot);
assertsPath("FOO", folder, prjInRoot);
assertsPath("FOO", prjInFolder, prjInRoot);
}
use of hudson.model.FreeStyleProject in project blueocean-plugin by jenkinsci.
the class PipelineApiTest method findPipelineRunsForAPipelineTest.
@Test
public void findPipelineRunsForAPipelineTest() throws Exception {
FreeStyleProject p1 = j.createFreeStyleProject("pipeline1");
FreeStyleProject p2 = j.createFreeStyleProject("pipeline2");
p1.getBuildersList().add(new Shell("echo hello!\nsleep 1"));
p2.getBuildersList().add(new Shell("echo hello!\nsleep 1"));
Stack<FreeStyleBuild> builds = new Stack<FreeStyleBuild>();
FreeStyleBuild b11 = p1.scheduleBuild2(0).get();
FreeStyleBuild b12 = p1.scheduleBuild2(0).get();
builds.push(b11);
builds.push(b12);
j.assertBuildStatusSuccess(b11);
j.assertBuildStatusSuccess(b12);
List<Map> resp = get("/search?q=type:run;organization:jenkins;pipeline:pipeline1", List.class);
assertEquals(builds.size(), resp.size());
for (int i = 0; i < builds.size(); i++) {
Map p = resp.get(i);
FreeStyleBuild b = builds.pop();
validateRun(b, p);
}
}
Aggregations