cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andreasm...@apache.org
Subject svn commit: r449621 - in /incubator/cxf/trunk/rt/core/src: main/java/org/apache/cxf/bus/spring/SpringBusFactory.java main/java/org/apache/cxf/bus/spring/SpringBusImpl.java test/java/org/apache/cxf/bus/spring/SpringBusFactoryTest.java
Date Mon, 25 Sep 2006 09:21:44 GMT
Author: andreasmyth
Date: Mon Sep 25 02:21:42 2006
New Revision: 449621

URL: http://svn.apache.org/viewvc?view=rev&rev=449621
Log:
Fixed spring based bus implementation and re-enabled test disabled in r448994.

Modified:
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBusFactory.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBusImpl.java
    incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/bus/spring/SpringBusFactoryTest.java

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBusFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBusFactory.java?view=diff&rev=449621&r1=449620&r2=449621
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBusFactory.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBusFactory.java
Mon Sep 25 02:21:42 2006
@@ -71,19 +71,6 @@
         
         List<String> cfgFileLocations = new ArrayList<String>();
         
-        if (null == cfgFile) {
-            cfgFile = System.getProperty(Configurer.USER_CFG_FILE_PROPERTY_NAME);
-        }
-        if (null == cfgFile) {
-            cfgFile = Configurer.DEFAULT_USER_CFG_FILE;
-        }
-        ClassPathResource cpr = new ClassPathResource(cfgFile);
-        if (cpr.exists()) {
-            cfgFileLocations.add(cfgFile);
-        } else {
-            LOG.log(Level.INFO, new Message("USER_CFG_FILE_NOT_FOUND_MSG", LOG, cfgFile).toString());
-        }
-        
         if (includeDefaults) {
             try {
                 Enumeration<URL> resources = Thread.currentThread().getContextClassLoader()
@@ -101,13 +88,24 @@
             }  
         }
         
+        if (null == cfgFile) {
+            cfgFile = System.getProperty(Configurer.USER_CFG_FILE_PROPERTY_NAME);
+        }
+        if (null == cfgFile) {
+            cfgFile = Configurer.DEFAULT_USER_CFG_FILE;
+        }
+        ClassPathResource cpr = new ClassPathResource(cfgFile);
+        if (cpr.exists()) {
+            cfgFileLocations.add(cfgFile);
+        } else {
+            LOG.log(Level.INFO, new Message("USER_CFG_FILE_NOT_FOUND_MSG", LOG, cfgFile).toString());
+        }
         
-        
-        String[] locations = new String[cfgFileLocations.size()];
-        locations = cfgFileLocations.toArray(locations);
         if (LOG.isLoggable(Level.FINE)) {
-            LOG.fine("Creating application context with cfg files: " + locations);
+            LOG.fine("Creating application context with cfg files: " + cfgFileLocations);
         }
+        String[] locations = new String[cfgFileLocations.size()];
+        locations = cfgFileLocations.toArray(locations);
         
         ApplicationContext ac = null;
         try {      

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBusImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBusImpl.java?view=diff&rev=449621&r1=449620&r2=449621
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBusImpl.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBusImpl.java
Mon Sep 25 02:21:42 2006
@@ -20,13 +20,11 @@
 package org.apache.cxf.bus.spring;
 
 import java.util.HashMap;
-import java.util.List;
 import java.util.Map;
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.bus.BusState;
 import org.apache.cxf.interceptor.AbstractBasicInterceptorProvider;
-import org.apache.cxf.interceptor.Interceptor;
 
 public class SpringBusImpl extends AbstractBasicInterceptorProvider implements Bus {
     
@@ -46,26 +44,6 @@
     
     public void setId(String i) {
         id = i;
-    }
-
-    public List<Interceptor> getInFaultInterceptors() {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    public List<Interceptor> getInInterceptors() {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    public List<Interceptor> getOutFaultInterceptors() {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    public List<Interceptor> getOutInterceptors() {
-        // TODO Auto-generated method stub
-        return null;
     }
 
     public final <T> T getExtension(Class<T> extensionType) {

Modified: incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/bus/spring/SpringBusFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/bus/spring/SpringBusFactoryTest.java?view=diff&rev=449621&r1=449620&r2=449621
==============================================================================
--- incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/bus/spring/SpringBusFactoryTest.java
(original)
+++ incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/bus/spring/SpringBusFactoryTest.java
Mon Sep 25 02:21:42 2006
@@ -45,21 +45,21 @@
             // expected
         }
         
-        assertNull("Unexpected interceptors", bus.getInInterceptors());
-        assertNull("Unexpected interceptors", bus.getInFaultInterceptors());
-        assertNull("Unexpected interceptors", bus.getOutInterceptors());
-        assertNull("Unexpected interceptors", bus.getOutFaultInterceptors());
+        assertEquals("Unexpected interceptors", 0, bus.getInInterceptors().size());
+        assertEquals("Unexpected interceptors", 0, bus.getInFaultInterceptors().size());
+        assertEquals("Unexpected interceptors", 0, bus.getOutInterceptors().size());
+        assertEquals("Unexpected interceptors", 0, bus.getOutFaultInterceptors().size());
         
     }
     
-    public void xtestCustom() {
+    public void testCustom() {
         String cfgFile = "org/apache/cxf/bus/spring/resources/bus-overwrite.xml";
         Bus bus = new SpringBusFactory().createBus(cfgFile, true);
         assertNotNull(bus);
         List<Interceptor> interceptors = bus.getInInterceptors();
         assertEquals("Unexpected number of interceptors", 2, interceptors.size());
         assertEquals("Unexpected interceptor", "in-a", interceptors.get(0).toString());
-        assertEquals("Unexpected interceptor", "in-b", interceptors.get(0).toString());
+        assertEquals("Unexpected interceptor", "in-b", interceptors.get(1).toString());
         interceptors = bus.getInFaultInterceptors();
         assertEquals("Unexpected number of interceptors", 1, interceptors.size());
         assertEquals("Unexpected interceptor", "in-fault", interceptors.get(0).toString());



Mime
View raw message