use of com.thoughtworks.go.server.transaction.TransactionTemplate in project gocd by gocd.
the class PackageMaterialUpdaterTest method setup.
@BeforeEach
public void setup() {
transactionTemplate = new TransactionTemplate(null) {
@Override
public Object execute(TransactionCallback action) {
return action.doInTransaction(null);
}
@Override
public Object executeWithExceptionHandling(com.thoughtworks.go.server.transaction.TransactionCallback action) throws Exception {
// To change body of overridden methods use File | Settings | File Templates.
return super.executeWithExceptionHandling(action);
}
@Override
public <T extends Exception> Object transactionSurrounding(TransactionSurrounding<T> surrounding) throws T {
// To change body of overridden methods use File | Settings | File Templates.
return super.transactionSurrounding(surrounding);
}
};
materialUpdater = new PackageMaterialUpdater(materialRepository, scmMaterialUpdater, transactionTemplate);
}
use of com.thoughtworks.go.server.transaction.TransactionTemplate in project gocd by gocd.
the class PluggableSCMMaterialUpdaterTest method setup.
@BeforeEach
public void setup() {
transactionTemplate = new TransactionTemplate(null) {
@Override
public Object execute(TransactionCallback action) {
return action.doInTransaction(null);
}
@Override
public Object executeWithExceptionHandling(com.thoughtworks.go.server.transaction.TransactionCallback action) throws Exception {
// To change body of overridden methods use File | Settings | File Templates.
return super.executeWithExceptionHandling(action);
}
@Override
public <T extends Exception> Object transactionSurrounding(TransactionSurrounding<T> surrounding) throws T {
// To change body of overridden methods use File | Settings | File Templates.
return super.transactionSurrounding(surrounding);
}
};
materialUpdater = new PluggableSCMMaterialUpdater(materialRepository, scmMaterialUpdater, transactionTemplate);
}
use of com.thoughtworks.go.server.transaction.TransactionTemplate in project gocd by gocd.
the class PipelineServiceTest method setUp.
@BeforeEach
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);
}
Aggregations