Search in sources :

Example 36 with PipelineInstanceModel

use of com.thoughtworks.go.presentation.pipelinehistory.PipelineInstanceModel in project gocd by gocd.

the class PipelineHistoryGroupTest method shouldMatchSpecifiedItem.

@Test
public void shouldMatchSpecifiedItem() throws Exception {
    PipelineInstanceGroupModel group = new PipelineInstanceGroupModel();
    group.getStages().addAll(asList(new SimpleInfo("stage1", true), new SimpleInfo("stage2", false)));
    PipelineInstanceModel pipelineInstanceModel = PipelineHistoryItemMother.custom(StageHistoryItemMother.custom("stage1", true), StageHistoryItemMother.custom("stage2", false));
    assertThat(group.hasSameStagesAs(pipelineInstanceModel), is(true));
}
Also used : PipelineInstanceModel(com.thoughtworks.go.presentation.pipelinehistory.PipelineInstanceModel) Test(org.junit.Test)

Example 37 with PipelineInstanceModel

use of com.thoughtworks.go.presentation.pipelinehistory.PipelineInstanceModel in project gocd by gocd.

the class PipelineHistoryGroupTest method shouldNotMatchSpecifiedItemIfApprovalTypeNotMatched.

@Test
public void shouldNotMatchSpecifiedItemIfApprovalTypeNotMatched() throws Exception {
    PipelineInstanceGroupModel group = new PipelineInstanceGroupModel();
    group.getStages().addAll(asList(new SimpleInfo("stage1", true), new SimpleInfo("stage2", false)));
    PipelineInstanceModel pipelineInstanceModel = PipelineHistoryItemMother.custom(StageHistoryItemMother.custom("stage1", true), StageHistoryItemMother.custom("stage2", true));
    assertThat(group.hasSameStagesAs(pipelineInstanceModel), is(false));
}
Also used : PipelineInstanceModel(com.thoughtworks.go.presentation.pipelinehistory.PipelineInstanceModel) Test(org.junit.Test)

Example 38 with PipelineInstanceModel

use of com.thoughtworks.go.presentation.pipelinehistory.PipelineInstanceModel in project gocd by gocd.

the class PipelineHistoryGroupTest method shouldNotMatchSpecifiedItemIfSizeNotMatched.

@Test
public void shouldNotMatchSpecifiedItemIfSizeNotMatched() throws Exception {
    PipelineInstanceGroupModel group = new PipelineInstanceGroupModel();
    group.getStages().addAll(asList(new SimpleInfo("stage1", true), new SimpleInfo("stage2", false)));
    PipelineInstanceModel pipelineInstanceModel = PipelineHistoryItemMother.custom(StageHistoryItemMother.custom("stage1", true), StageHistoryItemMother.custom("stage2", false), StageHistoryItemMother.custom("stage3", false));
    assertThat(group.hasSameStagesAs(pipelineInstanceModel), is(false));
}
Also used : PipelineInstanceModel(com.thoughtworks.go.presentation.pipelinehistory.PipelineInstanceModel) Test(org.junit.Test)

Example 39 with PipelineInstanceModel

use of com.thoughtworks.go.presentation.pipelinehistory.PipelineInstanceModel in project gocd by gocd.

the class PipelineHistoryGroupTest method emptyGroupShouldNotMatchAnyItem.

@Test
public void emptyGroupShouldNotMatchAnyItem() throws Exception {
    PipelineInstanceGroupModel group = new PipelineInstanceGroupModel();
    PipelineInstanceModel pipelineInstanceModel = PipelineHistoryItemMother.custom(StageHistoryItemMother.custom("stage1", true), StageHistoryItemMother.custom("stage2", false));
    assertThat(group.hasSameStagesAs(pipelineInstanceModel), is(false));
}
Also used : PipelineInstanceModel(com.thoughtworks.go.presentation.pipelinehistory.PipelineInstanceModel) Test(org.junit.Test)

Example 40 with PipelineInstanceModel

use of com.thoughtworks.go.presentation.pipelinehistory.PipelineInstanceModel in project gocd by gocd.

the class PipelineSqlMapDaoTest method pimFor.

private PipelineInstanceModel pimFor(String p1, int counter) {
    PipelineInstanceModel model = new PipelineInstanceModel(p1, counter, String.valueOf(counter), BuildCause.createManualForced(), new StageInstanceModels());
    model.setId(new Random().nextLong());
    return model;
}
Also used : Random(java.util.Random) PipelineInstanceModel(com.thoughtworks.go.presentation.pipelinehistory.PipelineInstanceModel) StageInstanceModels(com.thoughtworks.go.presentation.pipelinehistory.StageInstanceModels)

Aggregations

PipelineInstanceModel (com.thoughtworks.go.presentation.pipelinehistory.PipelineInstanceModel)60 Test (org.junit.Test)31 StageInstanceModels (com.thoughtworks.go.presentation.pipelinehistory.StageInstanceModels)15 PipelineInstanceModels (com.thoughtworks.go.presentation.pipelinehistory.PipelineInstanceModels)12 CaseInsensitiveString (com.thoughtworks.go.config.CaseInsensitiveString)11 PipelineModel (com.thoughtworks.go.presentation.pipelinehistory.PipelineModel)9 StageInstanceModel (com.thoughtworks.go.presentation.pipelinehistory.StageInstanceModel)7 NullStageHistoryItem (com.thoughtworks.go.presentation.pipelinehistory.NullStageHistoryItem)6 MaterialConfigs (com.thoughtworks.go.config.materials.MaterialConfigs)5 MaterialRevisions (com.thoughtworks.go.domain.MaterialRevisions)5 MaterialRevision (com.thoughtworks.go.domain.MaterialRevision)4 PipelineDependencyGraphOld (com.thoughtworks.go.domain.PipelineDependencyGraphOld)4 Modification (com.thoughtworks.go.domain.materials.Modification)4 PipelineHistoryGroups (com.thoughtworks.go.server.presentation.models.PipelineHistoryGroups)4 Matchers.anyString (org.mockito.Matchers.anyString)4 StageIdentifier (com.thoughtworks.go.domain.StageIdentifier)3 EmptyPipelineInstanceModel (com.thoughtworks.go.presentation.pipelinehistory.EmptyPipelineInstanceModel)3 TimeProvider (com.thoughtworks.go.util.TimeProvider)3 MingleConfig (com.thoughtworks.go.config.MingleConfig)2 TrackingTool (com.thoughtworks.go.config.TrackingTool)2