You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by as...@apache.org on 2011/03/03 09:32:23 UTC

svn commit: r1076555 - in /cxf/branches/2.3.x-fixes: ./ systests/uncategorized/src/test/java/org/apache/cxf/systest/bus/BusExtensionLoadingTest.java

Author: asoldano
Date: Thu Mar  3 08:32:22 2011
New Revision: 1076555

URL: http://svn.apache.org/viewvc?rev=1076555&view=rev
Log:
Merged revisions 1076554 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1076554 | asoldano | 2011-03-03 09:27:58 +0100 (Thu, 03 Mar 2011) | 2 lines
  
  [CXF-3373] Fixing testcase failure on JDK 1.5
........

Modified:
    cxf/branches/2.3.x-fixes/   (props changed)
    cxf/branches/2.3.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/bus/BusExtensionLoadingTest.java

Propchange: cxf/branches/2.3.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Mar  3 08:32:22 2011
@@ -1 +1 @@
-/cxf/trunk:1076052,1076141-1076156,1076196,1076246
+/cxf/trunk:1076052,1076141-1076156,1076196,1076246,1076554

Propchange: cxf/branches/2.3.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.3.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/bus/BusExtensionLoadingTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/bus/BusExtensionLoadingTest.java?rev=1076555&r1=1076554&r2=1076555&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/bus/BusExtensionLoadingTest.java (original)
+++ cxf/branches/2.3.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/bus/BusExtensionLoadingTest.java Thu Mar  3 08:32:22 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);
         }
     }
 }