Search in sources :

Example 1 with TestTransactionTemplate

use of com.thoughtworks.go.server.transaction.TestTransactionTemplate 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 2 with TestTransactionTemplate

use of com.thoughtworks.go.server.transaction.TestTransactionTemplate in project gocd by gocd.

the class ScheduleServiceTest method setup.

@Before
public void setup() {
    jobInstanceService = mock(JobInstanceService.class);
    goConfigService = mock(GoConfigService.class);
    environmentConfigService = mock(EnvironmentConfigService.class);
    serverHealthService = mock(ServerHealthService.class);
    final TestTransactionSynchronizationManager synchronizationManager = new TestTransactionSynchronizationManager();
    schedulingChecker = mock(SchedulingCheckerService.class);
    pipelineScheduleQueue = mock(PipelineScheduleQueue.class);
    consoleActivityMonitor = mock(ConsoleActivityMonitor.class);
    pipelinePauseService = mock(PipelinePauseService.class);
    stageService = mock(StageService.class);
    securityService = mock(SecurityService.class);
    pipelineService = mock(PipelineService.class);
    localizer = mock(Localizer.class);
    timeProvider = new TimeProvider();
    schedulingPerformanceLogger = mock(SchedulingPerformanceLogger.class);
    elasticProfileService = mock(ElasticProfileService.class);
    service = new ScheduleService(goConfigService, pipelineService, stageService, schedulingChecker, mock(PipelineScheduledTopic.class), mock(PipelineDao.class), mock(StageDao.class), mock(StageOrderService.class), securityService, pipelineScheduleQueue, jobInstanceService, mock(JobInstanceDao.class), mock(AgentAssignment.class), environmentConfigService, mock(PipelineLockService.class), serverHealthService, new TestTransactionTemplate(synchronizationManager), mock(AgentService.class), synchronizationManager, timeProvider, consoleActivityMonitor, pipelinePauseService, instanceFactory, schedulingPerformanceLogger, elasticProfileService);
}
Also used : TestTransactionTemplate(com.thoughtworks.go.server.transaction.TestTransactionTemplate) TimeProvider(com.thoughtworks.go.util.TimeProvider) TestTransactionSynchronizationManager(com.thoughtworks.go.server.transaction.TestTransactionSynchronizationManager) Localizer(com.thoughtworks.go.i18n.Localizer) SchedulingPerformanceLogger(com.thoughtworks.go.server.perf.SchedulingPerformanceLogger) ServerHealthService(com.thoughtworks.go.serverhealth.ServerHealthService) Before(org.junit.Before)

Example 3 with TestTransactionTemplate

use of com.thoughtworks.go.server.transaction.TestTransactionTemplate in project gocd by gocd.

the class JobRerunScheduleServiceTest method setup.

@Before
public void setup() {
    jobInstanceService = mock(JobInstanceService.class);
    goConfigService = mock(GoConfigService.class);
    environmentConfigService = mock(EnvironmentConfigService.class);
    serverHealthService = mock(ServerHealthService.class);
    final TestTransactionSynchronizationManager synchronizationManager = new TestTransactionSynchronizationManager();
    schedulingChecker = mock(SchedulingCheckerService.class);
    pipelineScheduleQueue = mock(PipelineScheduleQueue.class);
    pipelineService = mock(PipelineService.class);
    stageService = mock(StageService.class);
    securityService = mock(SecurityService.class);
    lockService = mock(PipelineLockService.class);
    txnTemplate = new TestTransactionTemplate(synchronizationManager);
    timeProvider = new TimeProvider();
    instanceFactory = mock(InstanceFactory.class);
    schedulingPerformanceLogger = mock(SchedulingPerformanceLogger.class);
    elasticProfileService = mock(ElasticProfileService.class);
    service = new ScheduleService(goConfigService, pipelineService, stageService, schedulingChecker, mock(PipelineScheduledTopic.class), mock(PipelineDao.class), mock(StageDao.class), mock(StageOrderService.class), securityService, pipelineScheduleQueue, jobInstanceService, mock(JobInstanceDao.class), mock(AgentAssignment.class), environmentConfigService, lockService, serverHealthService, txnTemplate, mock(AgentService.class), synchronizationManager, timeProvider, null, null, instanceFactory, schedulingPerformanceLogger, elasticProfileService);
}
Also used : TestTransactionTemplate(com.thoughtworks.go.server.transaction.TestTransactionTemplate) TimeProvider(com.thoughtworks.go.util.TimeProvider) TestTransactionSynchronizationManager(com.thoughtworks.go.server.transaction.TestTransactionSynchronizationManager) SchedulingPerformanceLogger(com.thoughtworks.go.server.perf.SchedulingPerformanceLogger) ServerHealthService(com.thoughtworks.go.serverhealth.ServerHealthService) Before(org.junit.Before)

Example 4 with TestTransactionTemplate

use of com.thoughtworks.go.server.transaction.TestTransactionTemplate in project gocd by gocd.

the class JobInstanceServiceTest method setUp.

@Before
public void setUp() throws Exception {
    initMocks(this);
    job = JobInstanceMother.building("dev");
    transactionSynchronizationManager = new TestTransactionSynchronizationManager();
    transactionTemplate = new TestTransactionTemplate(transactionSynchronizationManager);
    jobStatusCache = new JobStatusCache(stageDao);
}
Also used : TestTransactionTemplate(com.thoughtworks.go.server.transaction.TestTransactionTemplate) JobStatusCache(com.thoughtworks.go.domain.activity.JobStatusCache) TestTransactionSynchronizationManager(com.thoughtworks.go.server.transaction.TestTransactionSynchronizationManager) Before(org.junit.Before)

Example 5 with TestTransactionTemplate

use of com.thoughtworks.go.server.transaction.TestTransactionTemplate 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

TestTransactionSynchronizationManager (com.thoughtworks.go.server.transaction.TestTransactionSynchronizationManager)7 TestTransactionTemplate (com.thoughtworks.go.server.transaction.TestTransactionTemplate)7 Before (org.junit.Before)6 PipelineSqlMapDao (com.thoughtworks.go.server.dao.PipelineSqlMapDao)2 PipelineTimeline (com.thoughtworks.go.server.domain.PipelineTimeline)2 SchedulingPerformanceLogger (com.thoughtworks.go.server.perf.SchedulingPerformanceLogger)2 MaterialRepository (com.thoughtworks.go.server.persistence.MaterialRepository)2 TransactionTemplate (com.thoughtworks.go.server.transaction.TransactionTemplate)2 ServerHealthService (com.thoughtworks.go.serverhealth.ServerHealthService)2 TimeProvider (com.thoughtworks.go.util.TimeProvider)2 JobStatusCache (com.thoughtworks.go.domain.activity.JobStatusCache)1 Localizer (com.thoughtworks.go.i18n.Localizer)1 GoCache (com.thoughtworks.go.server.cache.GoCache)1 PipelineDao (com.thoughtworks.go.server.dao.PipelineDao)1 StageDao (com.thoughtworks.go.server.dao.StageDao)1 Username (com.thoughtworks.go.server.domain.Username)1 HttpLocalizedOperationResult (com.thoughtworks.go.server.service.result.HttpLocalizedOperationResult)1 HttpOperationResult (com.thoughtworks.go.server.service.result.HttpOperationResult)1 OperationResult (com.thoughtworks.go.server.service.result.OperationResult)1 Semaphore (java.util.concurrent.Semaphore)1