You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2011/08/30 22:59:01 UTC

svn commit: r1163377 - in /cxf/branches/2.4.x-fixes: ./ rt/core/src/main/java/org/apache/cxf/bus/ rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ rt/frontend/simple/src/test/java/org/apache/cxf/service/factory/

Author: dkulp
Date: Tue Aug 30 20:59:01 2011
New Revision: 1163377

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

........
  r1163374 | dkulp | 2011-08-30 16:56:35 -0400 (Tue, 30 Aug 2011) | 1 line
  
  [CXF-3593] Provide a config setting to require a wsdl
........

Modified:
    cxf/branches/2.4.x-fixes/   (props changed)
    cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java
    cxf/branches/2.4.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
    cxf/branches/2.4.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/SimpleMessages.properties
    cxf/branches/2.4.x-fixes/rt/frontend/simple/src/test/java/org/apache/cxf/service/factory/ReflectionServiceFactoryTest.java

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

Modified: cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java?rev=1163377&r1=1163376&r2=1163377&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java (original)
+++ cxf/branches/2.4.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java Tue Aug 30 20:59:01 2011
@@ -244,6 +244,10 @@ public class CXFBusImpl extends Abstract
     }
 
     public void setProperty(String s, Object o) {
-        properties.put(s, o);
+        if (o == null) {
+            properties.remove(s);
+        } else {
+            properties.put(s, o);
+        }
     }
 }

Modified: cxf/branches/2.4.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java?rev=1163377&r1=1163376&r2=1163377&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java (original)
+++ cxf/branches/2.4.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java Tue Aug 30 20:59:01 2011
@@ -401,6 +401,12 @@ public class ReflectionServiceFactoryBea
     }
 
     protected void buildServiceFromClass() {
+        Object o = getBus().getProperty("requireExplicitContractLocation");
+        if (o != null 
+            && ("true".equals(o) || Boolean.TRUE.equals(o))) {
+            throw new ServiceConstructionException(new Message("NO_WSDL_PROVIDED", LOG, 
+                                                               getServiceClass().getName()));
+        }
         if (LOG.isLoggable(Level.INFO)) {
             LOG.info("Creating Service " + getServiceQName() + " from class " + getServiceClass().getName());
         }

Modified: cxf/branches/2.4.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/SimpleMessages.properties
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/SimpleMessages.properties?rev=1163377&r1=1163376&r2=1163377&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/SimpleMessages.properties (original)
+++ cxf/branches/2.4.x-fixes/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/SimpleMessages.properties Tue Aug 30 20:59:01 2011
@@ -33,4 +33,4 @@ INTRACTABLE_PART= Message part {0} of Me
 JAXWS_ANNOTATION_FOUND=A JAX-WS Annotation was found on {0} while using the Simple frontend.  For better results, use the JAX-WS frontend.
 XSD_VALIDATION_ERROR= Error in W3C XML Schema associated with service: {0}
 COULD_NOT_UNWRAP=Could not unwrap Operation {0} to match method "{1}"
-
+NO_WSDL_PROVIDED=WSDL is required for services created from class {0}, but no WSDL location specified. 

Modified: cxf/branches/2.4.x-fixes/rt/frontend/simple/src/test/java/org/apache/cxf/service/factory/ReflectionServiceFactoryTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/frontend/simple/src/test/java/org/apache/cxf/service/factory/ReflectionServiceFactoryTest.java?rev=1163377&r1=1163376&r2=1163377&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/frontend/simple/src/test/java/org/apache/cxf/service/factory/ReflectionServiceFactoryTest.java (original)
+++ cxf/branches/2.4.x-fixes/rt/frontend/simple/src/test/java/org/apache/cxf/service/factory/ReflectionServiceFactoryTest.java Tue Aug 30 20:59:01 2011
@@ -132,7 +132,19 @@ public class ReflectionServiceFactoryTes
         
         return serviceFactory.create();        
     }
-    
+    @Test
+    public void testWSDLRequired() throws Exception {
+        
+        getBus().setProperty("requireExplicitContractLocation", Boolean.TRUE);
+        try {
+            createService(true);
+            fail("Should have failed");
+        } catch (ServiceConstructionException ex) {
+            getBus().setProperty("requireExplicitContractLocation", null);
+        }
+        
+        
+    }    
     @Test
     public void testServerFactoryBean() throws Exception {
         Service service = createService(true);