@Test public void api() throws Exception { MatrixProject project = j.createMatrixProject(); project.setAxes(new AxisList(new Axis("FOO", "abc", "def"), new Axis("BAR", "uvw", "xyz"))); XmlPage xml = j.createWebClient().goToXml(project.getUrl() + "api/xml"); assertEquals(4, xml.getByXPath("//matrixProject/activeConfiguration").size()); }
@Issue("JENKINS-27162") @Test public void completedLogging() throws Exception { MatrixProject project = j.createMatrixProject(); project.setAxes(new AxisList(new Axis("axis", "a", "b"))); ((DefaultMatrixExecutionStrategyImpl) project.getExecutionStrategy()) .setTouchStoneCombinationFilter("axis == 'a'"); MatrixBuild build = project.scheduleBuild2(0).get(); j.assertLogContains("test0 » a completed with result SUCCESS", build); j.assertLogContains("test0 » b completed with result SUCCESS", build); }
@Override protected MatrixProject createMatrixProject() throws IOException { MatrixProject p = super.createMatrixProject(); // set up 2x2 matrix AxisList axes = new AxisList(); axes.add(new Axis("db", "mysql", "oracle")); axes.add(new Axis("direction", "north", "south")); p.setAxes(axes); return p; }
/** Test that project level permissions apply to child configurations as well. */ @Issue("JENKINS-9293") @Test public void configurationACL() throws Exception { j.jenkins.setAuthorizationStrategy(new ProjectMatrixAuthorizationStrategy()); MatrixProject mp = j.createMatrixProject(); mp.setAxes(new AxisList(new Axis("foo", "a", "b"))); MatrixConfiguration mc = mp.getItem("foo=a"); assertNotNull(mc); SecurityContextHolder.clearContext(); assertFalse(mc.getACL().hasPermission(Item.READ)); mp.addProperty( new AuthorizationMatrixProperty( Collections.singletonMap(Item.READ, Collections.singleton("anonymous")))); // Project-level permission should apply to single configuration too: assertTrue(mc.getACL().hasPermission(Item.READ)); }