cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1565804 - in /cxf/trunk/rt: bindings/corba/src/test/java/org/apache/cxf/binding/corba/ bindings/xml/src/test/java/org/apache/cxf/binding/xml/interceptor/ databinding/jaxb/src/test/java/org/apache/cxf/jaxb/ ws/policy/src/test/java/org/apach...
Date Fri, 07 Feb 2014 20:39:41 GMT
Author: dkulp
Date: Fri Feb  7 20:39:41 2014
New Revision: 1565804

URL: http://svn.apache.org/r1565804
Log:
Remove the getDefinition(URL) call on WSDLManager... only used in tests.

Removed:
    cxf/trunk/rt/wsdl/src/main/java/org/apache/cxf/wsdl/WSDLServiceFactory.java
    cxf/trunk/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/WSDLServiceFactoryImpl.java
Modified:
    cxf/trunk/rt/bindings/corba/src/test/java/org/apache/cxf/binding/corba/CorbaBindingFactoryTest.java
    cxf/trunk/rt/bindings/corba/src/test/java/org/apache/cxf/binding/corba/CorbaConduitTest.java
    cxf/trunk/rt/bindings/corba/src/test/java/org/apache/cxf/binding/corba/CorbaServerConduitTest.java
    cxf/trunk/rt/bindings/corba/src/test/java/org/apache/cxf/binding/corba/TestUtils.java
    cxf/trunk/rt/bindings/xml/src/test/java/org/apache/cxf/binding/xml/interceptor/TestBase.java
    cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/BareInInterceptorTest.java
    cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/DocLiteralInInterceptorTest.java
    cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/TestBase.java
    cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProviderTest.java
    cxf/trunk/rt/wsdl/src/main/java/org/apache/cxf/wsdl/WSDLManager.java
    cxf/trunk/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/WSDLManagerImpl.java
    cxf/trunk/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/WSDLServiceFactory.java
    cxf/trunk/rt/wsdl/src/main/resources/META-INF/cxf/bus-extensions.txt

Modified: cxf/trunk/rt/bindings/corba/src/test/java/org/apache/cxf/binding/corba/CorbaBindingFactoryTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/corba/src/test/java/org/apache/cxf/binding/corba/CorbaBindingFactoryTest.java?rev=1565804&r1=1565803&r2=1565804&view=diff
==============================================================================
--- cxf/trunk/rt/bindings/corba/src/test/java/org/apache/cxf/binding/corba/CorbaBindingFactoryTest.java
(original)
+++ cxf/trunk/rt/bindings/corba/src/test/java/org/apache/cxf/binding/corba/CorbaBindingFactoryTest.java
Fri Feb  7 20:39:41 2014
@@ -74,7 +74,7 @@ public class CorbaBindingFactoryTest ext
     protected void setupServiceInfo(String ns, String wsdl, String serviceName, String portName)
{        
         URL wsdlUrl = getClass().getResource(wsdl);
         assertNotNull(wsdlUrl);
-        WSDLServiceFactory f = new WSDLServiceFactory(bus, wsdlUrl, new QName(ns, serviceName));
+        WSDLServiceFactory f = new WSDLServiceFactory(bus, wsdlUrl.toString(), new QName(ns,
serviceName));
 
         Service service = f.create();        
         endpointInfo = service.getEndpointInfo(new QName(ns, portName));

Modified: cxf/trunk/rt/bindings/corba/src/test/java/org/apache/cxf/binding/corba/CorbaConduitTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/corba/src/test/java/org/apache/cxf/binding/corba/CorbaConduitTest.java?rev=1565804&r1=1565803&r2=1565804&view=diff
==============================================================================
--- cxf/trunk/rt/bindings/corba/src/test/java/org/apache/cxf/binding/corba/CorbaConduitTest.java
(original)
+++ cxf/trunk/rt/bindings/corba/src/test/java/org/apache/cxf/binding/corba/CorbaConduitTest.java
Fri Feb  7 20:39:41 2014
@@ -409,7 +409,7 @@ public class CorbaConduitTest extends As
     protected void setupServiceInfo(String ns, String wsdl, String serviceName, String portName)
{        
         URL wsdlUrl = getClass().getResource(wsdl);
         assertNotNull(wsdlUrl);
-        WSDLServiceFactory f = new WSDLServiceFactory(bus, wsdlUrl, new QName(ns, serviceName));
+        WSDLServiceFactory f = new WSDLServiceFactory(bus, wsdlUrl.toString(), new QName(ns,
serviceName));
 
         Service service = f.create();        
         endpointInfo = service.getEndpointInfo(new QName(ns, portName));

Modified: cxf/trunk/rt/bindings/corba/src/test/java/org/apache/cxf/binding/corba/CorbaServerConduitTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/corba/src/test/java/org/apache/cxf/binding/corba/CorbaServerConduitTest.java?rev=1565804&r1=1565803&r2=1565804&view=diff
==============================================================================
--- cxf/trunk/rt/bindings/corba/src/test/java/org/apache/cxf/binding/corba/CorbaServerConduitTest.java
(original)
+++ cxf/trunk/rt/bindings/corba/src/test/java/org/apache/cxf/binding/corba/CorbaServerConduitTest.java
Fri Feb  7 20:39:41 2014
@@ -320,7 +320,7 @@ public class CorbaServerConduitTest exte
     protected void setupServiceInfo(String ns, String wsdl, String serviceName, String portName)
{        
         URL wsdlUrl = getClass().getResource(wsdl);
         assertNotNull(wsdlUrl);
-        WSDLServiceFactory f = new WSDLServiceFactory(bus, wsdlUrl, new QName(ns, serviceName));
+        WSDLServiceFactory f = new WSDLServiceFactory(bus, wsdlUrl.toString(), new QName(ns,
serviceName));
 
         Service service = f.create();        
         endpointInfo = service.getEndpointInfo(new QName(ns, portName));

Modified: cxf/trunk/rt/bindings/corba/src/test/java/org/apache/cxf/binding/corba/TestUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/corba/src/test/java/org/apache/cxf/binding/corba/TestUtils.java?rev=1565804&r1=1565803&r2=1565804&view=diff
==============================================================================
--- cxf/trunk/rt/bindings/corba/src/test/java/org/apache/cxf/binding/corba/TestUtils.java
(original)
+++ cxf/trunk/rt/bindings/corba/src/test/java/org/apache/cxf/binding/corba/TestUtils.java
Fri Feb  7 20:39:41 2014
@@ -50,7 +50,7 @@ public class TestUtils { 
     public EndpointInfo setupServiceInfo(String ns, String wsdl,
                                          String serviceName, String portName) throws Exception
{      
         URL wsdlUrl = getClass().getResource(wsdl);
-        WSDLServiceFactory f = new WSDLServiceFactory(bus, wsdlUrl,
+        WSDLServiceFactory f = new WSDLServiceFactory(bus, wsdlUrl.toString(),
                                                       new QName(ns, serviceName));
 
         Service service = f.create();

Modified: cxf/trunk/rt/bindings/xml/src/test/java/org/apache/cxf/binding/xml/interceptor/TestBase.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/xml/src/test/java/org/apache/cxf/binding/xml/interceptor/TestBase.java?rev=1565804&r1=1565803&r2=1565804&view=diff
==============================================================================
--- cxf/trunk/rt/bindings/xml/src/test/java/org/apache/cxf/binding/xml/interceptor/TestBase.java
(original)
+++ cxf/trunk/rt/bindings/xml/src/test/java/org/apache/cxf/binding/xml/interceptor/TestBase.java
Fri Feb  7 20:39:41 2014
@@ -132,7 +132,7 @@ public class TestBase extends Assert {
         assertNotNull(bus.getExtension(WSDLManager.class));
         
         WSDLServiceFactory factory = 
-            new WSDLServiceFactory(bus, getClass().getResource(wsdl),
+            new WSDLServiceFactory(bus, getClass().getResource(wsdl).toString(),
                                    new QName(portName.getNamespaceURI(), "XMLService"));
 
         org.apache.cxf.service.Service service = factory.create();

Modified: cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/BareInInterceptorTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/BareInInterceptorTest.java?rev=1565804&r1=1565803&r2=1565804&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/BareInInterceptorTest.java
(original)
+++ cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/BareInInterceptorTest.java
Fri Feb  7 20:39:41 2014
@@ -190,7 +190,7 @@ public class BareInInterceptorTest exten
     private void setUpUsingHelloWorld() throws Exception {
         String ns = "http://apache.org/hello_world_soap_http";
         WSDLServiceFactory factory = new WSDLServiceFactory(bus, getClass()
-            .getResource("/wsdl/jaxb/hello_world.wsdl"),
+            .getResource("/wsdl/jaxb/hello_world.wsdl").toString(),
                                                             new QName(ns, "SOAPService"));
 
         service = factory.create();
@@ -220,7 +220,7 @@ public class BareInInterceptorTest exten
     private void setUpUsingDocLit() throws Exception {
         String ns = "http://apache.org/hello_world_doc_lit_bare";
         WSDLServiceFactory factory = new WSDLServiceFactory(bus, getClass()
-            .getResource("/wsdl/jaxb/doc_lit_bare.wsdl"),
+            .getResource("/wsdl/jaxb/doc_lit_bare.wsdl").toString(),
                                                             new QName(ns, "SOAPService"));
 
         service = factory.create();

Modified: cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/DocLiteralInInterceptorTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/DocLiteralInInterceptorTest.java?rev=1565804&r1=1565803&r2=1565804&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/DocLiteralInInterceptorTest.java
(original)
+++ cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/DocLiteralInInterceptorTest.java
Fri Feb  7 20:39:41 2014
@@ -173,7 +173,7 @@ public class DocLiteralInInterceptorTest
     private void setUpUsingHelloWorld() throws Exception {
         String ns = "http://apache.org/hello_world_soap_http";
         WSDLServiceFactory factory = new WSDLServiceFactory(bus, getClass()
-            .getResource("/wsdl/jaxb/hello_world.wsdl"), new QName(ns, "SOAPService"));
+            .getResource("/wsdl/jaxb/hello_world.wsdl").toString(), new QName(ns, "SOAPService"));
 
         service = factory.create();
         endpointInfo = service.getEndpointInfo(new QName(ns, "SoapPort"));
@@ -198,7 +198,7 @@ public class DocLiteralInInterceptorTest
     private void setUpUsingDocLit() throws Exception {
         String ns = "http://apache.org/hello_world_doc_lit_bare";
         WSDLServiceFactory factory = new WSDLServiceFactory(bus, getClass()
-            .getResource("/wsdl/jaxb/doc_lit_bare.wsdl"), new QName(ns, "SOAPService"));
+            .getResource("/wsdl/jaxb/doc_lit_bare.wsdl").toString(), new QName(ns, "SOAPService"));
 
         service = factory.create();
         endpointInfo = service.getEndpointInfo(new QName(ns, "SoapPort"));

Modified: cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/TestBase.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/TestBase.java?rev=1565804&r1=1565803&r2=1565804&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/TestBase.java (original)
+++ cxf/trunk/rt/databinding/jaxb/src/test/java/org/apache/cxf/jaxb/TestBase.java Fri Feb
 7 20:39:41 2014
@@ -91,7 +91,7 @@ public class TestBase extends Assert {
 
         String ns = "http://apache.org/hello_world_soap_http";
         WSDLServiceFactory factory = new WSDLServiceFactory(bus, getClass()
-            .getResource("/org/apache/cxf/jaxb/resources/wsdl/hello_world.wsdl"),
+            .getResource("/org/apache/cxf/jaxb/resources/wsdl/hello_world.wsdl").toString(),
                                                             new QName(ns, "SOAPService"));
 
         service = factory.create();

Modified: cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProviderTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProviderTest.java?rev=1565804&r1=1565803&r2=1565804&view=diff
==============================================================================
--- cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProviderTest.java
(original)
+++ cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/attachment/wsdl11/Wsdl11AttachmentPolicyProviderTest.java
Fri Feb  7 20:39:41 2014
@@ -95,7 +95,7 @@ public class Wsdl11AttachmentPolicyProvi
             String resourceName = "/attachment/wsdl11/test" + i + ".wsdl";
             URL url = Wsdl11AttachmentPolicyProviderTest.class.getResource(resourceName);
      
             try {
-                services[i] = builder.buildServices(manager.getDefinition(url)).get(0);
+                services[i] = builder.buildServices(manager.getDefinition(url.toString())).get(0);
             } catch (WSDLException ex) {
                 ex.printStackTrace();
                 fail("Failed to build service from resource " + resourceName);

Modified: cxf/trunk/rt/wsdl/src/main/java/org/apache/cxf/wsdl/WSDLManager.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/wsdl/src/main/java/org/apache/cxf/wsdl/WSDLManager.java?rev=1565804&r1=1565803&r2=1565804&view=diff
==============================================================================
--- cxf/trunk/rt/wsdl/src/main/java/org/apache/cxf/wsdl/WSDLManager.java (original)
+++ cxf/trunk/rt/wsdl/src/main/java/org/apache/cxf/wsdl/WSDLManager.java Fri Feb  7 20:39:41
2014
@@ -19,7 +19,6 @@
 
 package org.apache.cxf.wsdl;
 
-import java.net.URL;
 import java.util.Map;
 
 import javax.wsdl.Definition;
@@ -49,16 +48,6 @@ public interface WSDLManager {
      * @return the WSDLFactory
      */
     WSDLFactory getWSDLFactory();
-    
-
-    /**
-     * Get the WSDL definition for the given URL.  Implementations
-     * may return a copy from a local cache or load a new copy 
-     * from the URL.
-     * @param url - the location of the WSDL to load 
-     * @return the wsdl definition
-     */
-    Definition getDefinition(URL url) throws WSDLException; 
 
     /**
      * Get the WSDL definition for the given URL.  Implementations

Modified: cxf/trunk/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/WSDLManagerImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/WSDLManagerImpl.java?rev=1565804&r1=1565803&r2=1565804&view=diff
==============================================================================
--- cxf/trunk/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/WSDLManagerImpl.java (original)
+++ cxf/trunk/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/WSDLManagerImpl.java Fri Feb  7
20:39:41 2014
@@ -19,7 +19,6 @@
 
 package org.apache.cxf.wsdl11;
 
-import java.net.URL;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
@@ -146,37 +145,6 @@ public class WSDLManagerImpl implements 
     /*
      * (non-Javadoc)
      * 
-     * @see org.apache.cxf.wsdl.WSDLManager#getDefinition(java.net.URL)
-     */
-    public Definition getDefinition(URL url) throws WSDLException { 
-        String urlString = url.toString();
-        synchronized (definitionsMap) {
-            //This needs to use the exact URL object for the cache
-            //as the urlString object is not held onto strongly
-            //and thus, could cause the definition to be garbage
-            //collected.
-            if (definitionsMap.containsKey(url)) {
-                return definitionsMap.get(url);
-            }
-            if (definitionsMap.containsKey(urlString)) {
-                return definitionsMap.get(urlString);
-            }
-        }
-        Definition def = loadDefinition(urlString);
-        synchronized (definitionsMap) {
-            //see note about about the url
-            //The loadDefinition call will add it with the
-            //string form, we just need to add it with the 
-            //url form (which Sonar will complain about,
-            //but we need to do it)
-            definitionsMap.put(url, def);
-        }
-        return def;
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
      * @see org.apache.cxf.wsdl.WSDLManager#getDefinition(java.lang.String)
      */
     public Definition getDefinition(String url) throws WSDLException {

Modified: cxf/trunk/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/WSDLServiceFactory.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/WSDLServiceFactory.java?rev=1565804&r1=1565803&r2=1565804&view=diff
==============================================================================
--- cxf/trunk/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/WSDLServiceFactory.java (original)
+++ cxf/trunk/rt/wsdl/src/main/java/org/apache/cxf/wsdl11/WSDLServiceFactory.java Fri Feb
 7 20:39:41 2014
@@ -19,7 +19,6 @@
 
 package org.apache.cxf.wsdl11;
 
-import java.net.URL;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
@@ -49,7 +48,8 @@ public class WSDLServiceFactory extends 
 
     private static final Logger LOG = LogUtils.getL7dLogger(WSDLServiceFactory.class);
 
-    private URL wsdlUrl;
+    protected final String wsdlUrl;
+    
     private QName serviceName;
     private QName endpointName;
     private Definition definition;
@@ -58,6 +58,7 @@ public class WSDLServiceFactory extends 
     public WSDLServiceFactory(Bus b, Definition d) {
         setBus(b);
         definition = d;
+        wsdlUrl = d.getDocumentBaseURI();
     }
 
     public WSDLServiceFactory(Bus b, Definition d, QName sn) {
@@ -65,20 +66,9 @@ public class WSDLServiceFactory extends 
         serviceName = sn;
     }
 
-    public WSDLServiceFactory(Bus b, URL url) {
-        setBus(b);
-        wsdlUrl = url;
-
-        try {
-            // use wsdl manager to parse wsdl or get cached definition
-            definition = getBus().getExtension(WSDLManager.class).getDefinition(wsdlUrl);
-        } catch (WSDLException ex) {
-            throw new ServiceConstructionException(new Message("SERVICE_CREATION_MSG", LOG),
ex);
-        }
-
-    }
     public WSDLServiceFactory(Bus b, String url) {
         setBus(b);
+        wsdlUrl = url;
         try {
             // use wsdl manager to parse wsdl or get cached definition
             definition = getBus().getExtension(WSDLManager.class).getDefinition(url);
@@ -87,12 +77,9 @@ public class WSDLServiceFactory extends 
         }
     }
 
-    public WSDLServiceFactory(Bus b, URL url, QName sn) {
-        this(b, url);
-        serviceName = sn;
-    }
     public WSDLServiceFactory(Bus b, String url, QName sn) {
         setBus(b);
+        wsdlUrl = url;
         try {
             // use wsdl manager to parse wsdl or get cached definition
             definition = getBus().getExtension(WSDLManager.class).getDefinition(url);

Modified: cxf/trunk/rt/wsdl/src/main/resources/META-INF/cxf/bus-extensions.txt
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/wsdl/src/main/resources/META-INF/cxf/bus-extensions.txt?rev=1565804&r1=1565803&r2=1565804&view=diff
==============================================================================
--- cxf/trunk/rt/wsdl/src/main/resources/META-INF/cxf/bus-extensions.txt (original)
+++ cxf/trunk/rt/wsdl/src/main/resources/META-INF/cxf/bus-extensions.txt Fri Feb  7 20:39:41
2014
@@ -1,3 +1,2 @@
 org.apache.cxf.wsdl11.WSDLManagerImpl:org.apache.cxf.wsdl.WSDLManager:true
-org.apache.cxf.wsdl11.WSDLServiceFactoryImpl:org.apache.cxf.wsdl.WSDLServiceFactory:true
 



Mime
View raw message