@Test public void testGetAllExceptions() throws Exception { TestSuite ts = new TestSuite(); ts.addException(new SakuliCheckedException("bla")); TestCase tc = new TestCase(null, null); tc.addException(new SakuliCheckedException("bla2")); ts.addTestCase(tc); TestCaseStep step = new TestCaseStep(); step.addException(new SakuliCheckedException("bla3")); tc.addStep(step); List<Exception> allExceptions = SakuliExceptionHandler.getAllExceptions(ts); assertEquals(allExceptions.size(), 3); }
public static List<Exception> getAllExceptions(TestSuite testSuite) { List<Exception> result = new ArrayList<>(); if (testSuite.getException() != null) { result.add(testSuite.getException()); } if (testSuite.getTestCases() != null) { for (TestCase tc : testSuite.getTestCases().values()) { if (tc.getException() != null) { result.add(tc.getException()); } for (TestCaseStep step : tc.getSteps()) { if (step.getException() != null) { result.add(step.getException()); } } } } return result; }
SakuliExceptionHandler { public static List<Exception> getAllExceptions(TestSuite testSuite) { List<Exception> result = new ArrayList<>(); if (testSuite.getException() != null) { result.add(testSuite.getException()); } if (testSuite.getTestCases() != null) { for (TestCase tc : testSuite.getTestCases().values()) { if (tc.getException() != null) { result.add(tc.getException()); } for (TestCaseStep step : tc.getSteps()) { if (step.getException() != null) { result.add(step.getException()); } } } } return result; } }
SakuliExceptionHandler { public static List<Exception> getAllExceptions(TestSuite testSuite) { List<Exception> result = new ArrayList<>(); if (testSuite.getException() != null) { result.add(testSuite.getException()); } if (testSuite.getTestCases() != null) { for (TestCase tc : testSuite.getTestCases().values()) { if (tc.getException() != null) { result.add(tc.getException()); } for (TestCaseStep step : tc.getSteps()) { if (step.getException() != null) { result.add(step.getException()); } } } } return result; }  }
SakuliExceptionHandler { public static List<Exception> getAllExceptions(TestSuite testSuite) { List<Exception> result = new ArrayList<>(); if (testSuite.getException() != null) { result.add(testSuite.getException()); } if (testSuite.getTestCases() != null) { for (TestCase tc : testSuite.getTestCases().values()) { if (tc.getException() != null) { result.add(tc.getException()); } for (TestCaseStep step : tc.getSteps()) { if (step.getException() != null) { result.add(step.getException()); } } } } return result; }  static List<Exception> getAllExceptions(TestSuite testSuite); static Path getScreenshotFile(Exception e); static Exception castTo(SakuliException e); void handleException(Exception e); boolean isAlreadyProcessed(Exception e); boolean resumeToTestExecution(Exception e); void handleException(Exception e, boolean resumeOnException); void handleException(String exceptionMessage, boolean resumeOnException); void handleException(String exceptionMessage, RegionImpl lastRegion, boolean resumeOnException); void handleException(Exception e, RegionImpl lastRegion, boolean resumeOnException); void handleException(LogResult logResult); }
SakuliExceptionHandler { public static List<Exception> getAllExceptions(TestSuite testSuite) { List<Exception> result = new ArrayList<>(); if (testSuite.getException() != null) { result.add(testSuite.getException()); } if (testSuite.getTestCases() != null) { for (TestCase tc : testSuite.getTestCases().values()) { if (tc.getException() != null) { result.add(tc.getException()); } for (TestCaseStep step : tc.getSteps()) { if (step.getException() != null) { result.add(step.getException()); } } } } return result; }  static List<Exception> getAllExceptions(TestSuite testSuite); static Path getScreenshotFile(Exception e); static Exception castTo(SakuliException e); void handleException(Exception e); boolean isAlreadyProcessed(Exception e); boolean resumeToTestExecution(Exception e); void handleException(Exception e, boolean resumeOnException); void handleException(String exceptionMessage, boolean resumeOnException); void handleException(String exceptionMessage, RegionImpl lastRegion, boolean resumeOnException); void handleException(Exception e, RegionImpl lastRegion, boolean resumeOnException); void handleException(LogResult logResult);  }