use of hudson.matrix.MatrixBuild in project blueocean-plugin by jenkinsci.
the class PipelineApiTest method matrixProjectTest.
@Test
public void matrixProjectTest() throws Exception {
MatrixProject mp = j.jenkins.createProject(MatrixProject.class, "mp1");
mp.getAxes().add(new Axis("os", "linux", "windows"));
mp.getAxes().add(new Axis("jdk", "1.7", "1.8"));
MatrixBuild matrixBuild = mp.scheduleBuild2(0).get();
j.assertBuildStatusSuccess(matrixBuild);
List<Map> pipelines = get("/search/?q=type:pipeline;excludedFromFlattening:jenkins.branch.MultiBranchProject,hudson.matrix.MatrixProject", List.class);
Assert.assertEquals(1, pipelines.size());
Map p = pipelines.get(0);
Assert.assertEquals("mp1", p.get("name"));
String href = getHrefFromLinks(p, "self");
Assert.assertEquals("/job/mp1/", href);
}
use of hudson.matrix.MatrixBuild in project hudson-2.x by hudson.
the class HudsonTestCase method assertBuildStatus.
/**
* Asserts that the outcome of the build is a specific outcome.
*/
public <R extends Run> R assertBuildStatus(Result status, R r) throws Exception {
if (status == r.getResult())
return r;
// dump the build output in failure message
String msg = "unexpected build status; build log was:\n------\n" + getLog(r) + "\n------\n";
if (r instanceof MatrixBuild) {
MatrixBuild mb = (MatrixBuild) r;
for (MatrixRun mr : mb.getRuns()) {
msg += "--- " + mr.getParent().getCombination() + " ---\n" + getLog(mr) + "\n------\n";
}
}
assertEquals(msg, status, r.getResult());
return r;
}
Aggregations