use of hudson.matrix.Axis 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.Axis in project hudson-2.x by hudson.
the class BaseProjectPropertyTest method testAllowOverrideValue.
/**
* Verify {@link BaseProjectProperty#allowOverrideValue(Object, Object)} method.
*/
@Test
public void testAllowOverrideValue() {
assertFalse(property.allowOverrideValue(null, null));
assertTrue(property.allowOverrideValue(new Object(), null));
assertTrue(property.allowOverrideValue(null, new Object()));
//Test properties that don't have correct equals methods
assertFalse(property.allowOverrideValue(new JavadocArchiver("", false), new JavadocArchiver("", false)));
assertTrue(property.allowOverrideValue(new JavadocArchiver("", true), new JavadocArchiver("", false)));
//Object with transient filds should be taken into account
assertTrue(property.allowOverrideValue(new AxisList(new Axis("DB", "mysql")), new AxisList()));
assertTrue(property.allowOverrideValue(new AxisList(new Axis("DB", "mysql")), new AxisList(new Axis("DB", "mysql", "mssql"))));
assertTrue(property.allowOverrideValue(new AxisList(new Axis("DB", "mysql")), new AxisList(new Axis("DB", "mssql"))));
}
Aggregations