Search in sources :

Example 1 with TestTransactionSynchronizationManager

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

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

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

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

the class UserSqlMapDaoTest method setUp.

@Before
public void setUp() {
    initMocks(this);
    goCache = new StubGoCache(new TestTransactionSynchronizationManager());
    dao = new UserSqlMapDao(sessionFactory, transactionTemplate, goCache, transactionSynchronizationManager);
}
Also used : StubGoCache(com.thoughtworks.go.server.service.StubGoCache) TestTransactionSynchronizationManager(com.thoughtworks.go.server.transaction.TestTransactionSynchronizationManager) Before(org.junit.Before)

Example 5 with TestTransactionSynchronizationManager

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

Aggregations

TestTransactionSynchronizationManager (com.thoughtworks.go.server.transaction.TestTransactionSynchronizationManager)11 Before (org.junit.Before)8 TestTransactionTemplate (com.thoughtworks.go.server.transaction.TestTransactionTemplate)7 StubGoCache (com.thoughtworks.go.server.service.StubGoCache)4 Test (org.junit.Test)3 GoCache (com.thoughtworks.go.server.cache.GoCache)2 PipelineSqlMapDao (com.thoughtworks.go.server.dao.PipelineSqlMapDao)2 PipelineTimeline (com.thoughtworks.go.server.domain.PipelineTimeline)2 FeatureToggle (com.thoughtworks.go.server.domain.support.toggle.FeatureToggle)2 FeatureToggles (com.thoughtworks.go.server.domain.support.toggle.FeatureToggles)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 Cache (com.opensymphony.oscache.base.Cache)1 Cloner (com.rits.cloning.Cloner)1 JobStatusCache (com.thoughtworks.go.domain.activity.JobStatusCache)1 Localizer (com.thoughtworks.go.i18n.Localizer)1 PipelineDao (com.thoughtworks.go.server.dao.PipelineDao)1