/** Test artifact copy between matrix jobs, for artifact from matching axis */ 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( new CopyArtifact( other.getName() + "/FOO=$FOO", new StatusBuildSelector(true), "", "", false, false)); assertBuildStatusSuccess(other.scheduleBuild2(0, new UserCause()).get()); MatrixBuild b = p.scheduleBuild2(0, new UserCause()).get(); 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); }
@Override public AbstractBuild<?, ?> resolveChild(Child child) { MatrixBuild b = (MatrixBuild) owner; return b.getRun(Combination.fromString(child.name)); }