當前位置: 首頁>>代碼示例>>Java>>正文


Java FreeStyleProject.setAssignedLabel方法代碼示例

本文整理匯總了Java中hudson.model.FreeStyleProject.setAssignedLabel方法的典型用法代碼示例。如果您正苦於以下問題:Java FreeStyleProject.setAssignedLabel方法的具體用法?Java FreeStyleProject.setAssignedLabel怎麽用?Java FreeStyleProject.setAssignedLabel使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在hudson.model.FreeStyleProject的用法示例。


在下文中一共展示了FreeStyleProject.setAssignedLabel方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: call

import hudson.model.FreeStyleProject; //導入方法依賴的package包/類
@Override
public Boolean call() throws Throwable {
    final Jenkins jenkins = Jenkins.getInstance();

    // prepare job
    final FreeStyleProject project = jenkins.createProject(FreeStyleProject.class, "freestyle-project");
    final Shell env = new Shell("env");
    project.getBuildersList().add(env);
    project.setAssignedLabel(new LabelAtom(DOCKER_CLOUD_LABEL));
    project.save();

    LOG.trace("trace test.");
    project.scheduleBuild(new TestCause());

    // image pull may take time
    waitUntilNoActivityUpTo(jenkins, 10 * 60 * 1000);

    final FreeStyleBuild lastBuild = project.getLastBuild();
    assertThat(lastBuild, not(nullValue()));
    assertThat(lastBuild.getResult(), is(Result.SUCCESS));

    assertThat(getLog(lastBuild), Matchers.containsString(TEST_VALUE));
    assertThat(getLog(lastBuild), Matchers.containsString(CLOUD_ID + "=" + DOCKER_CLOUD_NAME));

    return true;
}
 
開發者ID:KostyaSha,項目名稱:yet-another-docker-plugin,代碼行數:27,代碼來源:FreestyleTest.java

示例2: testNonDefaultJob

import hudson.model.FreeStyleProject; //導入方法依賴的package包/類
@Test public void testNonDefaultJob() throws Exception {
    FreeStyleProject project = j.createFreeStyleProject();
    j.createSlave("abc", null);
    project.setAssignedLabel(j.jenkins.getLabel("abc"));
    project.save();
    assertFalse(checker.executeCheck(project));
}
 
開發者ID:v1v,項目名稱:jenkinslint-plugin,代碼行數:8,代碼來源:MasterLabelCheckerTestCase.java

示例3: testWithAssignedLabel

import hudson.model.FreeStyleProject; //導入方法依賴的package包/類
@Test public void testWithAssignedLabel() throws Exception {
    FreeStyleProject project = j.createFreeStyleProject();
    j.createSlave("test",null);
    project.setAssignedLabel(j.jenkins.getLabel("test"));
    project.save();
    assertFalse(checker.executeCheck(project));
}
 
開發者ID:v1v,項目名稱:jenkinslint-plugin,代碼行數:8,代碼來源:JobAssignedLabelCheckerTestCase.java

示例4: provisionAndLaunch

import hudson.model.FreeStyleProject; //導入方法依賴的package包/類
@Test
public void provisionAndLaunch() throws Exception {
    FreeStyleProject p = j.createFreeStyleProject();
    p.setAssignedLabel(Label.get("label"));
    QueueTaskFuture<FreeStyleBuild> build = p.scheduleBuild2(0);

    j.jenkins.clouds.add(new TestCloud("dummy", j, new LaunchSuccessfully()));
    triggerProvisioning();

    List<ProvisioningActivity> activities;
    for (;;) {
        activities = CloudStatistics.get().getActivities();
        if (activities.size() > 0) break;
    }
    for (ProvisioningActivity a : activities) {
        assertEquals(activities.toString(), "dummy", a.getId().getCloudName());
        assertThat(activities.toString(), a.getId().getNodeName(), startsWith("dummy-slave-"));
        assertThat(activities.toString(), a.getName(), startsWith("dummy-slave-"));
    }

    ProvisioningActivity activity = activities.get(0);
    assertNotNull(activity.getPhaseExecution(PROVISIONING));
    assertEquals(activity.getPhaseExecution(PROVISIONING).getAttachments().toString(), OK, activity.getStatus());

    // It can take a bit
    while (j.jenkins.getComputer(activity.getId().getNodeName()) == null) {
        System.out.println("Waiting for node");
        Thread.sleep(100);
    }
    Computer computer = j.jenkins.getComputer(activity.getId().getNodeName());
    assertNotNull(computer);

    while (activity.getPhaseExecution(LAUNCHING) == null) {
        System.out.println("Waiting for launch to start");
        Thread.sleep(100);
    }

    while (activity.getPhaseExecution(OPERATING) == null) {
        System.out.println("Waiting for slave to launch");
        Thread.sleep(100);
    }

    System.out.println("Waiting for slave to launch");
    computer.waitUntilOnline();
    assertNull(activity.getPhaseExecution(COMPLETED));

    System.out.println("Waiting for build to complete");
    Computer builtOn = build.get().getBuiltOn().toComputer();
    assertEquals(computer, builtOn);

    computer.doDoDelete();

    assertEquals(OK, activity.getStatus());

    detectCompletionNow();
    assertNotNull(activity.getCurrentPhase().toString(), activity.getPhaseExecution(COMPLETED));
}
 
開發者ID:jenkinsci,項目名稱:cloud-stats-plugin,代碼行數:58,代碼來源:CloudStatisticsTest.java

示例5: testWithAssignedLabel

import hudson.model.FreeStyleProject; //導入方法依賴的package包/類
@Test public void testWithAssignedLabel() throws Exception {
    FreeStyleProject project = j.createFreeStyleProject();
    project.setAssignedLabel(j.jenkins.getLabel("master"));
    project.save();
    assertTrue(checker.executeCheck(project));
}
 
開發者ID:v1v,項目名稱:jenkinslint-plugin,代碼行數:7,代碼來源:MasterLabelCheckerTestCase.java


注:本文中的hudson.model.FreeStyleProject.setAssignedLabel方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。