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

Java AxisList类代码示例

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

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



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

示例1: testMatrixToMatrix

import hudson.matrix.AxisList; //导入依赖的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: testMatrixAll

import hudson.matrix.AxisList; //导入依赖的package包/类
/** Test copying artifacts from all configurations of a matrix job */
@Test
public void testMatrixAll() throws Exception {
    MatrixProject mp = createMatrixProject();
    mp.setAxes(new AxisList(new Axis("ARCH", "sparc", "x86")));
    mp.getBuildersList().add(new ArchMatrixBuilder());
    mp.getPublishersList().add(new ArtifactArchiver("target/*", "", false, false));
    rule.assertBuildStatusSuccess(mp.scheduleBuild2(0, new UserCause()).get());
    FreeStyleProject p = createProject(mp.getName(), null, "", "", true, false, false, true);
    FreeStyleBuild b = p.scheduleBuild2(0, new UserCause()).get();
    rule.assertBuildStatusSuccess(b);
    assertFile(true, "ARCH=sparc/target/readme.txt", b);
    assertFile(true, "ARCH=sparc/target/sparc.out", b);
    assertFile(true, "ARCH=x86/target/readme.txt", b);
    assertFile(true, "ARCH=x86/target/x86.out", b);
}
 
开发者ID:jenkinsci,项目名称:run-selector-plugin,代码行数:17,代码来源:CopyArtifactTest.java


示例3: matrixProjectTest

import hudson.matrix.AxisList; //导入依赖的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: testStageNameForMultiConfiguration

import hudson.matrix.AxisList; //导入依赖的package包/类
@Test
@Issue("JENKINS-22654")
public void testStageNameForMultiConfiguration() throws Exception {
    MatrixProject project = jenkins.createMatrixProject("Multi");
    project.setAxes(new AxisList(new Axis("axis", "foo", "bar")));
    project.addProperty(new PipelineProperty("task", "stage", ""));

    Collection<MatrixConfiguration> configurations = project.getActiveConfigurations();

    for (MatrixConfiguration configuration : configurations) {
        List<Stage> stages = Stage.extractStages(configuration, null);
        assertEquals(1, stages.size());
        Stage stage = stages.get(0);
        assertEquals("stage", stage.getName());

    }

}
 
开发者ID:Diabol,项目名称:delivery-pipeline-plugin,代码行数:19,代码来源:StageTest.java


示例5: createMatrixArtifactProject

import hudson.matrix.AxisList; //导入依赖的package包/类
private MatrixProject createMatrixArtifactProject() throws IOException {
    MatrixProject p = createMatrixProject();
    p.setAxes(new AxisList(new Axis("FOO", "one", "two")));
    p.getBuildersList().add(new ArtifactBuilder());
    p.getPublishersList().add(new ArtifactArchiver("**", "", false, false));
    return p;
}
 
开发者ID:jenkinsci,项目名称:run-selector-plugin,代码行数:8,代码来源:CopyArtifactTest.java


示例6: testChildStatuses

import hudson.matrix.AxisList; //导入依赖的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


示例7: decode

import hudson.matrix.AxisList; //导入依赖的package包/类
@Override
public Object decode(Class targetClass, Object fromDBObject, MappedField optionalExtraInfo) {
    if (fromDBObject == null) return null;

    BasicDBList rawList = (BasicDBList) fromDBObject;

    AxisList axisList = new AxisList();
    for (Object obj : rawList) {
        DBObject dbObj = (DBObject) obj;
        axisList.add((Axis) getMapper().fromDBObject(optionalExtraInfo.getSubClass(), dbObj, getMapper().createEntityCache()));
    }

    return axisList;
}
 
开发者ID:groupon,项目名称:DotCi,代码行数:15,代码来源:AxisListConverter.java


示例8: encode

import hudson.matrix.AxisList; //导入依赖的package包/类
@Override
public Object encode(Object value, MappedField optionalExtraInfo) {
    if (value == null) return null;

    AxisList axisList = (AxisList) value;

    BasicDBList convertedList = new BasicDBList();

    for (Axis axis : axisList) {
        convertedList.add(getMapper().toDBObject(axis));
    }

    return convertedList;
}
 
开发者ID:groupon,项目名称:DotCi,代码行数:15,代码来源:AxisListConverter.java


示例9: setAxisList

import hudson.matrix.AxisList; //导入依赖的package包/类
public void setAxisList(final AxisList axisList) {
    this.axisList = axisList;
    try {
        save();
    } catch (final IOException e) {
        throw new RuntimeException(e);
    }
}
 
开发者ID:groupon,项目名称:DotCi,代码行数:9,代码来源:DynamicBuild.java


示例10: testTaskNameForMultiConfiguration

import hudson.matrix.AxisList; //导入依赖的package包/类
@Test
@Issue("JENKINS-22654")
public void testTaskNameForMultiConfiguration() throws Exception {
    MatrixProject project = jenkins.createMatrixProject("Multi");
    project.setAxes(new AxisList(new Axis("axis", "foo", "bar")));
    project.addProperty(new PipelineProperty("task", "stage", ""));

    Collection<MatrixConfiguration> configurations = project.getActiveConfigurations();

    for (MatrixConfiguration configuration : configurations) {
        Task task = Task.getPrototypeTask(configuration, true);
        assertEquals("task "  + configuration.getName(), task.getName());

    }
}
 
开发者ID:Diabol,项目名称:delivery-pipeline-plugin,代码行数:16,代码来源:TaskTest.java


示例11: testProjectPreferenceForMatrix

import hudson.matrix.AxisList; //导入依赖的package包/类
@Test
public void testProjectPreferenceForMatrix() throws Exception
{
    setScoringRule(new NodePreferenceScoringRule(4, 2));
    
    DumbSlave node1 = j.createOnlineSlave(LabelExpression.parseExpression("nodelabel"));
    DumbSlave node2 = j.createOnlineSlave(LabelExpression.parseExpression("nodelabel"));
    
    MatrixProject p = j.createMatrixProject();
    p.setAxes(new AxisList(
            new TextAxis("axis1", "value1")
    ));
    p.addProperty(new BuildPreferenceJobProperty(Arrays.asList(
            new BuildPreference("master", 1),
            new BuildPreference("nodelabel", 2),
            new BuildPreference(String.format("%s && nodelabel", node1.getNodeName()), 4)
    )));
    p.save();
    
    p.scheduleBuild2(0).get(BUILD_TIMEOUT, TimeUnit.SECONDS);
    
    assertEquals(1, testScoringRule.calledWorkChunkList.size());
    assertEquals(
            p.getItem(new Combination(new AxisList(new TextAxis("axis1",  "")), "value1")),
            testScoringRule.calledWorkChunkList.get(0).get(0)
    );
    assertEquals(1, testScoringRule.nodesScoreList.size());
    assertEquals(2, testScoringRule.nodesScoreList.get(0).getScore(j.jenkins));
    assertEquals(12, testScoringRule.nodesScoreList.get(0).getScore(node1));
    assertEquals(4, testScoringRule.nodesScoreList.get(0).getScore(node2));
}
 
开发者ID:ikedam,项目名称:scoring-load-balancer,代码行数:32,代码来源:NodePreferenceScoringRuleJenkinsTest.java


示例12: fixAxisList

import hudson.matrix.AxisList; //导入依赖的package包/类
/**
 * Inlined from {@link MatrixProject#setAxes(hudson.matrix.AxisList)} except it doesn't call save.
 *
 * @param matrixProject The project to set the Axis on.
 * @param axisList      The Axis list to set.
 */
private static void fixAxisList(MatrixProject matrixProject, AxisList axisList) {
    if (axisList == null) {
        return; //The "axes" field can never be null. So just to be extra careful.
    }
    ReflectionUtils.setFieldValue(MatrixProject.class, matrixProject, "axes", axisList);

    //noinspection unchecked
    ReflectionUtils.invokeMethod(MatrixProject.class, matrixProject, "rebuildConfigurations", ReflectionUtils.MethodParameter.get(MatrixBuild.MatrixBuildExecution.class, null));
}
 
开发者ID:JoelJ,项目名称:ez-templates,代码行数:16,代码来源:TemplateUtils.java


示例13: testAbortRunningMatrixProject

import hudson.matrix.AxisList; //导入依赖的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


示例14: AxisListConverter

import hudson.matrix.AxisList; //导入依赖的package包/类
public AxisListConverter() {
    super(AxisList.class);
}
 
开发者ID:groupon,项目名称:DotCi,代码行数:4,代码来源:AxisListConverter.java


示例15: getAxisList

import hudson.matrix.AxisList; //导入依赖的package包/类
public AxisList getAxisList() {
    return this.runSection.getAxisList();
}
 
开发者ID:groupon,项目名称:DotCi,代码行数:4,代码来源:BuildConfiguration.java


示例16: DynamicBuildLayouter

import hudson.matrix.AxisList; //导入依赖的package包/类
public DynamicBuildLayouter(AxisList axisList, DynamicBuild dynamicBuild) {
    super(axisList == null ? new AxisList() : axisList);
    this.axisList = axisList;
    this.dynamicBuild = dynamicBuild;
}
 
开发者ID:groupon,项目名称:DotCi,代码行数:6,代码来源:DynamicBuildLayouter.java


示例17: list

import hudson.matrix.AxisList; //导入依赖的package包/类
public Iterable<Combination> list() {
    return axisList == null ? new AxisList().list() : axisList.list();
}
 
开发者ID:groupon,项目名称:DotCi,代码行数:4,代码来源:DynamicBuildLayouter.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java IntPoint类代码示例发布时间:2022-05-22
下一篇:
Java ConsoleNotifier类代码示例发布时间: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