use of com.thoughtworks.go.domain.materials.mercurial.HgMaterialUpdater in project gocd by gocd.
the class HgMaterialUpdaterTest method updateTo.
private void updateTo(HgMaterial material, RevisionContext revisionContext, JobResult expectedResult) {
BuildSession buildSession = newBuildSession();
JobResult result = buildSession.build(new HgMaterialUpdater(material).updateTo(workingFolder.toString(), revisionContext));
assertThat(buildInfo(), result, is(expectedResult));
}
use of com.thoughtworks.go.domain.materials.mercurial.HgMaterialUpdater in project gocd by gocd.
the class HgMaterialUpdaterTest method updateTo.
private void updateTo(HgMaterial material, RevisionContext revisionContext, JobResult expectedResult, File workingFolder) {
BuildSession buildSession = newBuildSession();
JobResult result = buildSession.build(new HgMaterialUpdater(material).updateTo(workingFolder.toString(), revisionContext));
assertThat(buildInfo(), result, is(expectedResult));
}
use of com.thoughtworks.go.domain.materials.mercurial.HgMaterialUpdater in project gocd by gocd.
the class MaterialRevisions method updateToCommand.
public BuildCommand updateToCommand(String baseDir) {
List<BuildCommand> commands = new ArrayList<>();
for (MaterialRevision revision : revisions) {
Material material = revision.getMaterial();
if (material instanceof ScmMaterial) {
if (material instanceof GitMaterial) {
GitMaterialUpdater updater = new GitMaterialUpdater((GitMaterial) material);
commands.add(updater.updateTo(baseDir, revision.toRevisionContext()));
} else if (material instanceof HgMaterial) {
HgMaterialUpdater updater = new HgMaterialUpdater((HgMaterial) material);
commands.add(updater.updateTo(baseDir, revision.toRevisionContext()));
} else if (material instanceof SvnMaterial) {
SvnMaterialUpdater updater = new SvnMaterialUpdater((SvnMaterial) material);
commands.add(updater.updateTo(baseDir, revision.toRevisionContext()));
} else if (material instanceof PackageMaterial) {
// do nothing
} else if (material instanceof TfsMaterial) {
TfsMaterialUpdater updater = new TfsMaterialUpdater((TfsMaterial) material);
commands.add(updater.updateTo(baseDir, revision.toRevisionContext()));
} else if (material instanceof P4Material) {
P4MaterialUpdater updater = new P4MaterialUpdater((P4Material) material);
commands.add(updater.updateTo(baseDir, revision.toRevisionContext()));
} else {
commands.add(BuildCommand.fail("%s Material is not supported for new build command agent", material.getTypeForDisplay()));
}
}
}
return BuildCommand.compose(commands);
}
Aggregations