本文整理汇总了Java中jetbrains.buildServer.agent.BuildFinishedStatus.FINISHED_SUCCESS属性的典型用法代码示例。如果您正苦于以下问题:Java BuildFinishedStatus.FINISHED_SUCCESS属性的具体用法?Java BuildFinishedStatus.FINISHED_SUCCESS怎么用?Java BuildFinishedStatus.FINISHED_SUCCESS使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类jetbrains.buildServer.agent.BuildFinishedStatus
的用法示例。
在下文中一共展示了BuildFinishedStatus.FINISHED_SUCCESS属性的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: waitBuildFinish
public BuildFinishedStatus waitBuildFinish()
throws InterruptedException {
boolean buildFinished = false;
Build childBuild = null;
while (!buildFinished && !canceled) {
childBuild = buildsResource.serveBuild(build.getBuildId().toString(), "");
buildFinished = isBuildFinished(childBuild);
Thread.sleep(100L);
}
buildProgressLogger.message("Build " + build.getBuildId()
+ " is finished with success");
if (!canceled) {
if (childBuild.getStatus().equalsIgnoreCase(BuildStatusConst.ERROR)
|| childBuild.getStatus().equalsIgnoreCase(BuildStatusConst.FAILURE)) {
return BuildFinishedStatus.FINISHED_WITH_PROBLEMS;
}
}
return canceled ? BuildFinishedStatus.INTERRUPTED : BuildFinishedStatus.FINISHED_SUCCESS;
}
示例2: logJobStatuses
private BuildFinishedStatus logJobStatuses(Collection<Job> jobs) {
BuildFinishedStatus result = BuildFinishedStatus.FINISHED_SUCCESS;
for (Job job : jobs) {
String jobTitle = job.getTitle();
String jobUrl = getJobUrl(job.getId());
if (job.getStatus() == JobStatus.SUCCESS) {
logger.message(format("%s job execution succeeded (%s).", jobTitle, jobUrl));
} else if (job.getStatus() == JobStatus.FAILURE) {
if (result != BuildFinishedStatus.FINISHED_FAILED) {
result = BuildFinishedStatus.FINISHED_WITH_PROBLEMS;
}
logger.warning(format("%s job execution failed (%s).", jobTitle, jobUrl));
} else {
result = BuildFinishedStatus.FINISHED_FAILED;
logger.error(
format("Unexpected error occured during execution of '%s' or execution took to long (%s).",
jobTitle, jobUrl));
}
}
return result;
}
示例3: waitFor
@NotNull
@Override
public BuildFinishedStatus waitFor() throws RunBuildException {
while (!isInterrupted && !isFinished) {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
throw new RunBuildException(e);
}
}
// MUDO BuildFinishedStatus.FINISHED_WITH_PROBLEMS ??
return isFinished
? (isFailed ? BuildFinishedStatus.FINISHED_FAILED : BuildFinishedStatus.FINISHED_SUCCESS)
: BuildFinishedStatus.INTERRUPTED;
}
示例4: waitForImpl
@NotNull
protected BuildFinishedStatus waitForImpl() throws RunBuildException {
if (isInterrupted()) return BuildFinishedStatus.INTERRUPTED;
for (BuildProcess proc = myProcessList.poll(); proc != null; proc = myProcessList.poll()) {
myCurrentProcess.set(proc);
try {
proc.start();
final BuildFinishedStatus status = proc.waitFor();
if (status != BuildFinishedStatus.INTERRUPTED && status != BuildFinishedStatus.FINISHED_SUCCESS) return status;
} finally {
myCurrentProcess.set(null);
}
if (isInterrupted()) return BuildFinishedStatus.INTERRUPTED;
}
if (isInterrupted()) return BuildFinishedStatus.INTERRUPTED;
return BuildFinishedStatus.FINISHED_SUCCESS;
}
示例5: test_interrupted_in_process_start
@Test
public void test_interrupted_in_process_start() {
final AtomicReference<BuildProcess> bp = new AtomicReference<BuildProcess>();
DelegatingBuildProcess aaa = new DelegatingBuildProcess(new LoggingActionBase(){
@Override
protected RecordingBuildProcess createSub() {
return new RecordingBuildProcess("i", BuildFinishedStatus.FINISHED_SUCCESS){
@Override
public void start() throws RunBuildException {
super.start();
bp.get().interrupt();
}
};
}
});
bp.set(aaa);
assertRunSuccessfully(aaa, INTERRUPTED);
assertLog("start-impl","start-i","interrupt-i","waitFor-i","finish-impl");
Assert.assertTrue(aaa.isFinished());
Assert.assertTrue(aaa.isInterrupted());
}
示例6: test_interrupted_in_process_finish
@Test
public void test_interrupted_in_process_finish() {
final AtomicReference<BuildProcess> bp = new AtomicReference<BuildProcess>();
DelegatingBuildProcess aaa = new DelegatingBuildProcess(new LoggingActionBase(){
@Override
protected RecordingBuildProcess createSub() {
return new RecordingBuildProcess("i", BuildFinishedStatus.FINISHED_SUCCESS){
@NotNull
@Override
public BuildFinishedStatus waitFor() throws RunBuildException {
bp.get().interrupt();
return super.waitFor();
}
};
}
});
bp.set(aaa);
assertRunSuccessfully(aaa, INTERRUPTED);
assertLog("start-impl","start-i","interrupt-i","waitFor-i","finish-impl");
Assert.assertTrue(aaa.isFinished());
Assert.assertTrue(aaa.isInterrupted());
}
示例7: test_interrupted_in_process_finishImpl
@Test
public void test_interrupted_in_process_finishImpl() {
final AtomicReference<BuildProcess> bp = new AtomicReference<BuildProcess>();
DelegatingBuildProcess aaa = new DelegatingBuildProcess(new LoggingAction(BuildFinishedStatus.FINISHED_SUCCESS){
@Override
public void finishedImpl() {
bp.get().interrupt();
super.finishedImpl();
}
});
bp.set(aaa);
assertRunSuccessfully(aaa, INTERRUPTED);
assertLog("start-impl","start-i","waitFor-i","finish-impl");
Assert.assertTrue(aaa.isFinished());
Assert.assertTrue(aaa.isInterrupted());
}
示例8: waitFor
@Override
public @NotNull BuildFinishedStatus waitFor() throws RunBuildException {
while (!isInterrupted() && !hasFinished) {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
throw new RunBuildException(e);
}
}
return hasFinished ?
hasFailed ? BuildFinishedStatus.FINISHED_FAILED :
BuildFinishedStatus.FINISHED_SUCCESS :
BuildFinishedStatus.INTERRUPTED;
}
示例9: sessionFinished
@Nullable
@Override
public BuildFinishedStatus sessionFinished()
{
myLogger.debug("SESSION FINISH");
return BuildFinishedStatus.FINISHED_SUCCESS;
}
示例10: start
@Override
public void start() throws RunBuildException {
List<String> scenarioIds = config.getScenarioIds();
Authentication principal = Authentication.of(config.getUsername(), config.getPassword());
if (scenarioIds == null || scenarioIds.isEmpty()) {
logger.message("Skipping execution - no scenarios were selected.");
status = BuildFinishedStatus.FINISHED_SUCCESS;
return;
}
logger.message(format("Creating jobs for selected scenarios %s ...",
scenarioIds));
List<Job> createdJobs = jobManagementRemoteService.createJobs(
createJobs(config.getContext(), scenarioIds), principal);
long jobsCreatedMillis = System.currentTimeMillis();
Collection<String> createdJobIds = asJobIds(createdJobs);
List<Job> updatedJobs;
do {
if (System.currentTimeMillis() - jobsCreatedMillis >= config.getExecutionTimeoutSec() * 1000) {
break;
}
try {
Thread.sleep(config.getJobStatusCheckIntervalSec() * 1000);
} catch (InterruptedException e) {
throw new ExecutionInterruptionException(
"Unexpected plugin execution thread interrupt occured.",
e);
}
logger.message("Checking job statuses ...");
updatedJobs = jobManagementRemoteService.getJobsByIdsAndPrincipal(
createdJobIds, principal, JobProfile.BRIEF);
} while (!areCompleted(updatedJobs));
logger.message("Jobs execution completed.");
updatedJobs = jobManagementRemoteService.getJobsByIdsAndPrincipal(
createdJobIds, principal, JobProfile.COMPLETE);
status = logJobStatuses(updatedJobs);
}
示例11: waitForImpl
@NotNull
@Override
protected BuildFinishedStatus waitForImpl() throws RunBuildException {
return BuildFinishedStatus.FINISHED_SUCCESS;
}