@Test public void testHandleTeardownExceptionSequential() { testling.tearDown(Optional.of(testsuite)); verify(exceptionHandler).handleException(any(SakuliRuntimeException.class)); verify(testling, never()).addTestRef(any(), any()); List<Exception> resumeExceptions = (List<Exception>) ReflectionTestUtils.getField(exceptionHandler, "resumeExceptions"); assertTrue(resumeExceptions.stream().noneMatch(e -> e.getClass().isAssignableFrom(SakuliRuntimeException.class))); assertEquals(testsuite.getException().getClass(), SakuliRuntimeException.class); assertRegExMatch(testsuite.getException().toString(), "Method 'teardownTestSuite' is not implemented for forwarder class.*"); }
Exception addTestRef(@NonNull Exception e, @NonNull AbstractTestDataEntity testDataRef) { if (!(e instanceof SakuliException)) { e = new SakuliCheckedException(e); } ((SakuliException) e).setAsyncTestDataRef(testDataRef); return e; }
AbstractTeardownService implements TeardownService { Exception addTestRef(@NonNull Exception e, @NonNull AbstractTestDataEntity testDataRef) { if (!(e instanceof SakuliException)) { e = new SakuliCheckedException(e); } ((SakuliException) e).setAsyncTestDataRef(testDataRef); return e; } }
AbstractTeardownService implements TeardownService { Exception addTestRef(@NonNull Exception e, @NonNull AbstractTestDataEntity testDataRef) { if (!(e instanceof SakuliException)) { e = new SakuliCheckedException(e); } ((SakuliException) e).setAsyncTestDataRef(testDataRef); return e; }  }
AbstractTeardownService implements TeardownService { Exception addTestRef(@NonNull Exception e, @NonNull AbstractTestDataEntity testDataRef) { if (!(e instanceof SakuliException)) { e = new SakuliCheckedException(e); } ((SakuliException) e).setAsyncTestDataRef(testDataRef); return e; }  @Override void handleTeardownException(@NonNull Exception e, boolean async, @NonNull AbstractTestDataEntity testDataRef); @Override void teardownTestCase(@NonNull TestCase testCase); @Override void teardownTestCaseStep(@NonNull TestCaseStep testCaseStep); }
AbstractTeardownService implements TeardownService { Exception addTestRef(@NonNull Exception e, @NonNull AbstractTestDataEntity testDataRef) { if (!(e instanceof SakuliException)) { e = new SakuliCheckedException(e); } ((SakuliException) e).setAsyncTestDataRef(testDataRef); return e; }  @Override void handleTeardownException(@NonNull Exception e, boolean async, @NonNull AbstractTestDataEntity testDataRef); @Override void teardownTestCase(@NonNull TestCase testCase); @Override void teardownTestCaseStep(@NonNull TestCaseStep testCaseStep);  }