1 30 package org.jruby.javasupport.test; 31 32 import org.jruby.Ruby; 33 import org.jruby.test.TestRubyBase; 34 35 public class TestNativeException extends TestRubyBase { 36 public TestNativeException(String name) { 37 super(name); 38 } 39 40 public void setUp() { 41 runtime = Ruby.getDefaultInstance(); 42 } 43 44 public void tearDown() { 45 super.tearDown(); 46 } 47 48 public void testCauseIsProxied() throws Exception { 49 String result = eval( 50 "require 'java'\n" + 51 "include_class('java.io.File') { 'JFile' }\n" + 52 "begin\n" + 53 " JFile.new(nil)\n" + 54 "rescue Exception => e\n" + 55 "end\n" + 56 "p e.cause.respond_to?(:print_stack_trace)"); 57 assertEquals("Bug: [ JRUBY-106 ]", "true", result); 58 } 59 } 60 | Popular Tags |