commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tcu...@apache.org
Subject svn commit: r232884 - in /jakarta/commons/sandbox/jci/trunk/src/test/org/apache/commons/jci: CompilerUtils.java ReloadingClassLoaderTestCase.java
Date Mon, 15 Aug 2005 21:11:16 GMT
Author: tcurdt
Date: Mon Aug 15 14:11:12 2005
New Revision: 232884

URL: http://svn.apache.org/viewcvs?rev=232884&view=rev
Log:
fixed the dependency delete test

Modified:
    jakarta/commons/sandbox/jci/trunk/src/test/org/apache/commons/jci/CompilerUtils.java
    jakarta/commons/sandbox/jci/trunk/src/test/org/apache/commons/jci/ReloadingClassLoaderTestCase.java

Modified: jakarta/commons/sandbox/jci/trunk/src/test/org/apache/commons/jci/CompilerUtils.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/jci/trunk/src/test/org/apache/commons/jci/CompilerUtils.java?rev=232884&r1=232883&r2=232884&view=diff
==============================================================================
--- jakarta/commons/sandbox/jci/trunk/src/test/org/apache/commons/jci/CompilerUtils.java (original)
+++ jakarta/commons/sandbox/jci/trunk/src/test/org/apache/commons/jci/CompilerUtils.java Mon
Aug 15 14:11:12 2005
@@ -25,7 +25,7 @@
                 new ResourceReader() {
                     public char[] getContent( String pFileName ) {
                         for (int i = 0; i < pPrograms.length; i++) {
-                            final String clazzName = pClazzes[i].replace('.', '/') + ".class";
+                            final String clazzName = pClazzes[i].replace('.', '/') + ".java";
                             if (clazzName.equals(pFileName)) {
                                 return pPrograms[i].toCharArray();
                             }

Modified: jakarta/commons/sandbox/jci/trunk/src/test/org/apache/commons/jci/ReloadingClassLoaderTestCase.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/jci/trunk/src/test/org/apache/commons/jci/ReloadingClassLoaderTestCase.java?rev=232884&r1=232883&r2=232884&view=diff
==============================================================================
--- jakarta/commons/sandbox/jci/trunk/src/test/org/apache/commons/jci/ReloadingClassLoaderTestCase.java
(original)
+++ jakarta/commons/sandbox/jci/trunk/src/test/org/apache/commons/jci/ReloadingClassLoaderTestCase.java
Mon Aug 15 14:11:12 2005
@@ -44,7 +44,7 @@
                 );
         assertTrue(clazzSimple.length > 0);
         assertTrue(clazzSIMPLE.length > 0);
-        //assertTrue(clazzExtended.length > 0);
+        assertTrue(clazzExtended.length > 0);
     }
     
     protected void setUp() throws Exception {
@@ -134,33 +134,33 @@
     }
 
     public void testDeleteDependency() throws Exception {        
-//        waitForSignal(reload);
-//
-//        log.debug("creating classes");
-//
-//        delay();        
-//        writeFile("jci/Simple.class", clazzSimple);
-//        writeFile("jci/Extended.class", clazzExtended);
-//        waitForSignal(reload);
-//
-//        final Object simple = cl.loadClass("jci.Simple").newInstance();        
-//        assertTrue("Simple".equals(simple.toString()));
-//        
-//        final Object extended = cl.loadClass("jci.Extended").newInstance();        
-//        assertTrue("Extended:Simple".equals(extended.toString()));
-//
-//        log.debug("deleting class dependency");
-//        
-//        assertTrue(new File(directory, "jci/Simple.class").delete());
-//        
-//        waitForSignal(reload);
-//
-//        try {
-//            cl.loadClass("jci.Extended").newInstance();
-//            fail();
-//        } catch(final NoClassDefFoundError e) {
-//            assertTrue("jci/Simple".equals(e.getMessage()));
-//        }
+        waitForSignal(checkedSignal);
+
+        log.debug("creating classes");
+
+        delay();        
+        writeFile("jci/Simple.class", clazzSimple);
+        writeFile("jci/Extended.class", clazzExtended);
+        waitForSignal(checkedSignal);
+
+        final Object simple = cl.loadClass("jci.Simple").newInstance();        
+        assertTrue("Simple".equals(simple.toString()));
+        
+        final Object extended = cl.loadClass("jci.Extended").newInstance();        
+        assertTrue("Extended:Simple".equals(extended.toString()));
+
+        log.debug("deleting class dependency");
+        
+        assertTrue(new File(directory, "jci/Simple.class").delete());
+        
+        waitForSignal(reloadSignal);
+
+        try {
+            cl.loadClass("jci.Extended").newInstance();
+            fail();
+        } catch(final NoClassDefFoundError e) {
+            assertTrue("jci/Simple".equals(e.getMessage()));
+        }
     }
 
     public void testClassNotFound() {



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message