cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asold...@apache.org
Subject svn commit: r1076554 - /cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/bus/BusExtensionLoadingTest.java
Date Thu, 03 Mar 2011 08:27:58 GMT
Author: asoldano
Date: Thu Mar  3 08:27:58 2011
New Revision: 1076554

URL: http://svn.apache.org/viewvc?rev=1076554&view=rev
Log:
[CXF-3373] Fixing testcase failure on JDK 1.5

Modified:
    cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/bus/BusExtensionLoadingTest.java

Modified: cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/bus/BusExtensionLoadingTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/bus/BusExtensionLoadingTest.java?rev=1076554&r1=1076553&r2=1076554&view=diff
==============================================================================
--- cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/bus/BusExtensionLoadingTest.java
(original)
+++ cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/bus/BusExtensionLoadingTest.java
Thu Mar  3 08:27:58 2011
@@ -49,7 +49,7 @@ public class BusExtensionLoadingTest ext
     public void testBusConstructionWithoutTCCL() throws Exception {
         ClassLoader origClassLoader = Thread.currentThread().getContextClassLoader();
         try {
-            Thread.currentThread().setContextClassLoader(null);
+            Thread.currentThread().setContextClassLoader(new TestClassLoader());
             BusFactory factory = new CXFBusFactory() {
                 public Bus createBus(Map<Class, Object> e, Map<String, Object>
properties) {
                     return new ExtensionManagerBus(e, properties, this.getClass().getClassLoader());
@@ -101,25 +101,34 @@ public class BusExtensionLoadingTest ext
         @Override
         public Class<?> loadClass(final String className) throws ClassNotFoundException
{
             if (className.contains("cxf")) {
-                throw new ClassNotFoundException("TestClassLoader does not load CXF classes");
+                throw new ClassNotFoundException("TestClassLoader does not load CXF classes:
" +  className);
             } else {
                 return super.loadClass(className);
             }
         }
-
+        
         @Override
         public URL getResource(final String name) {
-            return null;
+            if (name.contains("cxf") || name.contains("bus")) {
+                return null;
+            }
+            return super.getResource(name);
         }
 
         @Override
         public Enumeration<URL> getResources(final String name) throws IOException
{
-            return Collections.enumeration(new ArrayList<URL>());
+            if (name.contains("cxf") || name.contains("bus")) {
+                return Collections.enumeration(new ArrayList<URL>());
+            }
+            return super.getResources(name);
         }
 
         @Override
         public InputStream getResourceAsStream(final String name) {
-            return null;
+            if (name.contains("cxf") || name.contains("bus")) {
+                return null;
+            }
+            return super.getResourceAsStream(name);
         }
     }
 }



Mime
View raw message