Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.7.7
-
None
-
None
Description
GroovyLib.groovy:
class GroovyLib { void boom() throws IOException { throw new IOException() } void undeclaredBoom() { throw new IOException() } Closure closure = { throw new IOException() } Runnable runnable = { throw new IOException() } }
GroovyJavaExceptionPropagationTest.java:
public class GroovyJavaExceptionPropagationTest { @Test(expected = IOException.class) public void callGroovyMethodThatThrowsDeclaredCheckedException() throws Exception { new GroovyLib().boom(); // throws IOException } @Test(expected = IOException.class) public void callGroovyMethodThatThrowsUndeclaredCheckedException() throws Exception { new GroovyLib().undeclaredBoom(); // throws IOException } @Test(expected = IOException.class) public void callGroovyClosureThatThrowsCheckedException() throws Exception { new GroovyLib().getClosure().call(); // throws InvokerInvocationException } @Test(expected = IOException.class) public void callGroovyClosureDisguisedAsRunnableThatThrowsCheckedException() throws Exception { new GroovyLib().getRunnable().run(); // throws InvokerInvocationException } }