hudson.model.Project.scheduleBuild2()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(116)

本文整理了Java中hudson.model.Project.scheduleBuild2()方法的一些代码示例,展示了Project.scheduleBuild2()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Project.scheduleBuild2()方法的具体详情如下:
包路径:hudson.model.Project
类名称:Project
方法名:scheduleBuild2

Project.scheduleBuild2介绍

暂无

代码示例

代码示例来源:origin: com.cisco.step.jenkins.plugins/jenkow-plugin

if (!wrappers.contains(wrapper.getDescriptor())) wrappers.add(wrapper);
p.scheduleBuild2(jenkins.getQuietPeriod(),new WorkflowCause("triggered by workflow"),ja);
return;

代码示例来源:origin: jenkinsci/rebuild-plugin

/**
 * Tests with no extensions.
 *
 * @throws IOException
 *             IOException
 * @throws InterruptedException
 *             InterruptedException
 * @throws ExecutionException
 *             ExecutionException
 */
public void testNoRebuildValidatorExtension() throws IOException,
    InterruptedException, ExecutionException {
  Project projectA = createFreeStyleProject("testFreeStyleA");
  Build buildA = (Build) projectA.scheduleBuild2(
      0,
      new Cause.UserIdCause(),
      new ParametersAction(new StringParameterValue("party",
          "megaparty"))).get();
  assertNotNull(buildA.getAction(RebuildAction.class));
}

代码示例来源:origin: jenkinsci/rebuild-plugin

/**
 * Tests with an extension returning isApplicable false.
 *
 * @throws IOException
 *             IOException
 * @throws InterruptedException
 *             InterruptedException
 * @throws ExecutionException
 *             ExecutionException
 */
public void testRebuildValidatorExtensionIsApplicableFalse()
    throws IOException, InterruptedException, ExecutionException {
  hudson.getExtensionList(RebuildValidator.class).add(0,
      new ValidatorNeverApplicable());
  Project projectA = createFreeStyleProject("testFreeStyleC");
  Build buildA = (Build) projectA.scheduleBuild2(
      0,
      new Cause.UserIdCause(),
      new ParametersAction(new StringParameterValue("party",
          "megaparty"))).get();
  assertNotNull(buildA.getAction(RebuildAction.class));
}

代码示例来源:origin: jenkinsci/rebuild-plugin

/**
 * Tests with an extension returning isApplicable true.
 *
 * @throws IOException
 *             IOException
 * @throws InterruptedException
 *             InterruptedException
 * @throws ExecutionException
 *             ExecutionException
 */
public void testRebuildValidatorExtensionIsApplicableTrue()
    throws IOException, InterruptedException, ExecutionException {
  hudson.getExtensionList(RebuildValidator.class).add(0,
      new ValidatorAlwaysApplicable());
  Project projectA = createFreeStyleProject("testFreeStyleB");
  Build buildA = (Build) projectA.scheduleBuild2(
      0,
      new Cause.UserIdCause(),
      new ParametersAction(new StringParameterValue("party",
          "megaparty"))).get();
  assertNull(buildA.getAction(RebuildAction.class));
}

代码示例来源:origin: jenkinsci/rebuild-plugin

/**
 * Tests with two extensions returning isApplicable true AND false.
 *
 * @throws IOException
 *             IOException
 * @throws InterruptedException
 *             InterruptedException
 * @throws ExecutionException
 *             ExecutionException
 */
public void testRebuildValidatorExtensionIsApplicableTrueFalse()
    throws IOException, InterruptedException, ExecutionException {
  hudson.getExtensionList(RebuildValidator.class).add(0,
      new ValidatorAlwaysApplicable());
  hudson.getExtensionList(RebuildValidator.class).add(0,
      new ValidatorNeverApplicable());
  Project projectA = createFreeStyleProject("testFreeStyleC");
  Build buildA = (Build) projectA.scheduleBuild2(
      0,
      new Cause.UserIdCause(),
      new ParametersAction(new StringParameterValue("party",
          "megaparty"))).get();
  assertNull(buildA.getAction(RebuildAction.class));
}

相关文章