@Test public void testTransformExceptionSakuliCheckedException() { Exception e = new SakuliForwarderCheckedException("test"); assertEquals(testling.transformException(e), e); List<Exception> resumeExceptions = getResumeExceptions(testling); assertTrue(resumeExceptions.contains(e)); }
SakuliException transformException(Exception e) { if (!(e instanceof NonScreenshotException) && loader.getActionProperties().isTakeScreenshots()) { try { Path screenshot = loader.getScreenshotActions().takeScreenshotWithTimestampThrowIOException( e.getMessage(), loader.getActionProperties().getScreenShotFolder(), null, null); return addResumeOnException(new SakuliExceptionWithScreenshot(e, screenshot), resumeToTestExecution(e)); } catch (IOException e2) { logger.error("Screenshot could not be created", e2); e.addSuppressed(e2); } } if (SakuliCheckedException.class.isAssignableFrom(e.getClass())) { return addResumeOnException(((SakuliCheckedException) e), resumeToTestExecution(e)); } if (e instanceof SakuliRuntimeException) { return addResumeOnException(((SakuliRuntimeException) e), resumeToTestExecution(e)); } if (e instanceof RuntimeException) { return addResumeOnException(new SakuliRuntimeException(e), resumeToTestExecution(e)); } return addResumeOnException(new SakuliCheckedException(e), resumeToTestExecution(e)); }
SakuliExceptionHandler { SakuliException transformException(Exception e) { if (!(e instanceof NonScreenshotException) && loader.getActionProperties().isTakeScreenshots()) { try { Path screenshot = loader.getScreenshotActions().takeScreenshotWithTimestampThrowIOException( e.getMessage(), loader.getActionProperties().getScreenShotFolder(), null, null); return addResumeOnException(new SakuliExceptionWithScreenshot(e, screenshot), resumeToTestExecution(e)); } catch (IOException e2) { logger.error("Screenshot could not be created", e2); e.addSuppressed(e2); } } if (SakuliCheckedException.class.isAssignableFrom(e.getClass())) { return addResumeOnException(((SakuliCheckedException) e), resumeToTestExecution(e)); } if (e instanceof SakuliRuntimeException) { return addResumeOnException(((SakuliRuntimeException) e), resumeToTestExecution(e)); } if (e instanceof RuntimeException) { return addResumeOnException(new SakuliRuntimeException(e), resumeToTestExecution(e)); } return addResumeOnException(new SakuliCheckedException(e), resumeToTestExecution(e)); } }
SakuliExceptionHandler { SakuliException transformException(Exception e) { if (!(e instanceof NonScreenshotException) && loader.getActionProperties().isTakeScreenshots()) { try { Path screenshot = loader.getScreenshotActions().takeScreenshotWithTimestampThrowIOException( e.getMessage(), loader.getActionProperties().getScreenShotFolder(), null, null); return addResumeOnException(new SakuliExceptionWithScreenshot(e, screenshot), resumeToTestExecution(e)); } catch (IOException e2) { logger.error("Screenshot could not be created", e2); e.addSuppressed(e2); } } if (SakuliCheckedException.class.isAssignableFrom(e.getClass())) { return addResumeOnException(((SakuliCheckedException) e), resumeToTestExecution(e)); } if (e instanceof SakuliRuntimeException) { return addResumeOnException(((SakuliRuntimeException) e), resumeToTestExecution(e)); } if (e instanceof RuntimeException) { return addResumeOnException(new SakuliRuntimeException(e), resumeToTestExecution(e)); } return addResumeOnException(new SakuliCheckedException(e), resumeToTestExecution(e)); }  }
SakuliExceptionHandler { SakuliException transformException(Exception e) { if (!(e instanceof NonScreenshotException) && loader.getActionProperties().isTakeScreenshots()) { try { Path screenshot = loader.getScreenshotActions().takeScreenshotWithTimestampThrowIOException( e.getMessage(), loader.getActionProperties().getScreenShotFolder(), null, null); return addResumeOnException(new SakuliExceptionWithScreenshot(e, screenshot), resumeToTestExecution(e)); } catch (IOException e2) { logger.error("Screenshot could not be created", e2); e.addSuppressed(e2); } } if (SakuliCheckedException.class.isAssignableFrom(e.getClass())) { return addResumeOnException(((SakuliCheckedException) e), resumeToTestExecution(e)); } if (e instanceof SakuliRuntimeException) { return addResumeOnException(((SakuliRuntimeException) e), resumeToTestExecution(e)); } if (e instanceof RuntimeException) { return addResumeOnException(new SakuliRuntimeException(e), resumeToTestExecution(e)); } return addResumeOnException(new SakuliCheckedException(e), resumeToTestExecution(e)); }  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 { SakuliException transformException(Exception e) { if (!(e instanceof NonScreenshotException) && loader.getActionProperties().isTakeScreenshots()) { try { Path screenshot = loader.getScreenshotActions().takeScreenshotWithTimestampThrowIOException( e.getMessage(), loader.getActionProperties().getScreenShotFolder(), null, null); return addResumeOnException(new SakuliExceptionWithScreenshot(e, screenshot), resumeToTestExecution(e)); } catch (IOException e2) { logger.error("Screenshot could not be created", e2); e.addSuppressed(e2); } } if (SakuliCheckedException.class.isAssignableFrom(e.getClass())) { return addResumeOnException(((SakuliCheckedException) e), resumeToTestExecution(e)); } if (e instanceof SakuliRuntimeException) { return addResumeOnException(((SakuliRuntimeException) e), resumeToTestExecution(e)); } if (e instanceof RuntimeException) { return addResumeOnException(new SakuliRuntimeException(e), resumeToTestExecution(e)); } return addResumeOnException(new SakuliCheckedException(e), resumeToTestExecution(e)); }  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);  }