Search in sources :

Example 1 with Axis

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);
}
Also used : MatrixProject(hudson.matrix.MatrixProject) Map(java.util.Map) Axis(hudson.matrix.Axis) MatrixBuild(hudson.matrix.MatrixBuild) Test(org.junit.Test)

Example 2 with Axis

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"))));
}
Also used : AxisList(hudson.matrix.AxisList) JavadocArchiver(hudson.tasks.JavadocArchiver) Axis(hudson.matrix.Axis) Test(org.junit.Test)

Aggregations

Axis (hudson.matrix.Axis)2 Test (org.junit.Test)2 AxisList (hudson.matrix.AxisList)1 MatrixBuild (hudson.matrix.MatrixBuild)1 MatrixProject (hudson.matrix.MatrixProject)1 JavadocArchiver (hudson.tasks.JavadocArchiver)1 Map (java.util.Map)1