@Test public void testHandleProcessingError() { Settings settings = new Settings(); BatfishJobExecutor executor = BatfishJobExecutor.getBatfishJobExecutor(settings, _logger); List<BatfishException> failureCauses = new ArrayList<>(); _thrown.expect(BatfishException.class); _thrown.expectMessage(BatfishJobExecutor.JOB_FAILURE_MESSAGE); executor.handleProcessingError( Lists.newArrayList(new BfTestJob(settings, "result1")), failureCauses, true); }
<JobT> void handleProcessingError( List<JobT> jobs, List<BatfishException> failureCauses, boolean haltOnProcessingError) { int numJobs = jobs.size(); int numFailed = failureCauses.size(); int numSucceeded = numJobs - numFailed; _logger.infof("%d jobs succeeded; %d jobs failed\n", numSucceeded, numFailed); if (haltOnProcessingError) { BatfishException e = new BatfishException(JOB_FAILURE_MESSAGE); failureCauses.forEach(e::addSuppressed); throw e; } }
BatfishJobExecutor { <JobT> void handleProcessingError( List<JobT> jobs, List<BatfishException> failureCauses, boolean haltOnProcessingError) { int numJobs = jobs.size(); int numFailed = failureCauses.size(); int numSucceeded = numJobs - numFailed; _logger.infof("%d jobs succeeded; %d jobs failed\n", numSucceeded, numFailed); if (haltOnProcessingError) { BatfishException e = new BatfishException(JOB_FAILURE_MESSAGE); failureCauses.forEach(e::addSuppressed); throw e; } } }
BatfishJobExecutor { <JobT> void handleProcessingError( List<JobT> jobs, List<BatfishException> failureCauses, boolean haltOnProcessingError) { int numJobs = jobs.size(); int numFailed = failureCauses.size(); int numSucceeded = numJobs - numFailed; _logger.infof("%d jobs succeeded; %d jobs failed\n", numSucceeded, numFailed); if (haltOnProcessingError) { BatfishException e = new BatfishException(JOB_FAILURE_MESSAGE); failureCauses.forEach(e::addSuppressed); throw e; } } private  BatfishJobExecutor(Settings settings, BatfishLogger logger); }
BatfishJobExecutor { <JobT> void handleProcessingError( List<JobT> jobs, List<BatfishException> failureCauses, boolean haltOnProcessingError) { int numJobs = jobs.size(); int numFailed = failureCauses.size(); int numSucceeded = numJobs - numFailed; _logger.infof("%d jobs succeeded; %d jobs failed\n", numSucceeded, numFailed); if (haltOnProcessingError) { BatfishException e = new BatfishException(JOB_FAILURE_MESSAGE); failureCauses.forEach(e::addSuppressed); throw e; } } private  BatfishJobExecutor(Settings settings, BatfishLogger logger); static void runJobsInExecutor(
          Settings settings,
          BatfishLogger logger,
          List<JobT> jobs,
          OutputT output,
          AnswerElementT answerElement,
          boolean haltOnProcessingError,
          String description); }
BatfishJobExecutor { <JobT> void handleProcessingError( List<JobT> jobs, List<BatfishException> failureCauses, boolean haltOnProcessingError) { int numJobs = jobs.size(); int numFailed = failureCauses.size(); int numSucceeded = numJobs - numFailed; _logger.infof("%d jobs succeeded; %d jobs failed\n", numSucceeded, numFailed); if (haltOnProcessingError) { BatfishException e = new BatfishException(JOB_FAILURE_MESSAGE); failureCauses.forEach(e::addSuppressed); throw e; } } private  BatfishJobExecutor(Settings settings, BatfishLogger logger); static void runJobsInExecutor(
          Settings settings,
          BatfishLogger logger,
          List<JobT> jobs,
          OutputT output,
          AnswerElementT answerElement,
          boolean haltOnProcessingError,
          String description);  }