//todo get this working for other types of test case rendering other then just surefire
// check if there are surefire results to display
project = getContinuum().getProject( getProjectId() );
ConfigurationService configuration = getContinuum().getConfiguration();
// view build result of the current build from the distributed build agent
if ( configuration.isDistributedBuildEnabled() &&
project.getState() == ContinuumProjectState.BUILDING && getBuildId() == 0 )
{
// if the project is currently building in distributed build agent, the build result will be stored in the database after the build is finished.
// it's safe to assume that the build result will be null at this point
Map<String, Object> map = distributedBuildManager.getBuildResult( project.getId() );
if ( map == null )
{
projectGroupId = project.getProjectGroup().getId();
return ERROR;
}
if ( map.size() > 0 )
{
buildResult = ContinuumBuildConstant.getBuildResult( map, null );
buildOutput = ContinuumBuildConstant.getBuildOutput( map );
if ( ServletActionContext.getRequest() != null )
{
state = StateGenerator.generate( buildResult.getState(),
ServletActionContext.getRequest().getContextPath() );
}
}
changeSet = null;
hasSurefireResults = false;
this.setCanDelete( false );
}
else
{
buildResult = getContinuum().getBuildResult( getBuildId() );
// directory contains files ?
File surefireReportsDirectory = configuration.getTestReportsDirectory( buildId, getProjectId() );
File[] files = surefireReportsDirectory.listFiles();
hasSurefireResults = files != null && files.length > 0;
changeSet = getContinuum().getChangesSinceLastSuccess( getProjectId(), getBuildId() );
buildOutput = getBuildOutputText();