本文整理汇总了Java中com.cloudbees.plugins.flow.FlowRun类的典型用法代码示例。如果您正苦于以下问题:Java FlowRun类的具体用法?Java FlowRun怎么用?Java FlowRun使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FlowRun类属于com.cloudbees.plugins.flow包,在下文中一共展示了FlowRun类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getBuildManager
import com.cloudbees.plugins.flow.FlowRun; //导入依赖的package包/类
public static GhprcBuildManager getBuildManager(AbstractBuild<?, ?> build, JobConfiguration jobConfiguration) {
try {
if (build instanceof FlowRun) {
return new BuildFlowBuildManager(build, jobConfiguration);
}
} catch (NoClassDefFoundError ncdfe) {}
return new GhprcDefaultBuildManager(build);
}
开发者ID:bratchenko,项目名称:jenkins-github-pull-request-comments,代码行数:10,代码来源:GhprcBuildManagerFactoryUtil.java
示例2: downstreamProjects
import com.cloudbees.plugins.flow.FlowRun; //导入依赖的package包/类
/**
* Return a downstream iterator of a build of default type. This will be overriden by specific build types.
*
* @return the downstream builds as an iterator
*/
@Override
public Iterator<?> downstreamProjects() {
FlowRun flowRun = (FlowRun) build;
DirectedGraph<JobInvocation, FlowRun.JobEdge> directedGraph = flowRun.getJobsGraph();
return directedGraph.vertexSet().iterator();
}
示例3: shouldReturnBuildFlowManager
import com.cloudbees.plugins.flow.FlowRun; //导入依赖的package包/类
@Test
public void shouldReturnBuildFlowManager() throws Exception {
// GIVEN
BuildFlow buildFlowProject = jenkinsRule.createBuildFlowProject("BFPRJ");
GhprcBuildManager buildManager = GhprcBuildManagerFactoryUtil.getBuildManager(new FlowRun(buildFlowProject));
// THEN
assertThat(buildManager).isInstanceOf(BuildFlowBuildManager.class);
}
开发者ID:bratchenko,项目名称:jenkins-github-pull-request-comments,代码行数:11,代码来源:GhprcBuildManagerFactoryUtilTest.java
示例4: run
import com.cloudbees.plugins.flow.FlowRun; //导入依赖的package包/类
@Override
public void run(final String buildFlowPath) throws FlowExecutionException {
try {
BuildFlow buildFlowJob = new BuildFlow(build.getParent().getParent(), createJobName());
FlowRun flowRun = new FlowRun(buildFlowJob);
String fileContent = build.getWorkspace().child(buildFlowPath).readToString();
new FlowDSL().executeFlowScript(flowRun, fileContent, listener);
} catch (IOException | InterruptedException exc) {
throw new FlowExecutionException("Unable to execute build flow.", exc);
}
}
示例5: shouldCalculateUrlWithDownstreamBuilds
import com.cloudbees.plugins.flow.FlowRun; //导入依赖的package包/类
@Test
public void shouldCalculateUrlWithDownstreamBuilds() throws Exception {
// GIVEN
BuildFlow buildFlowProject = givenThatGhprcHasBeenTriggeredForABuildFlowProject();
// THEN
assertThat(buildFlowProject.getBuilds().toArray().length).isEqualTo(1);
FlowRun flowRun = buildFlowProject.getBuilds().getFirstBuild();
GhprcBuildManager buildManager = GhprcBuildManagerFactoryUtil.getBuildManager(flowRun);
assertThat(buildManager).isInstanceOf(BuildFlowBuildManager.class);
Iterator<?> iterator = buildManager.downstreamProjects();
StringBuilder expectedUrl = new StringBuilder();
int count = 0;
while (iterator.hasNext()) {
Object downstreamBuild = iterator.next();
assertThat(downstreamBuild).isInstanceOf(JobInvocation.class);
JobInvocation jobInvocation = (JobInvocation) downstreamBuild;
String jobInvocationBuildUrl = jobInvocation.getBuildUrl();
expectedUrl.append("\n<a href='");
expectedUrl.append(jobInvocationBuildUrl);
expectedUrl.append("'>");
expectedUrl.append(jobInvocationBuildUrl);
expectedUrl.append("</a>");
count++;
}
assertThat(count).isEqualTo(4);
assertThat(buildManager.calculateBuildUrl(null)).isEqualTo(expectedUrl.toString());
}
开发者ID:bratchenko,项目名称:jenkins-github-pull-request-comments,代码行数:43,代码来源:BuildFlowBuildManagerTest.java
示例6: MoreRecentFlowAbortCause
import com.cloudbees.plugins.flow.FlowRun; //导入依赖的package包/类
/**
* Construct a new MoreRecentFlowAbortCause to specify the reason for the abort was due to the fact that a
* more recent FlowRun was attempting to enter the same block.
*
* @param newer the FlowRun that is later than ours that was also attempting to enter the block
* @param block the block that was attempted to enter
*/
public MoreRecentFlowAbortCause(FlowRun newer, String block) {
this.newer = newer.getNumber();
this.block = block;
}