Search in sources :

Example 1 with MaterialRepository

use of com.thoughtworks.go.server.persistence.MaterialRepository in project gocd by gocd.

the class ConfigMaterialUpdaterTest method SetUp.

@Before
public void SetUp() {
    repoConfigDataSource = mock(GoRepoConfigDataSource.class);
    materialChecker = mock(MaterialChecker.class);
    materialRepository = mock(MaterialRepository.class);
    configCompleted = mock(ConfigMaterialUpdateCompletedTopic.class);
    topic = mock(MaterialUpdateCompletedTopic.class);
    materialService = mock(MaterialService.class);
    material = new SvnMaterial("url", "tom", "pass", false);
    when(materialRepository.folderFor(material)).thenReturn(folder);
    poller = mock(MaterialPoller.class);
    when(materialService.getPollerImplementation(any(Material.class))).thenReturn(poller);
    Modification svnModification = new Modification("user", "commend", "em@il", new Date(), "1");
    mods = revisions(material, svnModification);
    when(materialRepository.findLatestModification(material)).thenReturn(mods);
    configUpdater = new ConfigMaterialUpdater(repoConfigDataSource, materialRepository, materialChecker, configCompleted, topic, materialService, new TestSubprocessExecutionContext());
}
Also used : Modification(com.thoughtworks.go.domain.materials.Modification) SvnMaterial(com.thoughtworks.go.config.materials.svn.SvnMaterial) Material(com.thoughtworks.go.domain.materials.Material) SvnMaterial(com.thoughtworks.go.config.materials.svn.SvnMaterial) Date(java.util.Date) GoRepoConfigDataSource(com.thoughtworks.go.config.GoRepoConfigDataSource) MaterialService(com.thoughtworks.go.server.service.MaterialService) MaterialPoller(com.thoughtworks.go.server.service.materials.MaterialPoller) TestSubprocessExecutionContext(com.thoughtworks.go.domain.materials.TestSubprocessExecutionContext) MaterialRepository(com.thoughtworks.go.server.persistence.MaterialRepository) Before(org.junit.Before)

Example 2 with MaterialRepository

use of com.thoughtworks.go.server.persistence.MaterialRepository in project gocd by gocd.

the class PipelineServiceTriangleDependencyTest method setUp.

@Before
public void setUp() throws Exception {
    pipelineTimeline = mock(PipelineTimeline.class);
    pipelineDao = mock(PipelineSqlMapDao.class);
    materialRepository = mock(MaterialRepository.class);
    TestTransactionSynchronizationManager mockTransactionSynchronizationManager = new TestTransactionSynchronizationManager();
    TransactionTemplate mockTransactionTemplate = new TestTransactionTemplate(mockTransactionSynchronizationManager);
    service = new PipelineService(pipelineDao, mock(StageService.class), mock(PipelineLockService.class), pipelineTimeline, materialRepository, mockTransactionTemplate, systemEnvironment, null, materialConfigConverter);
    first = oneModifiedFile("1");
    third = oneModifiedFile("3");
    second = oneModifiedFile("2");
    first.setId(1);
    third.setId(3);
    second.setId(2);
    notifier.disableUpdates();
}
Also used : PipelineSqlMapDao(com.thoughtworks.go.server.dao.PipelineSqlMapDao) TestTransactionTemplate(com.thoughtworks.go.server.transaction.TestTransactionTemplate) TransactionTemplate(com.thoughtworks.go.server.transaction.TransactionTemplate) TestTransactionTemplate(com.thoughtworks.go.server.transaction.TestTransactionTemplate) TestTransactionSynchronizationManager(com.thoughtworks.go.server.transaction.TestTransactionSynchronizationManager) PipelineTimeline(com.thoughtworks.go.server.domain.PipelineTimeline) MaterialRepository(com.thoughtworks.go.server.persistence.MaterialRepository) Before(org.junit.Before)

Example 3 with MaterialRepository

use of com.thoughtworks.go.server.persistence.MaterialRepository in project gocd by gocd.

the class MaterialCheckerTest method setUp.

@Before
public void setUp() throws Exception {
    materialRepository = Mockito.mock(MaterialRepository.class);
    tempFiles = new TempFiles();
    mockMaterial = Mockito.mock(ScmMaterial.class);
    materialChecker = new MaterialChecker(materialRepository);
    workingFolder = tempFiles.createUniqueFolder("materialChecker");
}
Also used : ScmMaterial(com.thoughtworks.go.config.materials.ScmMaterial) MaterialRepository(com.thoughtworks.go.server.persistence.MaterialRepository) TempFiles(com.thoughtworks.go.util.TempFiles) Before(org.junit.Before)

Example 4 with MaterialRepository

use of com.thoughtworks.go.server.persistence.MaterialRepository in project gocd by gocd.

the class PipelineServiceTest method setUp.

@Before
public void setUp() throws Exception {
    pipelineTimeline = mock(PipelineTimeline.class);
    pipelineDao = mock(PipelineSqlMapDao.class);
    materialRepository = mock(MaterialRepository.class);
    TestTransactionSynchronizationManager mockTransactionSynchronizationManager = new TestTransactionSynchronizationManager();
    TransactionTemplate mockTransactionTemplate = new TestTransactionTemplate(mockTransactionSynchronizationManager);
    service = new PipelineService(pipelineDao, mock(StageService.class), mock(PipelineLockService.class), pipelineTimeline, materialRepository, mockTransactionTemplate, systemEnvironment, null, materialConfigConverter);
    first = oneModifiedFile("1");
    third = oneModifiedFile("3");
    second = oneModifiedFile("2");
    first.setId(1);
    third.setId(3);
    second.setId(2);
}
Also used : PipelineSqlMapDao(com.thoughtworks.go.server.dao.PipelineSqlMapDao) TestTransactionTemplate(com.thoughtworks.go.server.transaction.TestTransactionTemplate) TestTransactionTemplate(com.thoughtworks.go.server.transaction.TestTransactionTemplate) TransactionTemplate(com.thoughtworks.go.server.transaction.TransactionTemplate) TestTransactionSynchronizationManager(com.thoughtworks.go.server.transaction.TestTransactionSynchronizationManager) PipelineTimeline(com.thoughtworks.go.server.domain.PipelineTimeline) MaterialRepository(com.thoughtworks.go.server.persistence.MaterialRepository) Before(org.junit.Before)

Aggregations

MaterialRepository (com.thoughtworks.go.server.persistence.MaterialRepository)4 Before (org.junit.Before)4 PipelineSqlMapDao (com.thoughtworks.go.server.dao.PipelineSqlMapDao)2 PipelineTimeline (com.thoughtworks.go.server.domain.PipelineTimeline)2 TestTransactionSynchronizationManager (com.thoughtworks.go.server.transaction.TestTransactionSynchronizationManager)2 TestTransactionTemplate (com.thoughtworks.go.server.transaction.TestTransactionTemplate)2 TransactionTemplate (com.thoughtworks.go.server.transaction.TransactionTemplate)2 GoRepoConfigDataSource (com.thoughtworks.go.config.GoRepoConfigDataSource)1 ScmMaterial (com.thoughtworks.go.config.materials.ScmMaterial)1 SvnMaterial (com.thoughtworks.go.config.materials.svn.SvnMaterial)1 Material (com.thoughtworks.go.domain.materials.Material)1 Modification (com.thoughtworks.go.domain.materials.Modification)1 TestSubprocessExecutionContext (com.thoughtworks.go.domain.materials.TestSubprocessExecutionContext)1 MaterialService (com.thoughtworks.go.server.service.MaterialService)1 MaterialPoller (com.thoughtworks.go.server.service.materials.MaterialPoller)1 TempFiles (com.thoughtworks.go.util.TempFiles)1 Date (java.util.Date)1