Permalink
Browse files

Tests for JRUBY-2630, direct load of a Java .class file.

git-svn-id: http://svn.codehaus.org/jruby/trunk/jruby@7199 961051c9-f516-0410-bf72-c9f7e237a7b7
  • Loading branch information...
headius committed Jul 17, 2008
1 parent 50bad77 commit 60361541655b4729350133c45511d0c04cab1aac
Showing with 20 additions and 0 deletions.
  1. +9 −0 test/org/jruby/test/NormalJavaClass.java
  2. +11 −0 test/org/jruby/test/TestLoadService.java
@@ -0,0 +1,9 @@
+package org.jruby.test;
+
+/**
+ * This is just a normal Java class, used for testing behavior of load/require
+ * when given a Java class file.
+ */
+public class NormalJavaClass {
+
+}
@@ -84,4 +84,15 @@ public void testNonExistentRequireAfterRubyGems() {
assertNull("Require of non-existent library should , exception should only be RaiseException with no root cause", e.getCause());
}
}
+
+ public void testRequireJavaClassFile() {
+ try {
+ // Test that requiring a normal Java class does not raise an error
+ // but does load the class. JRUBY-2630
+ loadService.load("build/classes/test/org/jruby/test/NormalJavaClass.class", false);
+ assertNotNull(runtime.getJRubyClassLoader().loadClass("org.jruby.test.NormalJavaClass"));
+ } catch (Exception e) {
+ fail("Exception when requiring a Java class file: " + e);
+ }
+ }
}

0 comments on commit 6036154

Please sign in to comment.