Java Code Examples for jetbrains.buildServer.agent.BuildFinishedStatus#FINISHED_SUCCESS

The following examples show how to use jetbrains.buildServer.agent.BuildFinishedStatus#FINISHED_SUCCESS . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CompositeBuildProcessImpl.java    From TeamCity.Virtual with Apache License 2.0 6 votes vote down vote up
@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;
}
 
Example 2
Source File: DelegatingBuildProcessTest.java    From TeamCity.Virtual with Apache License 2.0 6 votes vote down vote up
@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());
}
 
Example 3
Source File: DelegatingBuildProcessTest.java    From TeamCity.Virtual with Apache License 2.0 6 votes vote down vote up
@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());
}
 
Example 4
Source File: DelegatingBuildProcessTest.java    From TeamCity.Virtual with Apache License 2.0 6 votes vote down vote up
@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());
}
 
Example 5
Source File: DockerVM.java    From TeamCity.Virtual with Apache License 2.0 4 votes vote down vote up
@NotNull
@Override
protected BuildFinishedStatus waitForImpl() throws RunBuildException {
  return BuildFinishedStatus.FINISHED_SUCCESS;
}