Search in sources :

Example 26 with RepositoryManagerResult

use of org.jboss.pnc.spi.repositorymanager.RepositoryManagerResult in project pnc by project-ncl.

the class BuildResultMapper method toEntity.

public BuildResult toEntity(BuildResultRest buildResultRest) {
    RepositoryManagerResult repositoryManagerResult = null;
    if (buildResultRest.getRepositoryManagerResult() != null) {
        repositoryManagerResult = repositoryManagerResultMapper.toEntity(buildResultRest.getRepositoryManagerResult());
    }
    BuildExecutionConfiguration bec = null;
    if (buildResultRest.getBuildExecutionConfiguration() != null) {
        bec = buildResultRest.getBuildExecutionConfiguration().toBuildExecutionConfiguration();
    }
    return new BuildResult(buildResultRest.getCompletionStatus(), ofNullable(buildResultRest.getProcessException()), buildResultRest.getProcessLog(), ofNullable(bec), ofNullable(buildResultRest.getBuildDriverResult()), ofNullable(repositoryManagerResult), ofNullable(buildResultRest.getEnvironmentDriverResult()), ofNullable(buildResultRest.getRepourResult()));
}
Also used : BuildResult(org.jboss.pnc.spi.BuildResult) BuildExecutionConfiguration(org.jboss.pnc.spi.executor.BuildExecutionConfiguration) RepositoryManagerResult(org.jboss.pnc.spi.repositorymanager.RepositoryManagerResult)

Example 27 with RepositoryManagerResult

use of org.jboss.pnc.spi.repositorymanager.RepositoryManagerResult in project pnc by project-ncl.

the class RepositoryManagerResultMapper method toDTO.

public RepositoryManagerResultRest toDTO(RepositoryManagerResult entity) {
    List<Artifact> builtArtifacts = entity.getBuiltArtifacts().stream().map(artifact -> artifactMapper.toDTO(artifact)).collect(Collectors.toList());
    List<Artifact> dependencies = entity.getDependencies().stream().map(artifact -> artifactMapper.toDTO(artifact)).collect(Collectors.toList());
    String buildContentId = entity.getBuildContentId();
    String log = entity.getLog();
    CompletionStatus completionStatus = entity.getCompletionStatus();
    return new RepositoryManagerResultRest(builtArtifacts, dependencies, buildContentId, log, completionStatus);
}
Also used : Inject(javax.inject.Inject) GenericRepositoryManagerResult(org.jboss.pnc.bpm.model.RepositoryManagerResultRest.GenericRepositoryManagerResult) List(java.util.List) RepositoryManagerResult(org.jboss.pnc.spi.repositorymanager.RepositoryManagerResult) RepositoryManagerResultRest(org.jboss.pnc.bpm.model.RepositoryManagerResultRest) CompletionStatus(org.jboss.pnc.spi.coordinator.CompletionStatus) ApplicationScoped(javax.enterprise.context.ApplicationScoped) Artifact(org.jboss.pnc.dto.Artifact) ArtifactMapper(org.jboss.pnc.mapper.api.ArtifactMapper) Collectors(java.util.stream.Collectors) RepositoryManagerResultRest(org.jboss.pnc.bpm.model.RepositoryManagerResultRest) CompletionStatus(org.jboss.pnc.spi.coordinator.CompletionStatus) Artifact(org.jboss.pnc.dto.Artifact)

Aggregations

RepositoryManagerResult (org.jboss.pnc.spi.repositorymanager.RepositoryManagerResult)27 Artifact (org.jboss.pnc.model.Artifact)14 RepositorySession (org.jboss.pnc.spi.repositorymanager.model.RepositorySession)14 Test (org.junit.Test)14 TestBuildExecution (org.jboss.pnc.indyrepositorymanager.fixture.TestBuildExecution)12 BuildExecution (org.jboss.pnc.spi.repositorymanager.BuildExecution)11 ContainerTest (org.jboss.pnc.test.category.ContainerTest)11 StoreKey (org.commonjava.indy.model.core.StoreKey)9 BuildDriverResult (org.jboss.pnc.spi.builddriver.BuildDriverResult)7 File (java.io.File)6 CompletionStatus (org.jboss.pnc.spi.coordinator.CompletionStatus)6 SimpleArtifactRef (org.commonjava.atlas.maven.ident.ref.SimpleArtifactRef)5 BuildResult (org.jboss.pnc.spi.BuildResult)5 BuildExecutionConfiguration (org.jboss.pnc.spi.executor.BuildExecutionConfiguration)5 ByteArrayInputStream (java.io.ByteArrayInputStream)4 HashSet (java.util.HashSet)4 ProjectVersionRef (org.commonjava.atlas.maven.ident.ref.ProjectVersionRef)4 SimpleProjectVersionRef (org.commonjava.atlas.maven.ident.ref.SimpleProjectVersionRef)4 Indy (org.commonjava.indy.client.core.Indy)4 IndyFoloContentClientModule (org.commonjava.indy.folo.client.IndyFoloContentClientModule)4