use of org.jboss.pnc.client.RemoteResourceNotFoundException in project pnc by project-ncl.
the class BuildTest method buildToFinish.
private Boolean buildToFinish(String buildId, EnumSet<BuildStatus> isIn, EnumSet<BuildStatus> isNotIn) {
Build build = null;
logger.debug("Waiting for build {} to finish", buildId);
try {
build = buildClient.getSpecific(buildId);
assertThat(build).isNotNull();
logger.debug("Gotten build with status: {}", build.getStatus());
if (!build.getStatus().isFinal())
return false;
} catch (RemoteResourceNotFoundException e) {
fail(String.format("Build with id:%s not present", buildId), e);
} catch (ClientException e) {
fail("Client has failed in an unexpected way.", e);
}
assertThat(build).isNotNull();
assertThat(build.getStatus()).isNotNull();
if (isIn != null && !isIn.isEmpty())
assertThat(build.getStatus()).isIn(isIn);
if (isNotIn != null && !isNotIn.isEmpty())
assertThat(build.getStatus()).isNotIn(isNotIn);
return true;
}
use of org.jboss.pnc.client.RemoteResourceNotFoundException in project pnc by project-ncl.
the class BuildTest method groupBuildToFinish.
private Boolean groupBuildToFinish(String groupBuildId, EnumSet<BuildStatus> isIn, EnumSet<BuildStatus> isNotIn) {
if (isIn == null)
isIn = EnumSet.noneOf(BuildStatus.class);
if (isNotIn == null)
isNotIn = EnumSet.noneOf(BuildStatus.class);
GroupBuild build = null;
logger.debug("Waiting for build {} to finish", groupBuildId);
try {
build = groupBuildClient.getSpecific(groupBuildId);
assertThat(build).isNotNull();
logger.debug("Gotten build with status: {}", build.getStatus());
if (!build.getStatus().isFinal())
return false;
} catch (RemoteResourceNotFoundException e) {
fail(String.format("Group Build with id:%s not present", groupBuildId), e);
} catch (ClientException e) {
fail("Client has failed in an unexpected way.", e);
}
assertThat(build.getStatus()).isNotIn(isNotIn).isIn(isIn);
return true;
}
use of org.jboss.pnc.client.RemoteResourceNotFoundException in project pnc by project-ncl.
the class WebSocketClientTest method groupBuildToFinish.
private Boolean groupBuildToFinish(String groupBuildId) {
GroupBuild build = null;
try {
build = new GroupBuildClient(RestClientConfiguration.asUser()).getSpecific(groupBuildId);
assertThat(build).isNotNull();
if (!build.getStatus().isFinal())
return false;
} catch (RemoteResourceNotFoundException e) {
fail(String.format("Group Build with id:%s not present", groupBuildId), e);
} catch (ClientException e) {
fail("Client has failed in an unexpected way.", e);
}
return true;
}
Aggregations