use of org.jboss.pnc.model.BuildConfiguration in project pnc by project-ncl.
the class BuildExecutionTest method testBuild.
@Test
public void testBuild() throws ExecutorException, TimeoutException, InterruptedException, BuildDriverException {
BuildConfiguration buildConfiguration = configurationBuilder.build(1, "c1-java");
Set<BuildExecutionStatusChangedEvent> statusChangedEvents = new HashSet<>();
ObjectWrapper<BuildResult> buildExecutionResultWrapper = new ObjectWrapper<>();
runBuild(buildConfiguration, statusChangedEvents, buildExecutionResultWrapper);
List<BuildExecutionStatus> expectedStatuses = getBuildExecutionStatusesSuccess();
// check build statuses
checkBuildStatuses(statusChangedEvents, expectedStatuses);
// check results
BuildResult buildResult = buildExecutionResultWrapper.get();
// check results: logs
BuildDriverResult buildDriverResult = buildResult.getBuildDriverResult().get();
String buildLog = buildDriverResult.getBuildLog();
Assert.assertTrue("Invalid build log.", buildLog.contains("Finished: SUCCESS"));
// check results: artifacts
RepositoryManagerResult repositoryManagerResult = buildResult.getRepositoryManagerResult().get();
Assert.assertTrue("Missing build artifacts.", repositoryManagerResult.getBuiltArtifacts().size() > 0);
Assert.assertTrue("Missing build dependencies.", repositoryManagerResult.getDependencies().size() > 0);
Artifact artifact = repositoryManagerResult.getBuiltArtifacts().iterator().next();
Assert.assertTrue("Invalid built artifact in the result.", artifact.getIdentifier().startsWith(ArtifactBuilder.IDENTIFIER_PREFIX));
}
use of org.jboss.pnc.model.BuildConfiguration in project pnc by project-ncl.
the class TestProjectConfigurationBuilder method buildFailingConfiguration.
public BuildConfiguration buildFailingConfiguration(int id, String name, BuildConfigurationSet buildConfigurationSet) {
BuildConfiguration buildConfiguration = build(id, name, buildConfigurationSet);
buildConfiguration.setBuildScript(FAIL);
return buildConfiguration;
}
use of org.jboss.pnc.model.BuildConfiguration in project pnc by project-ncl.
the class TestProjectConfigurationBuilder method buildConfigurationWithTransitiveDependenciesThatFail.
public BuildConfiguration buildConfigurationWithTransitiveDependenciesThatFail(BuildConfigurationSet buildConfigurationSet) {
BuildConfiguration buildConfiguration1 = build(1, "with-dependencies-1", buildConfigurationSet);
BuildConfiguration buildConfiguration2 = build(2, "with-dependencies-2", buildConfigurationSet);
BuildConfiguration buildConfiguration3 = buildFailingConfiguration(3, "with-dependencies-3", buildConfigurationSet);
buildConfiguration1.addDependency(buildConfiguration2);
buildConfiguration2.addDependency(buildConfiguration3);
return buildConfiguration1;
}
use of org.jboss.pnc.model.BuildConfiguration in project pnc by project-ncl.
the class TestProjectConfigurationBuilder method buildConfigurationForCancelling.
public BuildConfiguration buildConfigurationForCancelling(BuildConfigurationSet buildConfigurationSet) {
BuildConfiguration buildConfiguration1 = build(1, "with-dependency-1-on-2", buildConfigurationSet);
BuildConfiguration buildConfiguration2 = build(2, "with-dependency-2-on-3", buildConfigurationSet);
BuildConfiguration buildConfiguration3 = build(3, "not-dependent", buildConfigurationSet);
// CANCEL script means, that the build waits for 1 sec and then completes itself, gives time to cancel
buildConfiguration2.setBuildScript(CANCEL);
buildConfiguration1.addDependency(buildConfiguration2);
buildConfiguration2.addDependency(buildConfiguration3);
return buildConfiguration1;
}
use of org.jboss.pnc.model.BuildConfiguration in project pnc by project-ncl.
the class TestProjectConfigurationBuilder method buildFailingWithDelayConfiguration.
public BuildConfiguration buildFailingWithDelayConfiguration(int id, String name, BuildConfigurationSet buildConfigurationSet) {
BuildConfiguration buildConfiguration = build(id, name, buildConfigurationSet);
buildConfiguration.setBuildScript(FAIL_WITH_DELAY);
return buildConfiguration;
}
Aggregations