cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andreasm...@apache.org
Subject svn commit: r450102 - in /incubator/cxf/trunk/rt: core/src/main/java/org/apache/cxf/bus/cxf/CXFBusImpl.java frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ConfiguredEndpointTest.java
Date Tue, 26 Sep 2006 16:13:32 GMT
Author: andreasmyth
Date: Tue Sep 26 09:13:31 2006
New Revision: 450102

URL: http://svn.apache.org/viewvc?view=rev&rev=450102
Log:
Improved the test included in r450092 to use properties passed to bus instead of system properties.


Modified:
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/cxf/CXFBusImpl.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ConfiguredEndpointTest.java

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/cxf/CXFBusImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/cxf/CXFBusImpl.java?view=diff&rev=450102&r1=450101&r2=450102
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/cxf/CXFBusImpl.java (original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/cxf/CXFBusImpl.java Tue Sep
26 09:13:31 2006
@@ -60,6 +60,12 @@
     protected CXFBusImpl(Map<Class, Object> e, Map<String, Object> properties)
{
         
         extensions = e;
+        if (null == extensions) {
+            extensions = new HashMap<Class, Object>();
+        }
+        if (null == properties) {
+            properties = new HashMap<String, Object>();
+        }
         
         Configurer configurer = (Configurer)extensions.get(Configurer.class);
         if (null == configurer) {

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ConfiguredEndpointTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ConfiguredEndpointTest.java?view=diff&rev=450102&r1=450101&r2=450102
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ConfiguredEndpointTest.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ConfiguredEndpointTest.java
Tue Sep 26 09:13:31 2006
@@ -20,14 +20,15 @@
 package org.apache.cxf.jaxws;
 
 import java.lang.reflect.Proxy;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 import javax.xml.namespace.QName;
 
 import junit.framework.TestCase;
 
 import org.apache.cxf.Bus;
-import org.apache.cxf.BusFactory;
 import org.apache.cxf.bus.cxf.CXFBusFactory;
 import org.apache.cxf.configuration.Configurer;
 import org.apache.cxf.endpoint.Client;
@@ -46,7 +47,7 @@
     private static final QName PORT_NAME = 
         new QName("http://apache.org/hello_world_soap_http", "SoapPort");
 
-    private BusFactory factory;
+    private CXFBusFactory factory;
     
     public void setUp() {
         factory = new CXFBusFactory();
@@ -58,17 +59,16 @@
     }
     
     public void tearDown() {
-        System.clearProperty(Configurer.USER_CFG_FILE_PROPERTY_NAME);
         Bus bus = factory.getDefaultBus();
         if (null != bus) {
             bus.shutdown(true);
             factory.setDefaultBus(null);
         }
     }
-    
-    
-    
-    public void testDefaultClientEndpoint() {
+     
+    public void testDefaultClientEndpoint() {        
+        factory.setDefaultBus(factory.createBus());
+        
         javax.xml.ws.Service service = new SOAPService();
         Greeter greeter = service.getPort(PORT_NAME, Greeter.class);
         
@@ -101,8 +101,10 @@
     
     @SuppressWarnings("unchecked")
     public void testConfiguredClientEndpoint() {
-        System.setProperty(Configurer.USER_CFG_FILE_PROPERTY_NAME, 
-            "org/apache/cxf/jaxws/configured-endpoints.xml");
+        Map<String, Object> properties = new HashMap<String, Object>();
+        properties.put(Configurer.USER_CFG_FILE_PROPERTY_NAME, 
+                       "org/apache/cxf/jaxws/configured-endpoints.xml");
+        factory.setDefaultBus(factory.createBus(null, properties));
         
         javax.xml.ws.Service service = new SOAPService();
         Greeter greeter = service.getPort(PORT_NAME, Greeter.class);
@@ -150,6 +152,7 @@
     }
     
     public void testDefaultServerEndpoint() {
+        factory.setDefaultBus(factory.createBus());
         
         Object implementor = new GreeterImpl(); 
         EndpointImpl ei = (EndpointImpl)(javax.xml.ws.Endpoint.create(implementor));
@@ -181,8 +184,10 @@
     
     @SuppressWarnings("unchecked")
     public void testConfiguredServerEndpoint() {
-        System.setProperty(Configurer.USER_CFG_FILE_PROPERTY_NAME, 
-            "org/apache/cxf/jaxws/configured-endpoints.xml");
+        Map<String, Object> properties = new HashMap<String, Object>();
+        properties.put(Configurer.USER_CFG_FILE_PROPERTY_NAME, 
+                       "org/apache/cxf/jaxws/configured-endpoints.xml");
+        factory.setDefaultBus(factory.createBus(null, properties));
         
         Object implementor = new GreeterImpl(); 
         EndpointImpl ei = (EndpointImpl)(javax.xml.ws.Endpoint.create(implementor));



Mime
View raw message