Search in sources :

Example 11 with BuildDriverException

use of org.jboss.pnc.spi.builddriver.exception.BuildDriverException in project pnc by project-ncl.

the class TermdBuildDriver method complete.

private void complete(TermdRunningBuild termdRunningBuild, RemoteInvocationCompletion completion, FileTransfer fileTransfer) {
    if (completion.getException() != null) {
        logger.warn("Completed with exception.", completion.getException());
        termdRunningBuild.setBuildError(completion.getException());
        return;
    }
    CompletedBuild completedBuild = collectResults(termdRunningBuild.getRunningEnvironment(), completion, fileTransfer);
    logger.debug("Command result {}", completedBuild);
    if (completedBuild == null) {
        termdRunningBuild.setBuildError(new BuildDriverException("Completed build should not be null."));
    } else {
        termdRunningBuild.setCompletedBuild(completedBuild);
    }
}
Also used : CompletedBuild(org.jboss.pnc.spi.builddriver.CompletedBuild) BuildDriverException(org.jboss.pnc.spi.builddriver.exception.BuildDriverException)

Aggregations

BuildDriverException (org.jboss.pnc.spi.builddriver.exception.BuildDriverException)11 CompletedBuild (org.jboss.pnc.spi.builddriver.CompletedBuild)8 Consumer (java.util.function.Consumer)7 RunningEnvironment (org.jboss.pnc.spi.environment.RunningEnvironment)7 Logger (org.slf4j.Logger)7 LoggerFactory (org.slf4j.LoggerFactory)7 Test (org.junit.Test)6 SystemConfig (org.jboss.pnc.common.json.moduleconfig.SystemConfig)5 RunningBuild (org.jboss.pnc.spi.builddriver.RunningBuild)5 BuildExecutionSession (org.jboss.pnc.spi.executor.BuildExecutionSession)5 AtomicReference (java.util.concurrent.atomic.AtomicReference)4 Status (org.jboss.pnc.buildagent.api.Status)4 ConfigurationParseException (org.jboss.pnc.common.json.ConfigurationParseException)4 BuildExecutionConfiguration (org.jboss.pnc.spi.executor.BuildExecutionConfiguration)4 Mockito.doReturn (org.mockito.Mockito.doReturn)4 Mockito.mock (org.mockito.Mockito.mock)4 Paths (java.nio.file.Paths)3 TimeUnit (java.util.concurrent.TimeUnit)3 Inject (javax.inject.Inject)3 TermdBuildDriverModuleConfig (org.jboss.pnc.common.json.moduleconfig.TermdBuildDriverModuleConfig)3