use of org.jboss.pnc.spi.BuildOptions in project pnc by project-ncl.
the class ConfigurationsTest method dependsOnItselfConfigurationTestCase.
// TODO test is not run as expected exception is thrown
@Test(expected = PersistenceException.class)
// configurationBuilder.build...
@InSequence(10)
public void dependsOnItselfConfigurationTestCase() throws Exception {
BuildConfiguration buildConfiguration = configurationBuilder.buildConfigurationWhichDependsOnItself();
User user = User.Builder.newBuilder().id(1).build();
BuildOptions buildOptions = new BuildOptions();
buildOptions.setBuildDependencies(false);
BuildSetTask taskSet = buildCoordinator.build(buildConfiguration, user, buildOptions);
Set<BuildTask> buildTasks = taskSet.getBuildTasks();
assertThat(buildTasks).hasSize(1);
BuildTask buildTask = buildTasks.iterator().next();
Assert.assertEquals(BuildCoordinationStatus.REJECTED, buildTask.getStatus());
Assert.assertTrue("Invalid status description: " + buildTask.getStatusDescription(), buildTask.getStatusDescription().contains("itself"));
}
use of org.jboss.pnc.spi.BuildOptions in project pnc by project-ncl.
the class ConfigurationsTest method cycleConfigurationTestCase.
// TODO test is not run as expected exception is thrown
@Test(expected = PersistenceException.class)
// configurationBuilder.build...
@InSequence(15)
public void cycleConfigurationTestCase() throws Exception {
BuildConfigurationSet buildConfigurationSet = configurationBuilder.buildConfigurationSetWithCycleDependency();
User user = User.Builder.newBuilder().id(1).build();
BuildOptions buildOptions = new BuildOptions();
buildOptions.setRebuildMode(RebuildMode.FORCE);
BuildSetTask buildSetTask = buildCoordinator.build(buildConfigurationSet, user, buildOptions);
Assert.assertEquals(BuildSetStatus.REJECTED, buildSetTask.getStatus());
Assert.assertTrue("Invalid status description: " + buildSetTask.getStatusDescription(), buildSetTask.getStatusDescription().contains("Cycle dependencies found"));
}
use of org.jboss.pnc.spi.BuildOptions in project pnc by project-ncl.
the class DatastoreAdapterTest method mockBuildTask.
private BuildTask mockBuildTask() {
BuildConfiguration buildConfiguration = new BuildConfiguration();
buildConfiguration.setId(12);
buildConfiguration.setName("Configuration.");
buildConfiguration.setProject(new Project());
BuildOptions buildOptions = new BuildOptions(false, true, false, false, RebuildMode.IMPLICIT_DEPENDENCY_CHECK, AlignmentPreference.PREFER_PERSISTENT);
BuildTask buildTask = BuildTask.build(BuildConfigurationAudited.fromBuildConfiguration(buildConfiguration, 13), buildOptions, MockUser.newTestUser(1), "123", null, new Date(), null, "context-id", Optional.empty());
buildTask.setStatus(BuildCoordinationStatus.DONE);
return buildTask;
}
use of org.jboss.pnc.spi.BuildOptions in project pnc by project-ncl.
the class ExpliciteDependenciesTest method shouldBuildABCOnForceAWithDependencies.
@Test
public void shouldBuildABCOnForceAWithDependencies() throws TimeoutException, InterruptedException {
// when
insertNewBuildRecords(d, b, a);
BuildOptions buildOptions = new BuildOptions();
buildOptions.setBuildDependencies(true);
buildOptions.setRebuildMode(RebuildMode.FORCE);
build(a, buildOptions);
// then
expectBuilt(d, b, a);
}
use of org.jboss.pnc.spi.BuildOptions in project pnc by project-ncl.
the class ExpliciteDependenciesTest method shouldBuildAOnModifiedCWhenImplicitDependencyCheck.
@Test
public void shouldBuildAOnModifiedCWhenImplicitDependencyCheck() throws TimeoutException, InterruptedException {
// when
insertNewBuildRecords(c);
BuildOptions buildOptions = new BuildOptions();
buildOptions.setBuildDependencies(false);
buildOptions.setRebuildMode(RebuildMode.IMPLICIT_DEPENDENCY_CHECK);
build(a, buildOptions);
// then
expectBuilt(a);
}
Aggregations