cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r525092 - in /incubator/cxf/trunk/rt/core/src: main/java/org/apache/cxf/bus/CXFBusImpl.java main/java/org/apache/cxf/bus/extension/ExtensionManagerBus.java test/java/org/apache/cxf/bus/CXFBusImplTest.java
Date Tue, 03 Apr 2007 08:50:55 GMT
Author: ningjiang
Date: Tue Apr  3 01:50:54 2007
New Revision: 525092

URL: http://svn.apache.org/viewvc?view=rev&rev=525092
Log:
CXFBusImpl will return the DEFAULT_BUSID if the busId is null

Modified:
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerBus.java
    incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/bus/CXFBusImplTest.java

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java?view=diff&rev=525092&r1=525091&r2=525092
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java Tue Apr 
3 01:50:54 2007
@@ -27,8 +27,8 @@
 import org.apache.cxf.buslifecycle.BusLifeCycleManager;
 import org.apache.cxf.interceptor.AbstractBasicInterceptorProvider;
 
-public class CXFBusImpl extends AbstractBasicInterceptorProvider implements Bus {
-    
+public class CXFBusImpl extends AbstractBasicInterceptorProvider implements Bus {    
+    protected static final String DEFAULT_BUS_ID = "cxf";
     private Map<Class, Object> extensions;
     private BusLifeCycleManager lifeCycleManager;
     private String id;
@@ -78,7 +78,7 @@
     }
      
     public String getId() {
-        return id;
+        return null == id ? DEFAULT_BUS_ID : id;
     }
 
     public void run() {

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerBus.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerBus.java?view=diff&rev=525092&r1=525091&r2=525092
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerBus.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerBus.java
Tue Apr  3 01:50:54 2007
@@ -52,7 +52,7 @@
     
     public static final String BUS_PROPERTY_NAME = "bus";
     private static final String BUS_ID_PROPERTY_NAME = "org.apache.cxf.bus.id";
-    private static final String DEFAULT_BUS_ID = "cxf";
+    
     
     private static final String BUS_EXTENSION_RESOURCE = "META-INF/bus-extensions.xml";
 

Modified: incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/bus/CXFBusImplTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/bus/CXFBusImplTest.java?view=diff&rev=525092&r1=525091&r2=525092
==============================================================================
--- incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/bus/CXFBusImplTest.java (original)
+++ incubator/cxf/trunk/rt/core/src/test/java/org/apache/cxf/bus/CXFBusImplTest.java Tue Apr
 3 01:50:54 2007
@@ -92,6 +92,14 @@
         assertSame(extension, bus.getExtension(String.class));
     }
     
+    public void testBusID() {
+        CXFBusImpl bus = new CXFBusImpl();
+        String id = bus.getId();
+        assertEquals("The bus id should be cxf", id, CXFBusImpl.DEFAULT_BUS_ID);
+        bus.setId("test");
+        assertEquals("The bus id should be changed", bus.getId(), "test");
+    }
+    
     public void testRun() {
         final CXFBusImpl bus = new CXFBusImpl();
         Thread t = new Thread() {



Mime
View raw message