commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject svn commit: r501606 - in /jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang: ClassUtilsTest.java enum/EnumTest.java enums/EnumTest.java
Date Tue, 30 Jan 2007 22:26:39 GMT
Author: bayard
Date: Tue Jan 30 14:26:38 2007
New Revision: 501606

URL: http://svn.apache.org/viewvc?view=rev&rev=501606
Log:
Applying my fix from LANG-314

Modified:
    jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/ClassUtilsTest.java
    jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/enum/EnumTest.java
    jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/enums/EnumTest.java

Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/ClassUtilsTest.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/ClassUtilsTest.java?view=diff&rev=501606&r1=501605&r2=501606
==============================================================================
--- jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/ClassUtilsTest.java
(original)
+++ jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/ClassUtilsTest.java
Tue Jan 30 14:26:38 2007
@@ -501,30 +501,6 @@
         assertGetClassThrowsException( className, ClassNotFoundException.class );
     }
 
-    /**
-     * Creates a new instance of URLClassLoader with the system class loader's URLs and a
<code>null</code> parent
-     * class loader.
-     * 
-     * @see ClassLoader#getSystemClassLoader()
-     * @see URLClassLoader#newInstance(URL[], ClassLoader)
-     * @return the resulting class loader
-     */
-    public static ClassLoader newSystemClassLoader() throws SecurityException, IllegalArgumentException
{
-        ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader();
-        ClassLoader myClassLoader = ClassUtilsTest.class.getClassLoader();
-        if (!(myClassLoader instanceof URLClassLoader)) {
-            fail("ClassUtilsTest ClassLoader = " + (myClassLoader == null ? null : myClassLoader.getClass().getName()));
-        }
-        if (!(systemClassLoader instanceof URLClassLoader)) {
-            fail("System  ClassLoader = " + (systemClassLoader == null ? null : systemClassLoader.getClass().getName()));
-        }
-        if (!myClassLoader.equals(systemClassLoader)) {
-            fail("ClassUtilsTest= " + myClassLoader + " System=" + systemClassLoader);
-        }
-        URLClassLoader urlScl = (URLClassLoader) myClassLoader;
-        return URLClassLoader.newInstance(urlScl.getURLs(), null);
-    }
-
     // Show the Java bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4071957
     // We may have to delete this if a JDK fixes the bug.
     public void testShowJavaBug() throws Exception {

Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/enum/EnumTest.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/enum/EnumTest.java?view=diff&rev=501606&r1=501605&r2=501606
==============================================================================
--- jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/enum/EnumTest.java
(original)
+++ jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/enum/EnumTest.java
Tue Jan 30 14:26:38 2007
@@ -32,7 +32,6 @@
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
 
-import org.apache.commons.lang.ClassUtilsTest;
 import org.apache.commons.lang.SerializationUtils;
 
 /**
@@ -456,7 +455,11 @@
         assertTrue(colorEnum.equals(colorEnum));
         assertNotNull(ColorEnum.class.getClassLoader());
         // set up:
-        ClassLoader classLoader = ClassUtilsTest.newSystemClassLoader();
+        ClassLoader myClassLoader = EnumTest.class.getClassLoader();
+        if (!(myClassLoader instanceof URLClassLoader)) {
+            fail("EnumTest ClassLoader = " + (myClassLoader == null ? null : myClassLoader.getClass().getName()));
+        }
+        ClassLoader classLoader = URLClassLoader.newInstance( ((URLClassLoader)myClassLoader).getURLs(),
null);
         Object enumObjectFromOtherClassLoader = this.getColorEnum(classLoader, colorEnum.getName());
 
         // the real test, part 1.

Modified: jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/enums/EnumTest.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/enums/EnumTest.java?view=diff&rev=501606&r1=501605&r2=501606
==============================================================================
--- jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/enums/EnumTest.java
(original)
+++ jakarta/commons/proper/lang/trunk/src/test/org/apache/commons/lang/enums/EnumTest.java
Tue Jan 30 14:26:38 2007
@@ -30,7 +30,6 @@
 import junit.framework.Test;
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
-import org.apache.commons.lang.ClassUtilsTest;
 import org.apache.commons.lang.SerializationUtils;
 
 /**
@@ -454,7 +453,11 @@
         assertTrue(colorEnum.equals(colorEnum));
         assertNotNull(ColorEnum.class.getClassLoader());
         // set up:
-        ClassLoader classLoader = ClassUtilsTest.newSystemClassLoader();
+        ClassLoader myClassLoader = EnumTest.class.getClassLoader();
+        if (!(myClassLoader instanceof URLClassLoader)) {
+            fail("EnumTest ClassLoader = " + (myClassLoader == null ? null : myClassLoader.getClass().getName()));
+        }
+        ClassLoader classLoader = URLClassLoader.newInstance( ((URLClassLoader)myClassLoader).getURLs(),
null);
         Object enumObjectFromOtherClassLoader = this.getColorEnum(classLoader, colorEnum.getName());
 
         // the real test, part 1.



---------------------------------------------------------------------
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