/** * Expects the current evaluation to be killed and not be completed or to produce further * suspended events. Throws an {@link IllegalStateException} if the tester is already closed. If * the evaluation caused any errors besides the kill exception then they are thrown as * {@link AssertionError}. * * @since 0.16 */ public void expectKilled() { Throwable error = expectThrowable(); if (error instanceof PolyglotException) { Assert.assertTrue(error.getMessage(), error.getMessage().contains("KillException")); return; } throw new AssertionError("Expected killed bug got error: " + error, error); }
/** * Expects the current evaluation to be killed and not be completed or to produce further * suspended events. Throws an {@link IllegalStateException} if the tester is already closed. If * the evaluation caused any errors besides the kill exception then they are thrown as * {@link AssertionError}. * * @since 0.16 */ public void expectKilled() { Throwable error = expectThrowable(); if (error instanceof PolyglotException) { Assert.assertTrue(((PolyglotException) error).isCancelled()); Assert.assertTrue(error.getMessage(), error.getMessage().contains("Execution cancelled by a debugging session.")); return; } throw new AssertionError("Expected killed bug got error: " + error, error); }