* src/vmcore/loader.c (load_class_from_classbuffer_intern): Also call
[cacao.git] / tests / regression / bugzilla / PR58.java
index 1451226445b31b1974dbc2336cb9591d5c77d3cb..d70281c294ae1fa367c728bdcd70a6eb4a0652f2 100644 (file)
@@ -40,7 +40,7 @@ public class PR58 extends TestCase {
     class x extends y {}
     class y {}
 
-    public void test() {
+    public void testSuperClass() {
         // Delete the class file which is extended.
         new File("PR58$y.class").delete();
 
@@ -56,4 +56,24 @@ public class PR58 extends TestCase {
             assertTrue(success.getCause() instanceof ClassNotFoundException);
         }
     }
+
+    interface i {}
+    class j implements i {}
+
+    public void testSuperInterface() {
+        // Delete the interface file which is implemented.
+        new File("PR58$i.class").delete();
+
+        try {
+            Class.forName("PR58$j");
+            fail("Should throw NoClassDefFoundError");
+        }
+        catch (ClassNotFoundException error) {
+            fail("Unexpected exception: " + error);
+        }
+        catch (NoClassDefFoundError success) {
+            // Check if the cause is correct.
+            assertTrue(success.getCause() instanceof ClassNotFoundException);
+        }
+    }
 }