Search in sources :

Example 6 with InstanceFactory

use of com.thoughtworks.go.server.service.InstanceFactory in project gocd by gocd.

the class PipelineWithTwoStages method scheduleAndCompleteFollowingStages.

protected void scheduleAndCompleteFollowingStages(Pipeline pipeline, JobResult result) {
    Stage ft = new InstanceFactory().createStageInstance(ftStage(), new DefaultSchedulingContext("anyone"), "md5-test", new TimeProvider());
    ft.setOrderId(pipeline.getFirstStage().getOrderId() + 1);
    dbHelper.getStageDao().saveWithJobs(pipeline, ft);
    dbHelper.completeStage(ft, result);
}
Also used : TimeProvider(com.thoughtworks.go.util.TimeProvider) InstanceFactory(com.thoughtworks.go.server.service.InstanceFactory) Stage(com.thoughtworks.go.domain.Stage) DefaultSchedulingContext(com.thoughtworks.go.domain.DefaultSchedulingContext)

Aggregations

InstanceFactory (com.thoughtworks.go.server.service.InstanceFactory)6 TimeProvider (com.thoughtworks.go.util.TimeProvider)5 DefaultSchedulingContext (com.thoughtworks.go.domain.DefaultSchedulingContext)4 Stage (com.thoughtworks.go.domain.Stage)3 StageConfig (com.thoughtworks.go.config.StageConfig)2 CachedGoPartials (com.thoughtworks.go.config.CachedGoPartials)1 GoConfigMigration (com.thoughtworks.go.config.GoConfigMigration)1 StageInstanceModel (com.thoughtworks.go.presentation.pipelinehistory.StageInstanceModel)1 StageInstanceModels (com.thoughtworks.go.presentation.pipelinehistory.StageInstanceModels)1 GoConfigService (com.thoughtworks.go.server.service.GoConfigService)1 SystemTimeClock (com.thoughtworks.go.util.SystemTimeClock)1 Test (org.junit.Test)1