本文整理汇总了Java中hudson.matrix.MatrixBuild类的典型用法代码示例。如果您正苦于以下问题:Java MatrixBuild类的具体用法?Java MatrixBuild怎么用?Java MatrixBuild使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MatrixBuild类属于hudson.matrix包,在下文中一共展示了MatrixBuild类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: testMatrixToMatrix
import hudson.matrix.MatrixBuild; //导入依赖的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.MatrixBuild; //导入依赖的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.MatrixBuild; //导入依赖的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: initPython
import hudson.matrix.MatrixBuild; //导入依赖的package包/类
private void initPython() {
if (pexec == null) {
pexec = new PythonExecutor(this);
String[] jMethods = new String[1];
jMethods[0] = "doBuildConfiguration";
String[] pFuncs = new String[1];
pFuncs[0] = "do_build_configuration";
Class[][] argTypes = new Class[1][];
argTypes[0] = new Class[2];
argTypes[0][0] = MatrixBuild.class;
argTypes[0][1] = MatrixConfiguration.class;
pexec.checkAbstrMethods(jMethods, pFuncs, argTypes);
String[] functions = new String[0];
int[] argsCount = new int[0];
pexec.registerFunctions(functions, argsCount);
}
}
开发者ID:conyx,项目名称:jenkins.py,代码行数:18,代码来源:MatrixBuildListenerPW.java
示例5: ghCauseFromRun
import hudson.matrix.MatrixBuild; //导入依赖的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
示例6: testChildStatuses
import hudson.matrix.MatrixBuild; //导入依赖的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: shouldReturnDefaultManager
import hudson.matrix.MatrixBuild; //导入依赖的package包/类
@Test
public void shouldReturnDefaultManager() throws Exception {
// GIVEN
MatrixProject project = jenkinsRule.createMatrixProject("PRJ");
GhprcBuildManager buildManager = GhprcBuildManagerFactoryUtil.getBuildManager(new MatrixBuild(project));
// THEN
assertThat(buildManager).isInstanceOf(GhprcDefaultBuildManager.class);
}
开发者ID:bratchenko,项目名称:jenkins-github-pull-request-comments,代码行数:11,代码来源:GhprcBuildManagerFactoryUtilTest.java
示例8: createAggregator
import hudson.matrix.MatrixBuild; //导入依赖的package包/类
@Override
public MatrixAggregator createAggregator(final MatrixBuild matrixBuild, Launcher launcher, final BuildListener buildListener) {
return new MatrixAggregator(matrixBuild, launcher, buildListener) {
@Override
public boolean endBuild() throws InterruptedException, IOException {
return !executeOn.matrix() || _perform(matrixBuild, launcher, buildListener);
}
};
}
开发者ID:jenkinsci,项目名称:chef-identity-plugin,代码行数:10,代码来源:ChefIdentityCleanup.java
示例9: createAggregator
import hudson.matrix.MatrixBuild; //导入依赖的package包/类
public MatrixAggregator createAggregator(MatrixBuild build, Launcher launcher, BuildListener listener) {
return new MatrixAggregator(build, launcher, listener) {
@Override
public boolean endBuild() throws InterruptedException, IOException {
perform(build, launcher, listener);
return super.endBuild();
}
};
}
开发者ID:jenkinsci,项目名称:gitlab-plugin,代码行数:10,代码来源:GitLabCommitStatusPublisher.java
示例10: buildEnvironmentFor
import hudson.matrix.MatrixBuild; //导入依赖的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
示例11: verifyMatrixAggregatable
import hudson.matrix.MatrixBuild; //导入依赖的package包/类
static <T extends Notifier & MatrixAggregatable> void verifyMatrixAggregatable(Class<T> publisherClass, BuildListener listener) throws InterruptedException, IOException {
AbstractBuild build = mock(AbstractBuild.class);
AbstractProject project = mock(MatrixConfiguration.class);
Notifier publisher = mock(publisherClass);
MatrixBuild parentBuild = mock(MatrixBuild.class);
when(build.getParent()).thenReturn(project);
when(((MatrixAggregatable) publisher).createAggregator(any(MatrixBuild.class), any(Launcher.class), any(BuildListener.class))).thenCallRealMethod();
when(publisher.perform(any(AbstractBuild.class), any(Launcher.class), any(BuildListener.class))).thenReturn(true);
MatrixAggregator aggregator = ((MatrixAggregatable) publisher).createAggregator(parentBuild, null, listener);
aggregator.startBuild();
aggregator.endBuild();
verify(publisher).perform(parentBuild, null, listener);
}
开发者ID:jenkinsci,项目名称:gitlab-plugin,代码行数:16,代码来源:TestUtility.java
示例12: createAggregator
import hudson.matrix.MatrixBuild; //导入依赖的package包/类
public MatrixAggregator createAggregator(MatrixBuild build, Launcher launcher, BuildListener listener) {
return new MatrixAggregator(build, launcher, listener) {
@Override
public boolean endBuild() throws InterruptedException, IOException {
return notifyReviewboard(listener, this.build);
}
};
}
开发者ID:vmware,项目名称:jenkins-reviewbot,代码行数:9,代码来源:ReviewboardNotifier.java
示例13: fixAxisList
import hudson.matrix.MatrixBuild; //导入依赖的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
示例14: testAbortRunningMatrixProject
import hudson.matrix.MatrixBuild; //导入依赖的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
示例15: shouldCalculateUrlFromDefault
import hudson.matrix.MatrixBuild; //导入依赖的package包/类
@Test
public void shouldCalculateUrlFromDefault() throws Exception {
// GIVEN
MatrixProject project = givenThatGhprcHasBeenTriggeredForAMatrixProject();
// THEN
assertThat(project.getBuilds().toArray().length).isEqualTo(1);
MatrixBuild matrixBuild = project.getBuilds().getFirstBuild();
GhprcBuildManager buildManager = GhprcBuildManagerFactoryUtil.getBuildManager(matrixBuild);
assertThat(buildManager).isInstanceOf(GhprcDefaultBuildManager.class);
assertThat(buildManager.calculateBuildUrl("defaultPublishedURL")).isEqualTo("defaultPublishedURL/" + matrixBuild.getUrl());
}
开发者ID:bratchenko,项目名称:jenkins-github-pull-request-comments,代码行数:17,代码来源:GhprcDefaultBuildManagerTest.java
示例16: newProjectFactory
import hudson.matrix.MatrixBuild; //导入依赖的package包/类
@Nonnull
@Override
protected BranchProjectFactory<MatrixProject, MatrixBuild> newProjectFactory() {
return new MatrixBranchProjectFactory();
}
开发者ID:jenkinsci,项目名称:multi-branch-project-plugin,代码行数:6,代码来源:MatrixMultiBranchProject.java
示例17: doBuildConfiguration
import hudson.matrix.MatrixBuild; //导入依赖的package包/类
@Override
public boolean doBuildConfiguration(MatrixBuild b, MatrixConfiguration c) {
initPython();
return pexec.execPythonBool("do_build_configuration", b, c);
}
开发者ID:conyx,项目名称:jenkins.py,代码行数:6,代码来源:MatrixBuildListenerPW.java
示例18: createAggregator
import hudson.matrix.MatrixBuild; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
public MatrixAggregator createAggregator(final MatrixBuild build, final Launcher launcher,
final BuildListener listener) {
return new DependencyCheckAnnotationsAggregator(build, launcher, listener, this, getDefaultEncoding(), usePreviousBuildAsReference(), useOnlyStableBuildsAsReference());
}
开发者ID:jenkinsci,项目名称:dependency-check-plugin,代码行数:8,代码来源:DependencyCheckPublisher.java
示例19: createAggregator
import hudson.matrix.MatrixBuild; //导入依赖的package包/类
/** {@inheritDoc} */
public MatrixAggregator createAggregator(final MatrixBuild build, final Launcher launcher,
final BuildListener listener) {
return new CheckStyleAnnotationsAggregator(build, launcher, listener, this, getDefaultEncoding(), useOnlyStableBuildsAsReference());
}
开发者ID:davidparsson,项目名称:jslint-checkstyle-plugin,代码行数:6,代码来源:CheckStylePublisher.java
示例20: DependencyCheckAnnotationsAggregator
import hudson.matrix.MatrixBuild; //导入依赖的package包/类
/**
* Creates a new instance of {@link DependencyCheckAnnotationsAggregator}.
*
* @param build
* the matrix build
* @param launcher
* the launcher
* @param listener
* the build listener
* @param healthDescriptor
* health descriptor
* @param defaultEncoding
* the default encoding to be used when reading and parsing files
* @param usePreviousBuildAsReference
* determines whether the previous build should be used as the
* reference build
* @param useStableBuildAsReference
* determines whether only stable builds should be used as
* reference builds or not
*/
public DependencyCheckAnnotationsAggregator(final MatrixBuild build, final Launcher launcher,
final BuildListener listener, final HealthDescriptor healthDescriptor, final String defaultEncoding,
final boolean usePreviousBuildAsReference, final boolean useStableBuildAsReference) {
super(build, launcher, listener, healthDescriptor, defaultEncoding, usePreviousBuildAsReference, useStableBuildAsReference);
}
开发者ID:jenkinsci,项目名称:dependency-check-plugin,代码行数:26,代码来源:DependencyCheckAnnotationsAggregator.java
注:本文中的hudson.matrix.MatrixBuild类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论