cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1244146 - in /cxf/trunk: api/src/main/java/org/apache/cxf/service/model/ rt/core/src/main/java/org/apache/cxf/wsdl11/ rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/ rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ws/ rt...
Date Tue, 14 Feb 2012 18:23:24 GMT
Author: dkulp
Date: Tue Feb 14 18:23:23 2012
New Revision: 1244146

URL: http://svn.apache.org/viewvc?rev=1244146&view=rev
Log:
[CXF-4110] Fix problems of description not being set in servicemodel
which is leading to @Policy annotations not working.

Modified:
    cxf/trunk/api/src/main/java/org/apache/cxf/service/model/AbstractDescriptionElement.java
    cxf/trunk/api/src/main/java/org/apache/cxf/service/model/BindingInfo.java
    cxf/trunk/api/src/main/java/org/apache/cxf/service/model/EndpointInfo.java
    cxf/trunk/api/src/main/java/org/apache/cxf/service/model/InterfaceInfo.java
    cxf/trunk/api/src/main/java/org/apache/cxf/service/model/ServiceInfo.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
    cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsEndpointImpl.java
    cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ws/PolicyAnnotationTest.java
    cxf/trunk/rt/frontend/jaxws/src/test/resources/annotationpolicies/TestImplPolicy.xml
    cxf/trunk/rt/frontend/jaxws/src/test/resources/annotationpolicies/TestInterfacePolicy.xml
    cxf/trunk/rt/frontend/jaxws/src/test/resources/annotationpolicies/TestOperationInputPolicy.xml
    cxf/trunk/rt/frontend/jaxws/src/test/resources/annotationpolicies/TestOperationOutputPolicy.xml
    cxf/trunk/rt/frontend/jaxws/src/test/resources/annotationpolicies/TestOperationPTInputPolicy.xml
    cxf/trunk/rt/frontend/jaxws/src/test/resources/annotationpolicies/TestOperationPolicy.xml
    cxf/trunk/rt/frontend/jaxws/src/test/resources/annotationpolicies/TestPortTypePolicy.xml

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/service/model/AbstractDescriptionElement.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/AbstractDescriptionElement.java?rev=1244146&r1=1244145&r2=1244146&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/service/model/AbstractDescriptionElement.java
(original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/service/model/AbstractDescriptionElement.java
Tue Feb 14 18:23:23 2012
@@ -21,14 +21,6 @@ package org.apache.cxf.service.model;
 
 public abstract class AbstractDescriptionElement extends AbstractPropertiesHolder {
 
-    DescriptionInfo description;
-
-    public void setDescription(DescriptionInfo d) {
-        description = d;
-    }
-
-    public DescriptionInfo getDescription() {
-        return description;
-    }
+    public abstract DescriptionInfo getDescription();
     
 }

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/service/model/BindingInfo.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/BindingInfo.java?rev=1244146&r1=1244145&r2=1244146&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/service/model/BindingInfo.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/service/model/BindingInfo.java Tue Feb 14 18:23:23
2012
@@ -45,6 +45,13 @@ public class BindingInfo extends Abstrac
         this.bindingId = bindingId;
     }
     
+    public DescriptionInfo getDescription() {
+        if (service == null) {
+            return null;
+        }
+        return service.getDescription();
+    }
+
     public InterfaceInfo getInterface() {
         return service.getInterface();
     }

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/service/model/EndpointInfo.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/EndpointInfo.java?rev=1244146&r1=1244145&r2=1244146&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/service/model/EndpointInfo.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/service/model/EndpointInfo.java Tue Feb 14
18:23:23 2012
@@ -42,6 +42,13 @@ public class EndpointInfo extends Abstra
         service = serv;
     }
     
+    public DescriptionInfo getDescription() {
+        if (service == null) {
+            return null;
+        }
+        return service.getDescription();
+    }
+
     
     public String getTransportId() {
         return transportId;

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/service/model/InterfaceInfo.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/InterfaceInfo.java?rev=1244146&r1=1244145&r2=1244146&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/service/model/InterfaceInfo.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/service/model/InterfaceInfo.java Tue Feb 14
18:23:23 2012
@@ -43,7 +43,13 @@ public class InterfaceInfo extends Abstr
         service = info;
         info.setInterface(this);
     }
-    
+    public DescriptionInfo getDescription() {
+        if (service == null) {
+            return null;
+        }
+        return service.getDescription();
+    }
+
     public ServiceInfo getService() {
         return service;
     }

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/service/model/ServiceInfo.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/service/model/ServiceInfo.java?rev=1244146&r1=1244145&r2=1244146&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/service/model/ServiceInfo.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/service/model/ServiceInfo.java Tue Feb 14 18:23:23
2012
@@ -41,11 +41,19 @@ public class ServiceInfo extends Abstrac
     List<SchemaInfo> schemas = new ArrayList<SchemaInfo>(4);
     private SchemaCollection xmlSchemaCollection;
     private String topLevelDoc;
+    private DescriptionInfo description;
 
     public ServiceInfo() {
         xmlSchemaCollection = new SchemaCollection();
     }
     
+    public DescriptionInfo getDescription() {
+        return description;
+    }
+    public void setDescription(DescriptionInfo d) {
+        description = d;
+    }
+
     public String getTopLevelDoc() {
         return topLevelDoc;
     }

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java?rev=1244146&r1=1244145&r2=1244146&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceBuilder.java Tue Feb
14 18:23:23 2012
@@ -472,7 +472,6 @@ public class WSDLServiceBuilder {
         service.addEndpoint(ei);
         DescriptionInfo d = service.getDescription();
         if (null != d) {
-            ei.setDescription(d);
             d.getDescribed().add(ei);
         }
         return ei;
@@ -535,7 +534,6 @@ public class WSDLServiceBuilder {
         service.addBinding(bi);
         DescriptionInfo d = service.getDescription();
         if (null != d) {
-            bi.setDescription(d);
             d.getDescribed().add(bi);
         }
         return bi;
@@ -561,7 +559,6 @@ public class WSDLServiceBuilder {
         InterfaceInfo inf = si.createInterface(p.getQName());
         DescriptionInfo d = si.getDescription();
         if (null != d) {
-            inf.setDescription(si.getDescription());
             d.getDescribed().add(inf);
         }
         copyDocumentation(inf, p);

Modified: cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsEndpointImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsEndpointImpl.java?rev=1244146&r1=1244145&r2=1244146&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsEndpointImpl.java
(original)
+++ cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsEndpointImpl.java
Tue Feb 14 18:23:23 2012
@@ -341,7 +341,6 @@ public class JaxWsEndpointImpl extends E
                     DescriptionInfo description = new DescriptionInfo();
                     description.setName(bindingInfo.getService().getName());
                     bindingInfo.getService().setDescription(description);
-                    bindingInfo.setDescription(description);
                 }
                 bindingInfo.getService().getDescription().addExtensor(uel);
                 

Modified: cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ws/PolicyAnnotationTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ws/PolicyAnnotationTest.java?rev=1244146&r1=1244145&r2=1244146&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ws/PolicyAnnotationTest.java
(original)
+++ cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ws/PolicyAnnotationTest.java
Tue Feb 14 18:23:23 2012
@@ -40,6 +40,8 @@ import org.apache.cxf.endpoint.Server;
 import org.apache.cxf.helpers.XPathUtils;
 import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
 import org.apache.cxf.transport.local.LocalTransportFactory;
+import org.apache.cxf.ws.policy.EndpointPolicy;
+import org.apache.cxf.ws.policy.PolicyEngine;
 import org.apache.cxf.wsdl.WSDLManager;
 import org.apache.cxf.wsdl11.ServiceWSDLBuilder;
 import org.apache.neethi.Constants;
@@ -107,6 +109,12 @@ public class PolicyAnnotationTest extend
             check(xpu, wsdl, "/wsdl:definitions/wsdl:binding/wsdl:operation/wsdl:output",
                   "echoIntBindingOpOutputPolicy");
             check(xpu, wsdl, "/wsdl:definitions/wsdl:service/", "TestImplServiceServicePolicy");
+            
+            
+            EndpointPolicy policy = bus.getExtension(PolicyEngine.class)
+                .getServerEndpointPolicy(s.getEndpoint().getEndpointInfo(), null);
+            assertNotNull(policy);
+            assertEquals(1, policy.getChosenAlternative().size());
         } finally {
             bus.shutdown(true);
         }
@@ -168,6 +176,8 @@ public class PolicyAnnotationTest extend
             check(xpu, wsdl, "/wsdl:definitions/wsdl:binding/wsdl:operation/wsdl:output",
                   "echoIntBindingOpOutputPolicy");
             check(xpu, wsdl, "/wsdl:definitions/wsdl:service/", "TestInterfaceServiceServicePolicy");
+            
+            
         } finally {
             bus.shutdown(true);
         }
@@ -216,7 +226,7 @@ public class PolicyAnnotationTest extend
     
     
     @Policies({
-        @Policy(uri = "annotationpolicies/TestImplPolicy.xml")
+        @Policy(uri = "annotationpolicies/TestImplPolicy.xml"),
     }
     )
     @WebService(endpointInterface = "org.apache.cxf.jaxws.ws.PolicyAnnotationTest$TestInterface")

Modified: cxf/trunk/rt/frontend/jaxws/src/test/resources/annotationpolicies/TestImplPolicy.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/test/resources/annotationpolicies/TestImplPolicy.xml?rev=1244146&r1=1244145&r2=1244146&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/test/resources/annotationpolicies/TestImplPolicy.xml (original)
+++ cxf/trunk/rt/frontend/jaxws/src/test/resources/annotationpolicies/TestImplPolicy.xml Tue
Feb 14 18:23:23 2012
@@ -18,5 +18,6 @@
   under the License.
 -->
 <wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
-	<wsp:ExactlyOne />
+    <!-- impl -->
+	<wsp:All />
 </wsp:Policy>
\ No newline at end of file

Modified: cxf/trunk/rt/frontend/jaxws/src/test/resources/annotationpolicies/TestInterfacePolicy.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/test/resources/annotationpolicies/TestInterfacePolicy.xml?rev=1244146&r1=1244145&r2=1244146&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/test/resources/annotationpolicies/TestInterfacePolicy.xml
(original)
+++ cxf/trunk/rt/frontend/jaxws/src/test/resources/annotationpolicies/TestInterfacePolicy.xml
Tue Feb 14 18:23:23 2012
@@ -18,5 +18,8 @@
   under the License.
 -->
 <wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
-	<wsp:ExactlyOne />
+    <!-- interface -->
+	<wsp:All>
+	    <wsam:Addressing xmlns:wsam="http://www.w3.org/2007/02/addressing/metadata"/>
+	</wsp:All>
 </wsp:Policy>
\ No newline at end of file

Modified: cxf/trunk/rt/frontend/jaxws/src/test/resources/annotationpolicies/TestOperationInputPolicy.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/test/resources/annotationpolicies/TestOperationInputPolicy.xml?rev=1244146&r1=1244145&r2=1244146&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/test/resources/annotationpolicies/TestOperationInputPolicy.xml
(original)
+++ cxf/trunk/rt/frontend/jaxws/src/test/resources/annotationpolicies/TestOperationInputPolicy.xml
Tue Feb 14 18:23:23 2012
@@ -18,5 +18,5 @@
   under the License.
 -->
 <wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
-	<wsp:ExactlyOne />
+	<wsp:All />
 </wsp:Policy>
\ No newline at end of file

Modified: cxf/trunk/rt/frontend/jaxws/src/test/resources/annotationpolicies/TestOperationOutputPolicy.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/test/resources/annotationpolicies/TestOperationOutputPolicy.xml?rev=1244146&r1=1244145&r2=1244146&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/test/resources/annotationpolicies/TestOperationOutputPolicy.xml
(original)
+++ cxf/trunk/rt/frontend/jaxws/src/test/resources/annotationpolicies/TestOperationOutputPolicy.xml
Tue Feb 14 18:23:23 2012
@@ -18,5 +18,5 @@
   under the License.
 -->
 <wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
-	<wsp:ExactlyOne />
+	<wsp:All />
 </wsp:Policy>
\ No newline at end of file

Modified: cxf/trunk/rt/frontend/jaxws/src/test/resources/annotationpolicies/TestOperationPTInputPolicy.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/test/resources/annotationpolicies/TestOperationPTInputPolicy.xml?rev=1244146&r1=1244145&r2=1244146&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/test/resources/annotationpolicies/TestOperationPTInputPolicy.xml
(original)
+++ cxf/trunk/rt/frontend/jaxws/src/test/resources/annotationpolicies/TestOperationPTInputPolicy.xml
Tue Feb 14 18:23:23 2012
@@ -18,5 +18,5 @@
   under the License.
 -->
 <wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
-	<wsp:ExactlyOne />
+	<wsp:All/>
 </wsp:Policy>
\ No newline at end of file

Modified: cxf/trunk/rt/frontend/jaxws/src/test/resources/annotationpolicies/TestOperationPolicy.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/test/resources/annotationpolicies/TestOperationPolicy.xml?rev=1244146&r1=1244145&r2=1244146&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/test/resources/annotationpolicies/TestOperationPolicy.xml
(original)
+++ cxf/trunk/rt/frontend/jaxws/src/test/resources/annotationpolicies/TestOperationPolicy.xml
Tue Feb 14 18:23:23 2012
@@ -18,5 +18,5 @@
   under the License.
 -->
 <wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
-	<wsp:ExactlyOne />
+	<wsp:All />
 </wsp:Policy>
\ No newline at end of file

Modified: cxf/trunk/rt/frontend/jaxws/src/test/resources/annotationpolicies/TestPortTypePolicy.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/test/resources/annotationpolicies/TestPortTypePolicy.xml?rev=1244146&r1=1244145&r2=1244146&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/test/resources/annotationpolicies/TestPortTypePolicy.xml
(original)
+++ cxf/trunk/rt/frontend/jaxws/src/test/resources/annotationpolicies/TestPortTypePolicy.xml
Tue Feb 14 18:23:23 2012
@@ -18,5 +18,6 @@
   under the License.
 -->
 <wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
-	<wsp:ExactlyOne />
+    <!-- porttype -->
+	<wsp:All />
 </wsp:Policy>
\ No newline at end of file



Mime
View raw message