use of com.thoughtworks.go.config.materials.IgnoredFiles in project gocd by gocd.
the class P4MaterialConfigTest method shouldSetConfigAttributes.
@Test
public void shouldSetConfigAttributes() {
P4MaterialConfig p4MaterialConfig = new P4MaterialConfig("", "");
Map<String, String> map = new HashMap<>();
map.put(P4MaterialConfig.SERVER_AND_PORT, "serverAndPort");
map.put(P4MaterialConfig.USERNAME, "username");
map.put(P4MaterialConfig.PASSWORD, "password");
map.put(P4MaterialConfig.USE_TICKETS, "true");
map.put(P4MaterialConfig.VIEW, "some-view");
map.put(ScmMaterialConfig.FOLDER, "folder");
map.put(ScmMaterialConfig.AUTO_UPDATE, "false");
map.put(ScmMaterialConfig.FILTER, "/root,/**/*.help");
map.put(AbstractMaterialConfig.MATERIAL_NAME, "material-name");
p4MaterialConfig.setConfigAttributes(map);
assertThat(p4MaterialConfig.getServerAndPort(), is("serverAndPort"));
assertThat(p4MaterialConfig.getUserName(), is("username"));
assertThat(p4MaterialConfig.getView(), is("some-view"));
assertThat(p4MaterialConfig.getUseTickets(), is(true));
assertThat(p4MaterialConfig.getFolder(), is("folder"));
assertThat(p4MaterialConfig.getName(), is(new CaseInsensitiveString("material-name")));
assertThat(p4MaterialConfig.isAutoUpdate(), is(false));
assertThat(p4MaterialConfig.filter(), is(new Filter(new IgnoredFiles("/root"), new IgnoredFiles("/**/*.help"))));
}
use of com.thoughtworks.go.config.materials.IgnoredFiles in project gocd by gocd.
the class GitMaterialConfigTest method shouldSetConfigAttributes.
@Test
public void shouldSetConfigAttributes() {
GitMaterialConfig gitMaterialConfig = new GitMaterialConfig("");
Map<String, String> map = new HashMap<>();
map.put(GitMaterialConfig.URL, "url");
map.put(GitMaterialConfig.BRANCH, "some-branch");
map.put(GitMaterialConfig.SHALLOW_CLONE, "true");
map.put(ScmMaterialConfig.FOLDER, "folder");
map.put(ScmMaterialConfig.AUTO_UPDATE, null);
map.put(ScmMaterialConfig.FILTER, "/root,/**/*.help");
map.put(AbstractMaterialConfig.MATERIAL_NAME, "material-name");
gitMaterialConfig.setConfigAttributes(map);
assertThat(gitMaterialConfig.getUrl(), is("url"));
assertThat(gitMaterialConfig.getFolder(), is("folder"));
assertThat(gitMaterialConfig.getBranch(), is("some-branch"));
assertThat(gitMaterialConfig.getName(), is(new CaseInsensitiveString("material-name")));
assertThat(gitMaterialConfig.isAutoUpdate(), is(false));
assertThat(gitMaterialConfig.isShallowClone(), is(true));
assertThat(gitMaterialConfig.filter(), is(new Filter(new IgnoredFiles("/root"), new IgnoredFiles("/**/*.help"))));
}
use of com.thoughtworks.go.config.materials.IgnoredFiles in project gocd by gocd.
the class HgMaterialConfigTest method shouldSetConfigAttributes.
@Test
public void shouldSetConfigAttributes() {
HgMaterialConfig hgMaterialConfig = new HgMaterialConfig("", null);
Map<String, String> map = new HashMap<>();
map.put(HgMaterialConfig.URL, "url");
map.put(ScmMaterialConfig.FOLDER, "folder");
map.put(ScmMaterialConfig.AUTO_UPDATE, "0");
map.put(ScmMaterialConfig.FILTER, "/root,/**/*.help");
map.put(AbstractMaterialConfig.MATERIAL_NAME, "material-name");
hgMaterialConfig.setConfigAttributes(map);
assertThat(hgMaterialConfig.getUrl(), is("url"));
assertThat(hgMaterialConfig.getFolder(), is("folder"));
assertThat(hgMaterialConfig.getName(), is(new CaseInsensitiveString("material-name")));
assertThat(hgMaterialConfig.isAutoUpdate(), is(false));
assertThat(hgMaterialConfig.filter(), is(new Filter(new IgnoredFiles("/root"), new IgnoredFiles("/**/*.help"))));
}
use of com.thoughtworks.go.config.materials.IgnoredFiles in project gocd by gocd.
the class BuildCauseProducerServiceIntegrationTest method setup.
@Before
public void setup() throws Exception {
diskSpaceSimulator = new DiskSpaceSimulator();
new HgTestRepo("testHgRepo");
svnRepository = new SvnTestRepo("testSvnRepo");
dbHelper.onSetUp();
configHelper.onSetUp();
configHelper.usingCruiseConfigDao(goConfigDao).initializeConfigFile();
repository = new SvnCommand(null, svnRepository.projectRepositoryUrl());
goParentPipelineConfig = configHelper.addPipeline(GO_PIPELINE_UPSTREAM, STAGE_NAME, new MaterialConfigs(new GitMaterialConfig("foo-bar")), "unit");
goPipelineConfig = configHelper.addPipeline(GO_PIPELINE_NAME, STAGE_NAME, repository, "unit");
svnMaterialRevs = new MaterialRevisions();
SvnMaterial svnMaterial = SvnMaterial.createSvnMaterialWithMock(repository);
svnMaterialRevs.addRevision(svnMaterial, svnMaterial.latestModification(null, new ServerSubprocessExecutionContext(goConfigService, new SystemEnvironment())));
final MaterialRevisions materialRevisions = new MaterialRevisions();
SvnMaterial anotherSvnMaterial = SvnMaterial.createSvnMaterialWithMock(repository);
materialRevisions.addRevision(anotherSvnMaterial, anotherSvnMaterial.latestModification(null, subprocessExecutionContext));
transactionTemplate.execute(new TransactionCallbackWithoutResult() {
@Override
protected void doInTransactionWithoutResult(TransactionStatus status) {
materialRepository.save(svnMaterialRevs);
}
});
BuildCause buildCause = BuildCause.createWithModifications(svnMaterialRevs, "");
mingleConfig = configHelper.addPipeline(MINGLE_PIPELINE_NAME, STAGE_NAME, repository, new Filter(new IgnoredFiles("**/*.doc")), "unit", "functional");
latestPipeline = PipelineMother.schedule(this.mingleConfig, buildCause);
latestPipeline = pipelineDao.saveWithStages(latestPipeline);
dbHelper.passStage(latestPipeline.getStages().first());
pipelineScheduleQueue.clear();
}
use of com.thoughtworks.go.config.materials.IgnoredFiles in project gocd by gocd.
the class BuildCauseProducerServiceIntegrationHgTest method setup.
@Before
public void setup() throws Exception {
dbHelper.onSetUp();
configHelper.onSetUp();
configHelper.usingCruiseConfigDao(goConfigDao).initializeConfigFile();
hgTestRepo = new HgTestRepo("hgTestRepo1");
hgMaterial = MaterialsMother.hgMaterial(hgTestRepo.projectRepositoryUrl());
hgMaterial.setFilter(new Filter(new IgnoredFiles("helper/**/*.*")));
workingFolder = TestFileUtil.createTempFolder("workingFolder");
outputStreamConsumer = inMemoryConsumer();
mingleConfig = configHelper.addPipeline("cruise", STAGE_NAME, this.hgMaterial.config(), "unit", "functional");
}
Aggregations