use of com.thoughtworks.go.config.CaseInsensitiveString in project gocd by gocd.
the class PipelineInstanceModelTest method shouldGetCurrentRevisionForMaterialName.
@Test
public void shouldGetCurrentRevisionForMaterialName() {
HgMaterial material = MaterialsMother.hgMaterial();
material.setName(new CaseInsensitiveString("foo"));
assertThat(setUpModificationFor(material).getCurrentRevision(CaseInsensitiveString.str(material.getName())).getRevision(), is("a087402bd2a7828a130c1bdf43f2d9ef8f48fd46"));
}
use of com.thoughtworks.go.config.CaseInsensitiveString in project gocd by gocd.
the class PipelineInstanceModelTest method shouldGetCurrentRevisionForMaterialByName.
@Test
public void shouldGetCurrentRevisionForMaterialByName() {
MaterialRevisions revisions = new MaterialRevisions();
HgMaterial material = MaterialsMother.hgMaterial();
SvnMaterial svnMaterial = MaterialsMother.svnMaterial();
material.setName(new CaseInsensitiveString("hg_material"));
revisions.addRevision(svnMaterial, new Modification(new Date(), "1024", "MOCK_LABEL-12", null));
revisions.addRevision(material, HG_MATERIAL_MODIFICATION);
BuildCause buildCause = BuildCause.createWithModifications(revisions, "");
PipelineInstanceModel model = PipelineInstanceModel.createPipeline("pipeline", -1, "label", buildCause, new StageInstanceModels());
assertThat(model.getCurrentRevision("hg_material").getRevision(), is("a087402bd2a7828a130c1bdf43f2d9ef8f48fd46"));
}
use of com.thoughtworks.go.config.CaseInsensitiveString in project gocd by gocd.
the class BuildAssignmentTest method setUp.
@Before
public void setUp() throws IOException {
initMocks(this);
dir = temporaryFolder.newFolder("someFolder");
svnRepoFixture = new SvnRepoFixture("../common/src/test/resources/data/svnrepo", temporaryFolder);
svnRepoFixture.createRepository();
command = new SvnCommand(null, svnRepoFixture.getEnd2EndRepoUrl());
svnMaterial = createSvnMaterialWithMock(command);
dependencyMaterial = new DependencyMaterial(new CaseInsensitiveString("upstream1"), new CaseInsensitiveString(STAGE_NAME));
dependencyMaterialWithName = new DependencyMaterial(new CaseInsensitiveString("upstream2"), new CaseInsensitiveString(STAGE_NAME));
dependencyMaterialWithName.setName(new CaseInsensitiveString("dependency_material_name"));
setupHgRepo();
}
use of com.thoughtworks.go.config.CaseInsensitiveString in project gocd by gocd.
the class BuildWorkEnvironmentVariablesTest method setUp.
@Before
public void setUp() throws Exception {
initMocks(this);
dir = temporaryFolder.newFolder("someFolder");
environmentVariableContext = new EnvironmentVariableContext();
svnRepoFixture = new SvnRepoFixture("../common/src/test/resources/data/svnrepo", temporaryFolder);
svnRepoFixture.createRepository();
command = new SvnCommand(null, svnRepoFixture.getEnd2EndRepoUrl());
pipelineConfig = PipelineConfigMother.createPipelineConfig(PIPELINE_NAME, STAGE_NAME, JOB_NAME);
svnMaterial = SvnMaterial.createSvnMaterialWithMock(command);
dependencyMaterial = new DependencyMaterial(new CaseInsensitiveString("upstream1"), new CaseInsensitiveString(STAGE_NAME));
dependencyMaterialWithName = new DependencyMaterial(new CaseInsensitiveString("upstream2"), new CaseInsensitiveString(STAGE_NAME));
dependencyMaterialWithName.setName(new CaseInsensitiveString("dependency_material_name"));
setupHgRepo();
p4Fixture = new P4Fixture();
p4Material = getP4Material();
}
use of com.thoughtworks.go.config.CaseInsensitiveString in project gocd by gocd.
the class DFSCycleDetectorTest method shouldNotThrowExceptionWhenCycleDependencyNotFound.
@Test
public void shouldNotThrowExceptionWhenCycleDependencyNotFound() throws Exception {
when(state.getDependencyMaterials(new CaseInsensitiveString("a"))).thenReturn(new Node(new Node.DependencyNode(new CaseInsensitiveString("b"), new CaseInsensitiveString("stage"))));
when(state.getDependencyMaterials(new CaseInsensitiveString("b"))).thenReturn(new Node(new Node.DependencyNode(new CaseInsensitiveString("c"), new CaseInsensitiveString("stage"))));
when(state.getDependencyMaterials(new CaseInsensitiveString("c"))).thenReturn(new Node(new ArrayList<>()));
when(state.hasPipeline(new CaseInsensitiveString("a"))).thenReturn(true);
when(state.hasPipeline(new CaseInsensitiveString("b"))).thenReturn(true);
when(state.hasPipeline(new CaseInsensitiveString("c"))).thenReturn(true);
project.topoSort(new CaseInsensitiveString("a"), state);
}
Aggregations