public void testInvokerException() throws Throwable { try { throw new GroovyRuntimeException("message", new NullPointerException()); } catch (GroovyRuntimeException e) { // worked assertEquals("message", e.getMessage()); assertTrue(e.getCause() instanceof NullPointerException); } }