use of org.jboss.pnc.coordinator.builder.datastore.DatastoreAdapter in project pnc by project-ncl.
the class DatastoreAdapterTest method shouldStoreRepositoryManagerSuccessResult.
@Test
public void shouldStoreRepositoryManagerSuccessResult() throws DatastoreException {
// given
DatastoreMock datastore = new DatastoreMock();
DatastoreAdapter datastoreAdapter = new DatastoreAdapter(datastore);
BuildStatus buildStatus = BuildStatus.SUCCESS;
CompletionStatus completionStatus = CompletionStatus.SUCCESS;
// when
storeResult(datastoreAdapter, buildStatus, completionStatus);
// then
List<BuildRecord> buildRecords = datastore.getBuildRecords();
Assert.assertEquals(1, buildRecords.size());
BuildRecord buildRecord = buildRecords.get(0);
Assert.assertEquals(buildRecord.getStatus(), BuildStatus.SUCCESS);
Assert.assertTrue(buildRecord.getBuildLog().contains(BUILD_LOG));
Assert.assertTrue(buildRecord.getBuildLog().contains(REPOSITORY_MANAGER_LOG));
}
use of org.jboss.pnc.coordinator.builder.datastore.DatastoreAdapter in project pnc by project-ncl.
the class BuildCoordinatorFactory method createBuildCoordinator.
public BuildCoordinatorBeans createBuildCoordinator(DatastoreMock datastore) {
DatastoreAdapter datastoreAdapter = new DatastoreAdapter(datastore);
SystemConfig systemConfig = createConfiguration();
BuildQueue queue = new BuildQueue(systemConfig);
LocalBuildSchedulerMock localBuildScheduler = new LocalBuildSchedulerMock();
BuildSchedulerFactory buildSchedulerFactory = new BuildSchedulerFactory() {
@Override
public BuildScheduler getBuildScheduler() {
return localBuildScheduler;
}
};
BuildCoordinator coordinator = new DefaultBuildCoordinator(datastoreAdapter, buildStatusChangedEventNotifier, buildSetStatusChangedEventNotifier, buildSchedulerFactory, queue, systemConfig, groupBuildMapper, buildMapper);
localBuildScheduler.setBuildCoordinator(coordinator);
coordinator.start();
queue.initSemaphore();
return new BuildCoordinatorBeans(queue, coordinator);
}
Aggregations