本文整理汇总了Java中hudson.matrix.MatrixProject.addProperty方法的典型用法代码示例。如果您正苦于以下问题:Java MatrixProject.addProperty方法的具体用法?Java MatrixProject.addProperty怎么用?Java MatrixProject.addProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类hudson.matrix.MatrixProject
的用法示例。
在下文中一共展示了MatrixProject.addProperty方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testStageNameForMultiConfiguration
import hudson.matrix.MatrixProject; //导入方法依赖的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());
}
}
示例2: testChildStatuses
import hudson.matrix.MatrixProject; //导入方法依赖的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);
}
}
}
示例3: testTaskNameForMultiConfiguration
import hudson.matrix.MatrixProject; //导入方法依赖的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());
}
}
示例4: testProjectPreferenceForMatrix
import hudson.matrix.MatrixProject; //导入方法依赖的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));
}
示例5: givenThatGhprcHasBeenTriggeredForAMatrixProject
import hudson.matrix.MatrixProject; //导入方法依赖的package包/类
private MatrixProject givenThatGhprcHasBeenTriggeredForAMatrixProject() throws Exception {
MatrixProject project = jenkinsRule.createMatrixProject("MTXPRJ");
GhprcTrigger trigger = GhprcTestUtil.getTrigger(null);
given(commitPointer.getSha()).willReturn("sha");
Map<String, Object> config = new HashMap<String, Object>(1);
config.put("publishedURL", "defaultPublishedURL");
GhprcTestUtil.setupGhprcTriggerDescriptor(config);
project.addProperty(new GithubProjectProperty("https://github.com/user/dropwizard"));
given(ghPullRequest.getNumber()).willReturn(1);
// Creating spy on ghprc, configuring repo
Ghprc ghprc = spyCreatingGhprc(trigger, project);
doReturn(ghprcGitHub).when(ghprc).getGitHub();
setRepositoryHelper(ghprc);
given(ghRepository.getPullRequest(1)).willReturn(ghPullRequest);
// Configuring and adding Ghprc trigger
project.addTrigger(trigger);
// Configuring Git SCM
project.setScm(GhprcTestUtil.provideGitSCM());
trigger.start(project, true);
setTriggerHelper(trigger, ghprc);
GhprcTestUtil.triggerRunAndWait(10, trigger, project);
return project;
}
开发者ID:bratchenko,项目名称:jenkins-github-pull-request-comments,代码行数:41,代码来源:GhprcDefaultBuildManagerTest.java