KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jruby > javasupport > TestJavaClass


1 package org.jruby.javasupport;
2
3 import junit.framework.TestCase;
4
5 import org.jruby.Ruby;
6
7
8 public class TestJavaClass extends TestCase {
9
10     public void test() {
11         Ruby runtime = Ruby.getDefaultInstance();
12         // This is now needed, since module Java
13
// isn't in by default
14
runtime.getModule("Kernel").callMethod(runtime.getCurrentContext(),"require",runtime.newSymbol("java"));
15         JavaClass javaClass = JavaClass.get(runtime, String JavaDoc.class);
16         assertSame(javaClass, JavaClass.get(runtime, String JavaDoc.class));
17     }
18 }
19
Popular Tags