KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jruby > runtime > callback > TestReflectionCallback


1 package org.jruby.runtime.callback;
2
3 import junit.framework.TestCase;
4
5 import org.jruby.Ruby;
6 import org.jruby.exceptions.RaiseException;
7 import org.jruby.runtime.Arity;
8 import org.jruby.runtime.builtin.IRubyObject;
9 import org.jruby.test.MockRubyObject;
10
11 public class TestReflectionCallback extends TestCase {
12
13     public void testExecuteWithStaticMethodThrowingException() throws Exception JavaDoc {
14         ReflectionCallback callback = new ReflectionCallback(MockRubyObject.class, "throwException",
15                 new Class JavaDoc[0], false, true, Arity.noArguments(), false);
16         try {
17             callback.execute(new MockRubyObject(Ruby.getDefaultInstance()), new IRubyObject[0], null);
18         } catch (RaiseException e) {
19             assertEquals(RuntimeException JavaDoc.class, e.getCause().getClass());
20         }
21         
22     }
23 }
24
Popular Tags