Package org.jruby.runtime.callback

Source Code of org.jruby.runtime.callback.TestReflectionCallback

package org.jruby.runtime.callback;

import junit.framework.TestCase;

import org.jruby.Ruby;
import org.jruby.exceptions.RaiseException;
import org.jruby.runtime.Arity;
import org.jruby.runtime.builtin.IRubyObject;
import org.jruby.test.MockRubyObject;

public class TestReflectionCallback extends TestCase {

  public void testExecuteWithStaticMethodThrowingException() throws Exception {
    ReflectionCallback callback = new ReflectionCallback(MockRubyObject.class, "throwException",
        new Class[0], false, true, Arity.noArguments(), false);
    try {
      callback.execute(new MockRubyObject(Ruby.newInstance()), new IRubyObject[0], null);
    } catch (RaiseException e) {
      assertEquals(RuntimeException.class, e.getCause().getClass());
    }
   
  }
}
TOP

Related Classes of org.jruby.runtime.callback.TestReflectionCallback

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.