• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java MatrixRun类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中hudson.matrix.MatrixRun的典型用法代码示例。如果您正苦于以下问题:Java MatrixRun类的具体用法?Java MatrixRun怎么用?Java MatrixRun使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



MatrixRun类属于hudson.matrix包,在下文中一共展示了MatrixRun类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: testMatrixToMatrix

import hudson.matrix.MatrixRun; //导入依赖的package包/类
/** Test artifact copy between matrix jobs, for artifact from matching axis */
@Test
public void testMatrixToMatrix() throws Exception {
    MatrixProject other = createMatrixArtifactProject(),
                  p = createMatrixProject();
    p.setAxes(new AxisList(new Axis("FOO", "one", "two"))); // should match other job
    p.getBuildersList().add(CopyArtifactUtil.createRunSelector(other.getName() + "/FOO=$FOO", null,
            new StatusRunSelector(StatusRunSelector.BuildStatus.STABLE), "", "", false, false, true));
    rule.assertBuildStatusSuccess(other.scheduleBuild2(0, new UserCause()).get());
    MatrixBuild b = p.scheduleBuild2(0, new UserCause()).get();
    rule.assertBuildStatusSuccess(b);
    MatrixRun r = b.getRun(new Combination(Collections.singletonMap("FOO", "one")));
    assertFile(true, "one.txt", r);
    assertFile(false, "two.txt", r);
    r = b.getRun(new Combination(Collections.singletonMap("FOO", "two")));
    assertFile(false, "one.txt", r);
    assertFile(true, "two.txt", r);
}
 
开发者ID:jenkinsci,项目名称:run-selector-plugin,代码行数:19,代码来源:CopyArtifactTest.java


示例2: getPollingLogFile

import hudson.matrix.MatrixRun; //导入依赖的package包/类
@Nonnull
public File getPollingLogFile() {
    File pollingFile;
    if (nonNull(job)) {
        pollingFile = job.getRootDir();
    } else if (run instanceof MatrixRun) {
        MatrixRun matrixRun = (MatrixRun) run;
        pollingFile = matrixRun.getParentBuild().getRootDir();
    } else if (run instanceof MatrixBuild) {
        pollingFile = run.getRootDir();
    } else if (nonNull(run)) {
        pollingFile = run.getRootDir();
    } else {
        throw new IllegalStateException("Can't get polling log file: no run or job initialised");
    }

    return new File(pollingFile, getPollingFileName());
}
 
开发者ID:KostyaSha,项目名称:github-integration-plugin,代码行数:19,代码来源:GitHubPollingLogAction.java


示例3: matrixProjectTest

import hudson.matrix.MatrixRun; //导入依赖的package包/类
@Test
public void matrixProjectTest() throws IOException, InterruptedException, ExecutionException {
    EnvVars env;
    MatrixProject p = jenkins.jenkins.createProject(MatrixProject.class, "matrixbuild");
    GitLabWebHookCause cause = new GitLabWebHookCause(generateCauseData());
    // set up 2x2 matrix
    AxisList axes = new AxisList();
    axes.add(new TextAxis("db","mysql","oracle"));
    axes.add(new TextAxis("direction","north","south"));
    p.setAxes(axes);

    MatrixBuild build = p.scheduleBuild2(0, cause).get();
    List<MatrixRun> runs = build.getRuns();
    assertEquals(4,runs.size());
    for (MatrixRun run : runs) {
        env = run.getEnvironment(listener);
        assertNotNull(env.get("db"));
        assertEnv(env);
    }
}
 
开发者ID:jenkinsci,项目名称:gitlab-plugin,代码行数:21,代码来源:GitLabEnvironmentContributorTest.java


示例4: ghCauseFromRun

import hudson.matrix.MatrixRun; //导入依赖的package包/类
/**
 * matrix-project requires special extraction.
 */
@CheckForNull
public static <T extends Cause> T ghCauseFromRun(Run<?, ?> run, Class<T> tClass) {
    if (run instanceof MatrixRun) {
        MatrixBuild parentBuild = ((MatrixRun) run).getParentBuild();
        if (nonNull(parentBuild)) {
            return parentBuild.getCause(tClass);
        }
    } else {
        return run.getCause(tClass);
    }

    return null;
}
 
开发者ID:KostyaSha,项目名称:github-integration-plugin,代码行数:17,代码来源:JobHelper.java


示例5: testChildStatuses

import hudson.matrix.MatrixRun; //导入依赖的package包/类
@Test
public void testChildStatuses() throws Exception {
    final MatrixProject matrixProject = jRule.jenkins.createProject(MatrixProject.class, "matrix-project");

    matrixProject.addProperty(getPreconfiguredProperty(ghRule.getGhRepo()));
    matrixProject.addTrigger(getPreconfiguredPRTrigger());

    matrixProject.getBuildersList().add(new GitHubPRStatusBuilder());
    matrixProject.getBuildersList().add(new Shell("sleep 10"));

    matrixProject.getPublishersList().add(new GitHubPRBuildStatusPublisher());
    matrixProject.getPublishersList().add(new GitHubPRCommentPublisher(new GitHubPRMessage("Comment"), null, null));

    matrixProject.setAxes(
            new AxisList(
                    new TextAxis("first_axis", "first_value1", "first_value2"),
                    new TextAxis("second_axis", "sec_value1", "sec_value2")
            )
    );

    matrixProject.save();

    super.basicTest(matrixProject);

    for (MatrixBuild build : matrixProject.getBuilds()) {
        for (MatrixRun matrixRun : build.getRuns()) {
            jRule.assertLogNotContains("\tat", matrixRun);
        }
    }
}
 
开发者ID:KostyaSha,项目名称:github-integration-plugin,代码行数:31,代码来源:MatrixProjectITest.java


示例6: buildEnvironmentFor

import hudson.matrix.MatrixRun; //导入依赖的package包/类
@Override
public void buildEnvironmentFor(@Nonnull Run r, @Nonnull EnvVars envs, @Nonnull TaskListener listener) throws IOException, InterruptedException {
    GitLabWebHookCause cause = null;
    if (r instanceof MatrixRun) {
        MatrixBuild parent = ((MatrixRun)r).getParentBuild();
        if (parent != null) {
            cause = (GitLabWebHookCause) parent.getCause(GitLabWebHookCause.class);
        }
    } else {
        cause = (GitLabWebHookCause) r.getCause(GitLabWebHookCause.class);
    }
    if (cause != null) {
        envs.overrideAll(cause.getData().getBuildVariables());
    }
}
 
开发者ID:jenkinsci,项目名称:gitlab-plugin,代码行数:16,代码来源:GitLabEnvironmentContributor.java


示例7: abortRunning

import hudson.matrix.MatrixRun; //导入依赖的package包/类
public synchronized int abortRunning(int number) throws IllegalAccessException {
        int aborted = 0;

        Computer[] computers = getJenkinsInstance().getComputers();
        for (Computer computer : computers) {
            if (isNull(computer)) {
                continue;
            }

            List<Executor> executors = computer.getExecutors();
            executors.addAll(computer.getOneOffExecutors());

            for (Executor executor : executors) {
                if (isNull(executor) || !executor.isBusy() || nonNull(executor.getCauseOfDeath()) ||
                        !getInterruptCauses(executor).isEmpty() || getInterruptStatus(executor) == Result.ABORTED) {
                    continue;
                }

                Queue.Executable executable = executor.getCurrentExecutable();
                final SubTask parent = executable.getParent();

                if (!(executable instanceof Run)) {
                    continue;
                }
                final Run executableRun = (Run) executable;

                if (!(parent instanceof Job)) {
                    continue;
                }
                final Job parentJob = (Job) parent;

                if (!parentJob.getFullName().equals(job.getFullName())) {
                    // name doesn't match
                    continue;
                }

                if (executableRun.getResult() == Result.ABORTED) {
                    // was already aborted
                    continue;
                }

                if (executableRun instanceof MatrixRun) {
                    // the whole MatrixBuild will be aborted
                    continue;
                }
//                if (executable instanceof MatrixBuild) {
//                    final MatrixBuild executable1 = (MatrixBuild) executable;
//                    executable1.doStop()
//                }

                final GitHubPRCause causeAction = (GitHubPRCause) executableRun.getCause(GitHubPRCause.class);
                if (nonNull(causeAction) && causeAction.getNumber() == number) {
                    LOGGER.info("Aborting '{}', by interrupting '{}'", executableRun, executor);
                    executor.interrupt(Result.ABORTED, new NewPRInterruptCause());
                    aborted++;
                }
            }
        }

        return aborted;
    }
 
开发者ID:KostyaSha,项目名称:github-integration-plugin,代码行数:62,代码来源:JobRunnerForCause.java


示例8: testAbortRunningMatrixProject

import hudson.matrix.MatrixRun; //导入依赖的package包/类
@Test
@RandomlyFails(value = "No idea why matrix doesn't work normally")
public void testAbortRunningMatrixProject() throws Exception {

    MockFolder folder = j.createFolder("Matrix_folder");

    MatrixProject job1 = folder.createProject(MatrixProject.class, "project1");
    job1.setDisplayName("project1 display name");
    job1.setConcurrentBuild(true);
    job1.getBuildersList().add(new SleepBuilder());
    job1.setAxes(
            new AxisList(
                    new TextAxis("first_axis", "first_value1"),
                    new TextAxis("second_axis", "sec_value1")
            )
    );
    configRoundTripUnsecure(job1);
    job1.save();

    MatrixProject job2 = folder.createProject(MatrixProject.class, "project2");
    job2.setDisplayName("project1 display name");
    job2.setConcurrentBuild(true);
    job2.getBuildersList().add(new SleepBuilder());
    job2.setAxes(
            new AxisList(
                    new TextAxis("first_axis", "first_value1"),
                    new TextAxis("second_axis", "sec_value1")
            )
    );
    configRoundTripUnsecure(job2);
    job2.save();

    MatrixProject job3 = folder.createProject(MatrixProject.class, "project3");
    job3.setDisplayName("project1 display name");
    job3.setConcurrentBuild(true);
    job3.getBuildersList().add(new SleepBuilder());
    job3.setAxes(
            new AxisList(
                    new TextAxis("first_axis", "first_value1"),
                    new TextAxis("second_axis", "sec_value1")
            )
    );
    configRoundTripUnsecure(job3);
    job3.save();

    testAbortRunning(job1, job2, job3);

    assertThat(job1.getBuilds(), hasSize(3));

    for (MatrixBuild matrixBuild : job1.getBuilds()) {
        assertThat(matrixBuild.getResult(), is(Result.ABORTED));
        assertThat(matrixBuild.getRuns(), not(empty()));
        for (MatrixRun matrixRun : matrixBuild.getRuns()) {
            assertThat(matrixRun.getResult(), is(Result.ABORTED));
        }
    }
}
 
开发者ID:KostyaSha,项目名称:github-integration-plugin,代码行数:58,代码来源:AbortRunningJobRunnerCauseTest.java


示例9: onCompleted

import hudson.matrix.MatrixRun; //导入依赖的package包/类
@Override
public void onCompleted(Run run, TaskListener listener) {

	if (run instanceof MatrixRun) {
		return;
	}

	try {
		EnvVars env = run.getEnvironment(listener);
		String fail = env.get(ReviewProp.FAIL.getProp());
		String pass = env.get(ReviewProp.PASS.getProp());

		Result result = run.getResult();
		if (result == null) {
			logger.warning("Result is null!");
			return;
		}

		Jenkins j = Jenkins.getInstance();
		if (j == null) {
			logger.warning("Jenkins instance is null!");
			return;
		}
		
		// only process valid URLs (this gets triggered for non Reviews too)
		String url = (result.equals(Result.SUCCESS)) ? pass : fail;
		if (url != null && !url.isEmpty()) {
			String rootUrl = j.getRootUrl();
			if (rootUrl == null) {
				JenkinsLocationConfiguration globalConfig = new JenkinsLocationConfiguration();
				rootUrl = (globalConfig.getUrl() == null) ? "unset" : globalConfig.getUrl();
			}
			String path = run.getUrl();
			postURL(url, rootUrl + path);
		} 
		
	} catch (Exception e) {
		logger.warning("Unable to Notify Review");
		e.printStackTrace();
	}
	return;
}
 
开发者ID:p4paul,项目名称:p4-jenkins,代码行数:43,代码来源:ReviewNotifier.java


示例10: hasResult

import hudson.matrix.MatrixRun; //导入依赖的package包/类
@Override
protected boolean hasResult(final MatrixRun run) {
    return getAction(run) != null;
}
 
开发者ID:jenkinsci,项目名称:dependency-check-plugin,代码行数:5,代码来源:DependencyCheckAnnotationsAggregator.java


示例11: getResult

import hudson.matrix.MatrixRun; //导入依赖的package包/类
@Override
protected DependencyCheckResult getResult(final MatrixRun run) {
    return getAction(run).getResult();
}
 
开发者ID:jenkinsci,项目名称:dependency-check-plugin,代码行数:5,代码来源:DependencyCheckAnnotationsAggregator.java


示例12: getAction

import hudson.matrix.MatrixRun; //导入依赖的package包/类
private DependencyCheckResultAction getAction(final MatrixRun run) {
    return run.getAction(DependencyCheckResultAction.class);
}
 
开发者ID:jenkinsci,项目名称:dependency-check-plugin,代码行数:4,代码来源:DependencyCheckAnnotationsAggregator.java


示例13: getResult

import hudson.matrix.MatrixRun; //导入依赖的package包/类
@Override
protected CheckStyleResult getResult(final MatrixRun run) {
    return getAction(run).getResult();
}
 
开发者ID:davidparsson,项目名称:jslint-checkstyle-plugin,代码行数:5,代码来源:CheckStyleAnnotationsAggregator.java


示例14: getAction

import hudson.matrix.MatrixRun; //导入依赖的package包/类
private CheckStyleResultAction getAction(final MatrixRun run) {
    return run.getAction(CheckStyleResultAction.class);
}
 
开发者ID:davidparsson,项目名称:jslint-checkstyle-plugin,代码行数:4,代码来源:CheckStyleAnnotationsAggregator.java



注:本文中的hudson.matrix.MatrixRun类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java RoundUtils类代码示例发布时间:2022-05-22
下一篇:
Java SinglePartitionWithoutOffsetsSystemAdmin类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap