use of com.thoughtworks.go.config.materials.mercurial.HgMaterial in project gocd by gocd.
the class HgMultipleMaterialsTest method shouldCloneMaterialToItsDestFolder.
@Test
public void shouldCloneMaterialToItsDestFolder() throws Exception {
HgMaterial material1 = repo.createMaterial("dest1");
MaterialRevision materialRevision = new MaterialRevision(material1, material1.latestModification(pipelineDir, new TestSubprocessExecutionContext()));
materialRevision.updateTo(pipelineDir, ProcessOutputStreamConsumer.inMemoryConsumer(), new TestSubprocessExecutionContext());
assertThat(new File(pipelineDir, "dest1").exists(), is(true));
assertThat(new File(pipelineDir, "dest1/.hg").exists(), is(true));
}
use of com.thoughtworks.go.config.materials.mercurial.HgMaterial in project gocd by gocd.
the class HgTestRepo method createMaterial.
public HgMaterial createMaterial(String dest) {
HgMaterial material = material();
material.setFolder(dest);
return material;
}
use of com.thoughtworks.go.config.materials.mercurial.HgMaterial in project gocd by gocd.
the class HgTestRepo method updateTo.
public HgMaterial updateTo(File baseDir) {
HgMaterial material = material();
Revision tip = latestRevision(material, baseDir, new TestSubprocessExecutionContext());
material.updateTo(ProcessOutputStreamConsumer.inMemoryConsumer(), baseDir, new RevisionContext(tip), new TestSubprocessExecutionContext());
return material;
}
use of com.thoughtworks.go.config.materials.mercurial.HgMaterial in project gocd by gocd.
the class MaterialInstanceTest method shouldGenerateUniqueFingerprintOnCreation.
@Test
public void shouldGenerateUniqueFingerprintOnCreation() throws Exception {
MaterialInstance one = new HgMaterial("url", null).createMaterialInstance();
MaterialInstance two = new HgMaterial("otherurl", null).createMaterialInstance();
assertThat(one.getFingerprint(), not(nullValue()));
assertThat(one.getFingerprint(), not(is(two.getFingerprint())));
}
use of com.thoughtworks.go.config.materials.mercurial.HgMaterial in project gocd by gocd.
the class MaterialUpdateStatusNotifierTest method shouldNotNotifyListenerWhenUnknownMaterialIsUpdated.
@Test
public void shouldNotNotifyListenerWhenUnknownMaterialIsUpdated() throws Exception {
PipelineConfig pipelineConfig = new PipelineConfig(new CaseInsensitiveString("config"), new MaterialConfigs());
MaterialUpdateStatusListener mockStatusListener = Mockito.mock(MaterialUpdateStatusListener.class);
materialUpdateStatusNotifier.registerListenerFor(pipelineConfig, mockStatusListener);
HgMaterial material = new HgMaterial("url", null);
materialUpdateStatusNotifier.onMessage(new MaterialUpdateSuccessfulMessage(material, 1234));
Mockito.verify(mockStatusListener, Mockito.never()).onMaterialUpdate(new MaterialUpdateSuccessfulMessage(material, 1234));
}
Aggregations