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 2009/08/20 22:00:42 UTC

svn commit: r806330 - in /cxf/trunk: api/src/main/java/org/apache/cxf/annotations/ common/common/src/main/java/org/apache/cxf/resource/ common/common/src/main/java/org/apache/cxf/staxutils/ rt/core/src/main/java/org/apache/cxf/wsdl11/ rt/ws/policy/ rt/...

Author: dkulp
Date: Thu Aug 20 20:00:40 2009
New Revision: 806330

URL: http://svn.apache.org/viewvc?rev=806330&view=rev
Log:
Add ability to set policies via annotations

Added:
    cxf/trunk/api/src/main/java/org/apache/cxf/annotations/Policies.java
      - copied, changed from r806023, cxf/trunk/api/src/main/java/org/apache/cxf/annotations/WSDLDocumentationCollection.java
    cxf/trunk/api/src/main/java/org/apache/cxf/annotations/Policy.java
      - copied, changed from r806023, cxf/trunk/api/src/main/java/org/apache/cxf/annotations/WSDLDocumentation.java
    cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyAnnotationListener.java   (with props)
    cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyAnnotationTest.java   (with props)
    cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/
    cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestImplPolicy.xml   (with props)
    cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestInterfacePolicy.xml   (with props)
    cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestOperationInputPolicy.xml   (with props)
    cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestOperationOutputPolicy.xml   (with props)
    cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestOperationPTInputPolicy.xml   (with props)
    cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestOperationPTOutputPolicy.xml   (with props)
    cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestOperationPTPolicy.xml   (with props)
    cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestOperationPolicy.xml   (with props)
    cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestPortTypePolicy.xml   (with props)
Modified:
    cxf/trunk/api/src/main/java/org/apache/cxf/annotations/DataBinding.java
    cxf/trunk/api/src/main/java/org/apache/cxf/annotations/FastInfoset.java
    cxf/trunk/api/src/main/java/org/apache/cxf/annotations/GZIP.java
    cxf/trunk/api/src/main/java/org/apache/cxf/annotations/Logging.java
    cxf/trunk/api/src/main/java/org/apache/cxf/annotations/SchemaValidation.java
    cxf/trunk/api/src/main/java/org/apache/cxf/annotations/WSDLDocumentation.java
    cxf/trunk/api/src/main/java/org/apache/cxf/annotations/WSDLDocumentationCollection.java
    cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/URIResolver.java
    cxf/trunk/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/ServiceWSDLBuilder.java
    cxf/trunk/rt/ws/policy/pom.xml
    cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java
    cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/AbstractPolicyProvider.java
    cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/reference/RemoteReferenceResolver.java
    cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyEngineTest.java
    cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/spring/PolicyBeansTest.java

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/annotations/DataBinding.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/annotations/DataBinding.java?rev=806330&r1=806329&r2=806330&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/annotations/DataBinding.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/annotations/DataBinding.java Thu Aug 20 20:00:40 2009
@@ -19,6 +19,7 @@
 
 package org.apache.cxf.annotations;
 
+import java.lang.annotation.Documented;
 import java.lang.annotation.ElementType;
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
@@ -27,6 +28,7 @@
 /**
  * Specifies the DataBinding to use with the service
  */
+@Documented
 @Retention(RetentionPolicy.RUNTIME)
 @Target({ ElementType.TYPE })
 public @interface DataBinding {

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/annotations/FastInfoset.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/annotations/FastInfoset.java?rev=806330&r1=806329&r2=806330&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/annotations/FastInfoset.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/annotations/FastInfoset.java Thu Aug 20 20:00:40 2009
@@ -19,6 +19,7 @@
 
 package org.apache.cxf.annotations;
 
+import java.lang.annotation.Documented;
 import java.lang.annotation.ElementType;
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
@@ -27,6 +28,7 @@
 /**
  * Enables FastInfoset negotiation
  */
+@Documented
 @Retention(RetentionPolicy.RUNTIME)
 @Target({ ElementType.TYPE })
 public @interface FastInfoset {

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/annotations/GZIP.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/annotations/GZIP.java?rev=806330&r1=806329&r2=806330&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/annotations/GZIP.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/annotations/GZIP.java Thu Aug 20 20:00:40 2009
@@ -19,6 +19,7 @@
 
 package org.apache.cxf.annotations;
 
+import java.lang.annotation.Documented;
 import java.lang.annotation.ElementType;
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
@@ -27,6 +28,7 @@
 /**
  * Enables GZIP compression negotiation
  */
+@Documented
 @Retention(RetentionPolicy.RUNTIME)
 @Target({ ElementType.TYPE })
 public @interface GZIP {

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/annotations/Logging.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/annotations/Logging.java?rev=806330&r1=806329&r2=806330&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/annotations/Logging.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/annotations/Logging.java Thu Aug 20 20:00:40 2009
@@ -19,6 +19,7 @@
 
 package org.apache.cxf.annotations;
 
+import java.lang.annotation.Documented;
 import java.lang.annotation.ElementType;
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
@@ -27,6 +28,7 @@
 /**
  * Enables message Logging
  */
+@Documented
 @Retention(RetentionPolicy.RUNTIME)
 @Target({ ElementType.TYPE })
 public @interface Logging {

Copied: cxf/trunk/api/src/main/java/org/apache/cxf/annotations/Policies.java (from r806023, cxf/trunk/api/src/main/java/org/apache/cxf/annotations/WSDLDocumentationCollection.java)
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/annotations/Policies.java?p2=cxf/trunk/api/src/main/java/org/apache/cxf/annotations/Policies.java&p1=cxf/trunk/api/src/main/java/org/apache/cxf/annotations/WSDLDocumentationCollection.java&r1=806023&r2=806330&rev=806330&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/annotations/WSDLDocumentationCollection.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/annotations/Policies.java Thu Aug 20 20:00:40 2009
@@ -20,6 +20,7 @@
 package org.apache.cxf.annotations;
 
 
+import java.lang.annotation.Documented;
 import java.lang.annotation.ElementType;
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
@@ -27,11 +28,13 @@
 
 
 /**
- * 
+ * Used to attache multiple Policy annotations 
+ * to a method or type if policies need to be added
+ * to more than one place in the wsdl. 
  */
+@Documented
 @Retention(RetentionPolicy.RUNTIME)
 @Target({ ElementType.TYPE, ElementType.METHOD })
-public @interface WSDLDocumentationCollection {
-    WSDLDocumentation[] value();
-    
+public @interface Policies {
+    Policy[] value();
 }

Copied: cxf/trunk/api/src/main/java/org/apache/cxf/annotations/Policy.java (from r806023, cxf/trunk/api/src/main/java/org/apache/cxf/annotations/WSDLDocumentation.java)
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/annotations/Policy.java?p2=cxf/trunk/api/src/main/java/org/apache/cxf/annotations/Policy.java&p1=cxf/trunk/api/src/main/java/org/apache/cxf/annotations/WSDLDocumentation.java&r1=806023&r2=806330&rev=806330&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/annotations/WSDLDocumentation.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/annotations/Policy.java Thu Aug 20 20:00:40 2009
@@ -19,36 +19,36 @@
 
 package org.apache.cxf.annotations;
 
-
+import java.lang.annotation.Documented;
 import java.lang.annotation.ElementType;
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
 
-
 /**
- * Adds documentation nodes to the generated WSDL
+ * Enables message Logging
  */
+@Documented
 @Retention(RetentionPolicy.RUNTIME)
 @Target({ ElementType.TYPE, ElementType.METHOD })
-public @interface WSDLDocumentation {
-    /**
-     * The documentation to add
-     * @return documentation string
-     */
-    String value();
+public @interface Policy {
+    
+    String uri();
+    
+    boolean includeInWSDL() default true;
+    
     
     /**
-     * The place to put the documentation.  The Default is depends on the 
+     * The place to put the PolicyReference.  The Default depends on the 
      * location of the annotation.   On the method in the SEI, it would be
-     * the portType/operation, on the SEI, it would be the portType, on the 
+     * the binding/operation, on the SEI, it would be the binding, on the 
      * service impl, the service element.
      * @return location
      */
     Placement placement() default Placement.DEFAULT;
     
     /**
-     * If Placement is FAULT_MESSAGE, PORT_FAULT, or BINDING_FAULT,
+     * If Placement is PORT_TYPE_OPERATION_FAULT, or BINDING_OPERATION_FAULT,
      * return the fault class associated with this documentation 
      * @return the fault class
      */
@@ -56,11 +56,6 @@
     
     enum Placement {
         DEFAULT,
-        TOP,
-        
-        INPUT_MESSAGE,
-        OUTPUT_MESSAGE,
-        FAULT_MESSAGE,
         
         PORT_TYPE,
         PORT_TYPE_OPERATION,
@@ -76,9 +71,8 @@
 
         SERVICE,
         SERVICE_PORT,
-        
     };
     
-
     static final class DEFAULT { }
 }
+

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/annotations/SchemaValidation.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/annotations/SchemaValidation.java?rev=806330&r1=806329&r2=806330&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/annotations/SchemaValidation.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/annotations/SchemaValidation.java Thu Aug 20 20:00:40 2009
@@ -19,6 +19,7 @@
 
 package org.apache.cxf.annotations;
 
+import java.lang.annotation.Documented;
 import java.lang.annotation.ElementType;
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
@@ -27,6 +28,7 @@
 /**
  * Enables SchemaValidation
  */
+@Documented
 @Retention(RetentionPolicy.RUNTIME)
 @Target({ ElementType.TYPE })
 public @interface SchemaValidation {

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/annotations/WSDLDocumentation.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/annotations/WSDLDocumentation.java?rev=806330&r1=806329&r2=806330&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/annotations/WSDLDocumentation.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/annotations/WSDLDocumentation.java Thu Aug 20 20:00:40 2009
@@ -20,6 +20,7 @@
 package org.apache.cxf.annotations;
 
 
+import java.lang.annotation.Documented;
 import java.lang.annotation.ElementType;
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
@@ -29,6 +30,7 @@
 /**
  * Adds documentation nodes to the generated WSDL
  */
+@Documented
 @Retention(RetentionPolicy.RUNTIME)
 @Target({ ElementType.TYPE, ElementType.METHOD })
 public @interface WSDLDocumentation {
@@ -39,7 +41,7 @@
     String value();
     
     /**
-     * The place to put the documentation.  The Default is depends on the 
+     * The place to put the documentation.  The Default depends on the 
      * location of the annotation.   On the method in the SEI, it would be
      * the portType/operation, on the SEI, it would be the portType, on the 
      * service impl, the service element.

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/annotations/WSDLDocumentationCollection.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/annotations/WSDLDocumentationCollection.java?rev=806330&r1=806329&r2=806330&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/annotations/WSDLDocumentationCollection.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/annotations/WSDLDocumentationCollection.java Thu Aug 20 20:00:40 2009
@@ -20,6 +20,7 @@
 package org.apache.cxf.annotations;
 
 
+import java.lang.annotation.Documented;
 import java.lang.annotation.ElementType;
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
@@ -27,8 +28,11 @@
 
 
 /**
- * 
+ * Used to attache multiple WSDLDocumentation annotations 
+ * to a method or type if documentation needs to be added
+ * to more than one place in the wsdl. 
  */
+@Documented
 @Retention(RetentionPolicy.RUNTIME)
 @Target({ ElementType.TYPE, ElementType.METHOD })
 public @interface WSDLDocumentationCollection {

Modified: cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/URIResolver.java
URL: http://svn.apache.org/viewvc/cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/URIResolver.java?rev=806330&r1=806329&r2=806330&view=diff
==============================================================================
--- cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/URIResolver.java (original)
+++ cxf/trunk/common/common/src/main/java/org/apache/cxf/resource/URIResolver.java Thu Aug 20 20:00:40 2009
@@ -203,7 +203,10 @@
             // do nothing
         }
 
-        if (uri != null && "file".equals(uri.getScheme())) {
+        if (is == null && baseUriStr.startsWith("classpath:")) {
+            tryClasspath(baseUriStr + uriStr);
+        }
+        if (is == null && uri != null && "file".equals(uri.getScheme())) {
             try {
                 file = new File(uri);
             } catch (IllegalArgumentException iae) {

Modified: cxf/trunk/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java?rev=806330&r1=806329&r2=806330&view=diff
==============================================================================
--- cxf/trunk/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java (original)
+++ cxf/trunk/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java Thu Aug 20 20:00:40 2009
@@ -858,7 +858,14 @@
         attr.setValue(uri);
         node.setAttributeNodeNS(attr);
     }
-
+    public static XMLStreamReader createXMLStreamReader(InputSource src) {
+        if (src.getByteStream() != null) {
+            return createXMLStreamReader(src.getByteStream(), src.getEncoding());
+        } else if (src.getCharacterStream() != null) {
+            return createXMLStreamReader(src.getCharacterStream());
+        }
+        throw new IllegalArgumentException("InputSource must have a ByteStream or CharacterStream");
+    }
     /**
      * @param in
      * @param encoding
@@ -1140,4 +1147,5 @@
             //shouldn't get here
         }
     }
+
 }

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/ServiceWSDLBuilder.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/ServiceWSDLBuilder.java?rev=806330&r1=806329&r2=806330&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/ServiceWSDLBuilder.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/ServiceWSDLBuilder.java Thu Aug 20 20:00:40 2009
@@ -49,6 +49,7 @@
 import javax.wsdl.extensions.AttributeExtensible;
 import javax.wsdl.extensions.ElementExtensible;
 import javax.wsdl.extensions.ExtensibilityElement;
+import javax.wsdl.extensions.UnknownExtensibilityElement;
 import javax.xml.namespace.QName;
 import javax.xml.parsers.ParserConfigurationException;
 
@@ -168,7 +169,7 @@
             ServiceInfo si = services.get(0);
             definition = newDefinition(si.getName(), si.getTargetNamespace());
             addNamespace(WSDLConstants.CONVENTIONAL_TNS_PREFIX, si.getTargetNamespace(), definition);
-            addExtensibilityElements(definition, getWSDL11Extensors(si));
+            addExtensibilityElements(definition, getWSDL11Extensors(si.getDescription()));
 
             Collection<PortType> portTypes = new HashSet<PortType>();
             for (ServiceInfo service : services) {
@@ -219,6 +220,9 @@
      * @return the extensibility elements.
      */
     public List<ExtensibilityElement> getWSDL11Extensors(AbstractPropertiesHolder holder) {
+        if (holder == null) {
+            return null;
+        }
         return holder.getExtensors(ExtensibilityElement.class);
     }
     
@@ -241,8 +245,14 @@
         List<ExtensibilityElement> extensibilityElements) {
         if (extensibilityElements != null) {
             for (ExtensibilityElement element : extensibilityElements) {
-                QName qn = element.getElementType();
-                addNamespace(qn.getNamespaceURI());
+                if (element instanceof UnknownExtensibilityElement) {
+                    UnknownExtensibilityElement uee = (UnknownExtensibilityElement)element;
+                    String pfx = uee.getElement().getPrefix();
+                    addNamespace(pfx, element.getElementType().getNamespaceURI());
+                } else {
+                    QName qn = element.getElementType();
+                    addNamespace(qn.getNamespaceURI());
+                }
                 elementExtensible.addExtensibilityElement(element);
             }
         }
@@ -430,6 +440,7 @@
         addDocumentation(serv, serviceInfo.getDocumentation());
         serv.setQName(serviceInfo.getName());
         addNamespace(serviceInfo.getName().getNamespaceURI());
+        addExtensibilityElements(serv, getWSDL11Extensors(serviceInfo));
         definition.addService(serv);
 
         for (EndpointInfo ei : serviceInfo.getEndpoints()) {
@@ -456,6 +467,7 @@
             portType.setQName(intf.getName());
             addDocumentation(portType, intf.getDocumentation());
             addNamespace(intf.getName().getNamespaceURI(), def);
+            addExtensibilityElements(portType, getWSDL11Extensors(intf));
             portType.setUndefined(false);
             buildPortTypeOperation(portType, intf.getOperations(), def);
         }
@@ -517,13 +529,14 @@
                 if (operationInfo.isOneWay()) {
                     operation.setStyle(OperationType.ONE_WAY);
                 }
-                this.addExtensibilityElements(operation, getWSDL11Extensors(operationInfo));
+                addExtensibilityElements(operation, getWSDL11Extensors(operationInfo));
                 Input input = def.createInput();
                 addDocumentation(input, operationInfo.getInput().getDocumentation());
                 input.setName(operationInfo.getInputName());
                 Message message = def.createMessage();
                 buildMessage(message, operationInfo.getInput(), def);
                 this.addExtensibilityAttributes(input, getInputExtensionAttributes(operationInfo));
+                this.addExtensibilityElements(input, getWSDL11Extensors(operationInfo.getInput()));
                 input.setMessage(message);
                 operation.setInput(input);
                 operation.setParameterOrdering(operationInfo.getParameterOrdering());
@@ -535,6 +548,7 @@
                     message = def.createMessage();
                     buildMessage(message, operationInfo.getOutput(), def);
                     this.addExtensibilityAttributes(output, getOutputExtensionAttributes(operationInfo));
+                    this.addExtensibilityElements(output, getWSDL11Extensors(operationInfo.getOutput()));
                     output.setMessage(message);
                     operation.setOutput(output);
                 }
@@ -548,6 +562,7 @@
                     message = def.createMessage();
                     buildMessage(message, faultInfo, def);
                     this.addExtensibilityAttributes(fault, faultInfo.getExtensionAttributes());
+                    this.addExtensibilityElements(fault, getWSDL11Extensors(faultInfo));
                     fault.setMessage(message);
                     operation.addFault(fault);
                 }

Modified: cxf/trunk/rt/ws/policy/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/pom.xml?rev=806330&r1=806329&r2=806330&view=diff
==============================================================================
--- cxf/trunk/rt/ws/policy/pom.xml (original)
+++ cxf/trunk/rt/ws/policy/pom.xml Thu Aug 20 20:00:40 2009
@@ -35,6 +35,7 @@
         <dependency>
             <groupId>org.apache.geronimo.specs</groupId>
             <artifactId>geronimo-jaxws_2.1_spec</artifactId>
+	    <scope>test</scope>
 	</dependency>
 	<dependency>
 	    <groupId>org.apache.geronimo.specs</groupId>

Added: cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyAnnotationListener.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyAnnotationListener.java?rev=806330&view=auto
==============================================================================
--- cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyAnnotationListener.java (added)
+++ cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyAnnotationListener.java Thu Aug 20 20:00:40 2009
@@ -0,0 +1,370 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.ws.policy;
+
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.ListIterator;
+
+import javax.wsdl.extensions.UnknownExtensibilityElement;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.stream.XMLStreamException;
+
+import org.w3c.dom.Attr;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+import org.xml.sax.InputSource;
+
+import org.apache.cxf.annotations.Policies;
+import org.apache.cxf.annotations.Policy;
+import org.apache.cxf.common.util.StringUtils;
+import org.apache.cxf.endpoint.Endpoint;
+import org.apache.cxf.endpoint.Server;
+import org.apache.cxf.helpers.CastUtils;
+import org.apache.cxf.helpers.DOMUtils;
+import org.apache.cxf.resource.ExtendedURIResolver;
+import org.apache.cxf.service.factory.AbstractServiceFactoryBean;
+import org.apache.cxf.service.factory.FactoryBeanListener;
+import org.apache.cxf.service.model.AbstractPropertiesHolder;
+import org.apache.cxf.service.model.BindingFaultInfo;
+import org.apache.cxf.service.model.BindingInfo;
+import org.apache.cxf.service.model.BindingOperationInfo;
+import org.apache.cxf.service.model.DescriptionInfo;
+import org.apache.cxf.service.model.FaultInfo;
+import org.apache.cxf.service.model.InterfaceInfo;
+import org.apache.cxf.service.model.OperationInfo;
+import org.apache.cxf.service.model.ServiceInfo;
+import org.apache.cxf.staxutils.StaxUtils;
+
+/**
+ * 
+ */
+public class PolicyAnnotationListener implements FactoryBeanListener {
+    private static final String EXTRA_POLICIES = PolicyAnnotationListener.class.getName() + ".EXTRA_POLICIES";
+    
+    private static final DocumentBuilder DEFAULT_DOC_BUILDER = DOMUtils.createDocumentBuilder();
+
+    public void handleEvent(Event ev, AbstractServiceFactoryBean factory, Object... args) {
+        switch (ev) {
+        case INTERFACE_CREATED: {
+            InterfaceInfo ii = (InterfaceInfo)args[0];
+            Class<?> cls = (Class<?>)args[1];
+            addPolicies(factory, ii, cls);
+            break;
+        }
+        case ENDPOINT_SELECTED: {
+            Class<?> cls = (Class<?>)args[2];
+            Endpoint ep = (Endpoint)args[1];
+            addPolicies(factory, ep, cls);
+            break;
+        }
+        case SERVER_CREATED: {
+            Class<?> cls = (Class<?>)args[2];
+            Server server = (Server)args[0];
+            addPolicies(factory, server, cls);
+            break;
+        }
+        case INTERFACE_OPERATION_BOUND: {
+            OperationInfo inf = (OperationInfo)args[0];
+            Method m = (Method)args[1];
+            addPolicies(factory, inf, m);
+            break;
+        }
+        default:
+            //ignore
+        }
+    }
+
+    private void addPolicies(AbstractServiceFactoryBean factory, OperationInfo inf, Method m) {
+        Policy p = m.getAnnotation(Policy.class);
+        Policies ps = m.getAnnotation(Policies.class);
+        if (p != null || ps != null) {
+            List<Policy> list = new ArrayList<Policy>();
+            if (p != null) {
+                list.add(p);
+            }
+            if (ps != null) {
+                list.addAll(Arrays.asList(ps.value()));
+            }
+            ListIterator<Policy> it = list.listIterator();
+            while (it.hasNext()) {
+                p = it.next();
+                Policy.Placement place = p.placement();
+                if (place == Policy.Placement.DEFAULT) {
+                    place = Policy.Placement.BINDING_OPERATION;
+                }
+                ServiceInfo service = inf.getInterface().getService();
+                Class<?> cls = m.getDeclaringClass();
+                switch (place) {
+                case PORT_TYPE_OPERATION:
+                    addPolicy(inf, service, p, cls, 
+                              inf.getName().getLocalPart() + "PortTypeOpPolicy");
+                    it.remove();
+                    break;
+                case PORT_TYPE_OPERATION_INPUT:
+                    addPolicy(inf.getInput(), service, p, cls, 
+                              inf.getName().getLocalPart() + "PortTypeOpInputPolicy");
+                    it.remove();
+                    break;
+                case PORT_TYPE_OPERATION_OUTPUT:
+                    addPolicy(inf.getOutput(), service, p, cls, 
+                              inf.getName().getLocalPart() + "PortTypeOpOutputPolicy");
+                    it.remove();
+                    break;
+                case PORT_TYPE_OPERATION_FAULT: {
+                    for (FaultInfo f : inf.getFaults()) {
+                        if (p.faultClass().equals(f.getProperty(Class.class.getName()))) {
+                            addPolicy(f, service, p, cls, 
+                                      f.getName().getLocalPart() + "PortTypeOpFaultPolicy");
+                            it.remove();
+                        }
+                    }
+                    break;
+                }
+                default:
+                    //nothing
+                }
+            }
+            if (!list.isEmpty()) {
+                List<Policy> stuff = CastUtils.cast((List<?>)inf.getProperty(EXTRA_POLICIES));
+                if (stuff != null) {
+                    stuff.addAll(list);
+                } else {
+                    inf.setProperty(EXTRA_POLICIES, list);
+                }
+            }
+        }        
+    }
+
+    private void addPolicies(AbstractServiceFactoryBean factory, Endpoint ep, Class<?> cls) {
+        List<Policy> list = CastUtils.cast((List<?>)ep.getEndpointInfo()
+                                           .getInterface().removeProperty(EXTRA_POLICIES));
+        if (list != null) {
+            addPolicies(factory, ep, cls, list, Policy.Placement.BINDING);
+        }
+        
+        ServiceInfo service = ep.getService().getServiceInfos().get(0);
+        for (BindingOperationInfo binfo : ep.getBinding().getBindingInfo().getOperations()) {
+            List<Policy> later = CastUtils.cast((List<?>)binfo.getOperationInfo()
+                                                           .removeProperty(EXTRA_POLICIES));
+            if (later != null) {
+                for (Policy p : later) {
+                    switch (p.placement()) {
+                    case DEFAULT:
+                    case BINDING_OPERATION:
+                        addPolicy(binfo, service, p, cls, 
+                                  binfo.getName().getLocalPart() + "BindingOpPolicy");
+                        break;
+                    case BINDING_OPERATION_INPUT:
+                        addPolicy(binfo.getInput(), service, p, cls, 
+                                  binfo.getName().getLocalPart() + "BindingOpInputPolicy");
+                        break;
+                    case BINDING_OPERATION_OUTPUT:
+                        addPolicy(binfo.getOutput(), service, p, cls, 
+                                  binfo.getName().getLocalPart() + "BindingOpOutputPolicy");
+                        break;
+                    case BINDING_OPERATION_FAULT: {
+                        for (BindingFaultInfo f : binfo.getFaults()) {
+                            if (p.faultClass().equals(f.getFaultInfo()
+                                                        .getProperty(Class.class.getName()))) {
+                                addPolicy(f, service, p, cls, 
+                                          f.getFaultInfo().getName().getLocalPart() + "BindingOpFaultPolicy");
+                            }
+                        }
+                        break;
+                    }
+                    default:
+                        //nothing
+                    }
+                }
+            }
+        }
+    }
+    private void addPolicies(AbstractServiceFactoryBean factory, Server server, Class<?> cls) {
+        List<Policy> list = CastUtils.cast((List<?>)server.getEndpoint().getEndpointInfo()
+                                           .getInterface().removeProperty(EXTRA_POLICIES));
+        if (list != null) {
+            addPolicies(factory, server.getEndpoint(), cls, list, Policy.Placement.BINDING);
+        }
+        Policy p = cls.getAnnotation(Policy.class);
+        Policies ps = cls.getAnnotation(Policies.class);
+        if (p != null || ps != null) {
+            list = new ArrayList<Policy>();
+            if (p != null) {
+                list.add(p);
+            }
+            if (ps != null) {
+                list.addAll(Arrays.asList(ps.value()));
+            }
+            addPolicies(factory, server.getEndpoint(), cls, list, Policy.Placement.SERVICE);
+        }        
+        
+    }
+
+    private void addPolicies(AbstractServiceFactoryBean factory, Endpoint endpoint, Class<?> cls,
+                             List<Policy> list, Policy.Placement defaultPlace) {
+        ListIterator<Policy> it = list.listIterator();
+        InterfaceInfo inf = endpoint.getEndpointInfo().getInterface();
+        BindingInfo binf = endpoint.getBinding().getBindingInfo();
+        ServiceInfo si = endpoint.getService().getServiceInfos().get(0);
+        while (it.hasNext()) {
+            Policy p = it.next();
+            Policy.Placement place = p.placement();
+            if (place == Policy.Placement.DEFAULT) {
+                place = defaultPlace;
+            }
+            switch (place) {
+            case PORT_TYPE: {
+                addPolicy(inf, si, p, cls, 
+                          inf.getName().getLocalPart() + "PortTypePolicy");
+                it.remove();
+                break;
+            }
+            case BINDING: {
+                addPolicy(binf, si, p, cls, 
+                          binf.getName().getLocalPart() + "BindingPolicy");
+                it.remove();
+                break;
+            }
+            case SERVICE: {
+                addPolicy(si, si, p, cls, 
+                          si.getName().getLocalPart() + "ServicePolicy");
+                it.remove();
+                break;
+            }
+            case SERVICE_PORT: {
+                addPolicy(endpoint.getEndpointInfo(), si, p, cls, 
+                          endpoint.getEndpointInfo().getName().getLocalPart() + "PortPolicy");
+                it.remove();
+                break;
+            }
+            default:
+            }
+
+        }
+    }
+
+
+    private void addPolicies(AbstractServiceFactoryBean factory, InterfaceInfo ii, Class<?> cls) {
+        Policy p = cls.getAnnotation(Policy.class);
+        Policies ps = cls.getAnnotation(Policies.class);
+        if (p != null || ps != null) {
+            List<Policy> list = new ArrayList<Policy>();
+            if (p != null) {
+                list.add(p);
+            }
+            if (ps != null) {
+                list.addAll(Arrays.asList(ps.value()));
+            }
+            ListIterator<Policy> it = list.listIterator();
+            while (it.hasNext()) {
+                p = it.next();
+                Policy.Placement place = p.placement();
+                if (place == Policy.Placement.DEFAULT) {
+                    place = Policy.Placement.BINDING;
+                }
+                switch (place) {
+                case PORT_TYPE: {
+                    addPolicy(ii, ii.getService(), p, cls, 
+                              ii.getName().getLocalPart() + "PortTypePolicy");
+                    it.remove();
+                    break;
+                }
+                case SERVICE: {
+                    addPolicy(ii.getService(),
+                              ii.getService(),
+                              p, cls, 
+                              ii.getService().getName().getLocalPart() + "ServicePolicy");
+                    it.remove();
+                    break;
+                }
+                default:
+                }
+            }
+            if (!list.isEmpty()) {
+                List<Policy> stuff = CastUtils.cast((List<?>)ii.getProperty(EXTRA_POLICIES));
+                if (stuff != null) {
+                    stuff.addAll(list);
+                } else {
+                    ii.setProperty(EXTRA_POLICIES, list);
+                }
+            }
+        }
+    }
+
+    private void addPolicy(AbstractPropertiesHolder place,
+                           ServiceInfo service, 
+                           Policy p,
+                           Class<?> cls,
+                           String defName) {
+        Element el = addPolicy(service, p, cls, defName);
+        UnknownExtensibilityElement uee = new UnknownExtensibilityElement();
+        uee.setElement(el);
+        uee.setRequired(true);
+        uee.setElementType(DOMUtils.getElementQName(el));
+        place.addExtensor(uee);
+    }
+    private Element addPolicy(ServiceInfo service, Policy p, Class<?> cls, String defName) {
+        String uri = p.uri();
+        String ns = PolicyConstants.NAMESPACE_WS_POLICY;
+        if (p.includeInWSDL()) {
+            ExtendedURIResolver resolver = new ExtendedURIResolver();
+            InputSource src = resolver.resolve(uri, "classpath:");
+            if (src != null) {
+                try {
+                    Document doc = StaxUtils.read(StaxUtils.createXMLStreamReader(src));
+                    if (service.getDescription() == null) {
+                        service.setDescription(new DescriptionInfo());
+                        service.getDescription().setBaseURI(cls.getResource("/").toString());
+                    }
+                    UnknownExtensibilityElement uee = new UnknownExtensibilityElement();
+                    uee.setElement(doc.getDocumentElement());
+                    uee.setRequired(true);
+                    uee.setElementType(DOMUtils.getElementQName(doc.getDocumentElement()));
+                    service.getDescription().addExtensor(uee);
+                    uri = doc.getDocumentElement().getAttributeNS(PolicyConstants.WSU_NAMESPACE_URI,
+                                                                  PolicyConstants.WSU_ID_ATTR_NAME);
+                    if (StringUtils.isEmpty(uri)) {
+                        uri = defName; 
+                        Attr att = doc.createAttributeNS(PolicyConstants.WSU_NAMESPACE_URI,
+                                                         "wsu:" + PolicyConstants.WSU_ID_ATTR_NAME);
+                        att.setNodeValue(defName);
+                        doc.getDocumentElement().setAttributeNodeNS(att);
+                    }
+                    ns = doc.getDocumentElement().getNamespaceURI();
+                    uri = "#" + uri;
+                } catch (XMLStreamException e) {
+                    //ignore
+                }
+            }
+        }
+        Document doc = DEFAULT_DOC_BUILDER.newDocument();
+        Element el = doc.createElementNS(ns,
+                                         "wsp:" + PolicyConstants.POLICYREFERENCE_ELEM_NAME);
+        Attr att = doc.createAttribute("URI");
+        att.setValue(uri);
+        el.setAttributeNodeNS(att);
+        return el;
+    }
+
+}

Propchange: cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyAnnotationListener.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyAnnotationListener.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java?rev=806330&r1=806329&r2=806330&view=diff
==============================================================================
--- cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java (original)
+++ cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java Thu Aug 20 20:00:40 2009
@@ -30,6 +30,7 @@
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.extension.BusExtension;
 import org.apache.cxf.helpers.CastUtils;
+import org.apache.cxf.service.factory.FactoryBeanListenerManager;
 import org.apache.cxf.service.model.BindingFaultInfo;
 import org.apache.cxf.service.model.BindingMessageInfo;
 import org.apache.cxf.service.model.BindingOperationInfo;
@@ -289,7 +290,15 @@
 
     protected final void init() {
         registry = new PolicyRegistryImpl();
-
+    }
+    
+    @PostConstruct
+    public synchronized void postConsruct() {
+        addBusInterceptors();
+        FactoryBeanListenerManager fblm = bus.getExtension(FactoryBeanListenerManager.class);
+        if (fblm != null) {
+            fblm.addListener(new PolicyAnnotationListener());
+        }
     }
 
 
@@ -302,7 +311,6 @@
         addedBusInterceptors = false;
     }
 
-    @PostConstruct
     public synchronized void addBusInterceptors() {
     
         if (null == alternativeSelector) {

Modified: cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/AbstractPolicyProvider.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/AbstractPolicyProvider.java?rev=806330&r1=806329&r2=806330&view=diff
==============================================================================
--- cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/AbstractPolicyProvider.java (original)
+++ cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/AbstractPolicyProvider.java Thu Aug 20 20:00:40 2009
@@ -80,11 +80,11 @@
     }
     
     protected Policy resolveExternal(PolicyReference ref,  String baseURI) {
-        ReferenceResolver resolver = new RemoteReferenceResolver(baseURI, builder);
         Policy resolved = registry.lookup(ref.getURI());
         if (null != resolved) {
             return resolved;
         }
+        ReferenceResolver resolver = new RemoteReferenceResolver(baseURI, builder);
         return resolver.resolveReference(ref.getURI());
     }
     

Modified: cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/reference/RemoteReferenceResolver.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/reference/RemoteReferenceResolver.java?rev=806330&r1=806329&r2=806330&view=diff
==============================================================================
--- cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/reference/RemoteReferenceResolver.java (original)
+++ cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/reference/RemoteReferenceResolver.java Thu Aug 20 20:00:40 2009
@@ -46,7 +46,7 @@
 
     public Policy resolveReference(String uri) {
         int pos = uri.indexOf('#');
-        String documentURI = uri.substring(0, pos);
+        String documentURI = pos == -1 ? uri : uri.substring(0, pos);
         ExtendedURIResolver resolver = new ExtendedURIResolver();
         InputSource is = resolver.resolve(documentURI, baseURI);
         if (null == is) {
@@ -60,16 +60,20 @@
         } finally {
             resolver.close();
         }
-        String id = uri.substring(pos + 1);
-        for (Element elem : PolicyConstants
-                .findAllPolicyElementsOfLocalName(doc,
-                                                  PolicyConstants.POLICY_ELEM_NAME)) {
-            
-            if (id.equals(elem.getAttributeNS(PolicyConstants.WSU_NAMESPACE_URI,
-                                              PolicyConstants.WSU_ID_ATTR_NAME))) {
-                return builder.getPolicy(elem);
+        if (pos == -1) {
+            return builder.getPolicy(doc.getDocumentElement());
+        } else {
+            String id = uri.substring(pos + 1);
+            for (Element elem : PolicyConstants
+                    .findAllPolicyElementsOfLocalName(doc,
+                                                      PolicyConstants.POLICY_ELEM_NAME)) {
+                
+                if (id.equals(elem.getAttributeNS(PolicyConstants.WSU_NAMESPACE_URI,
+                                                  PolicyConstants.WSU_ID_ATTR_NAME))) {
+                    return builder.getPolicy(elem);
+                }
             }
-        }
+        } 
         
         return null;
     }

Added: cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyAnnotationTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyAnnotationTest.java?rev=806330&view=auto
==============================================================================
--- cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyAnnotationTest.java (added)
+++ cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyAnnotationTest.java Thu Aug 20 20:00:40 2009
@@ -0,0 +1,143 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.ws.policy;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.jws.WebService;
+import javax.wsdl.Definition;
+import javax.wsdl.xml.WSDLWriter;
+import javax.xml.xpath.XPathConstants;
+
+import org.w3c.dom.Element;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.annotations.Policies;
+import org.apache.cxf.annotations.Policy;
+import org.apache.cxf.common.WSDLConstants;
+import org.apache.cxf.endpoint.Server;
+import org.apache.cxf.helpers.XPathUtils;
+import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
+import org.apache.cxf.wsdl.WSDLManager;
+import org.apache.cxf.wsdl11.ServiceWSDLBuilder;
+
+import org.junit.Assert;
+
+
+/**
+ * 
+ */
+public class PolicyAnnotationTest extends Assert {
+
+    @org.junit.Test
+    public void testAnnotations() throws Exception {
+        JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean();
+        factory.setServiceBean(new TestImpl());
+        factory.setStart(false);
+        Server s = factory.create();
+        Bus bus = factory.getBus();
+        try {
+            ServiceWSDLBuilder builder = new ServiceWSDLBuilder(bus,
+                                                                s.getEndpoint().getService()
+                                                                    .getServiceInfos());
+            Definition def = builder.build();
+            WSDLWriter wsdlWriter = bus.getExtension(WSDLManager.class)
+                .getWSDLFactory().newWSDLWriter();
+            def.setExtensionRegistry(bus.getExtension(WSDLManager.class).getExtensionRegistry());
+            Element wsdl = wsdlWriter.getDocument(def).getDocumentElement();
+            
+            Map<String, String> ns = new HashMap<String, String>();
+            ns.put("wsdl", WSDLConstants.NS_WSDL11);
+            ns.put("wsu", 
+                   "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd");
+            ns.put("wsp", PolicyConstants.NAMESPACE_XMLSOAP_200409);
+            XPathUtils xpu = new XPathUtils(ns);
+            //org.apache.cxf.helpers.XMLUtils.printDOM(wsdl);
+            check(xpu, wsdl, "/wsdl:definitions/wsdl:service/", "TestImplServiceServicePolicy");
+            check(xpu, wsdl, "/wsdl:definitions/wsdl:service/wsdl:port", "TestImplPortPortPolicy");
+            check(xpu, wsdl, "/wsdl:definitions/wsdl:portType/", "TestInterfacePortTypePolicy");
+            check(xpu, wsdl, "/wsdl:definitions/wsdl:portType/wsdl:operation/", "echoIntPortTypeOpPolicy");
+            check(xpu, wsdl, "/wsdl:definitions/wsdl:portType/wsdl:operation/wsdl:input",
+                  "echoIntPortTypeOpInputPolicy");
+            check(xpu, wsdl, "/wsdl:definitions/wsdl:portType/wsdl:operation/wsdl:output",
+                  "echoIntPortTypeOpOutputPolicy");
+            check(xpu, wsdl, "/wsdl:definitions/wsdl:binding/", "TestImplServiceSoapBindingBindingPolicy");
+            check(xpu, wsdl, "/wsdl:definitions/wsdl:binding/wsdl:operation/", "echoIntBindingOpPolicy");
+            check(xpu, wsdl, "/wsdl:definitions/wsdl:binding/wsdl:operation/wsdl:input",
+                  "echoIntBindingOpInputPolicy");
+            check(xpu, wsdl, "/wsdl:definitions/wsdl:binding/wsdl:operation/wsdl:output",
+                  "echoIntBindingOpOutputPolicy");
+        } finally {
+            bus.shutdown(true);
+        }
+    }
+    
+    private void check(XPathUtils xpu, Element wsdl, String path, String uri) {
+        assertTrue(uri + " not found",
+                   xpu.isExist("/wsdl:definitions/wsp:Policy[@wsu:Id='" + uri + "']",
+                              wsdl,
+                              XPathConstants.NODE));
+        assertTrue(uri + " reference not found",
+               xpu.isExist(path + "/wsp:PolicyReference[@URI='#" + uri + "']",
+                          wsdl,
+                          XPathConstants.NODE));
+        
+    }
+    
+    @Policies({
+        @Policy(uri = "annotationpolicies/TestInterfacePolicy.xml"),
+        @Policy(uri = "annotationpolicies/TestImplPolicy.xml",
+                placement = Policy.Placement.SERVICE_PORT),
+        @Policy(uri = "annotationpolicies/TestPortTypePolicy.xml", 
+                placement = Policy.Placement.PORT_TYPE)
+    }
+    )
+    @WebService
+    public static interface TestInterface {
+        @Policies({
+            @Policy(uri = "annotationpolicies/TestOperationPolicy.xml"),
+            @Policy(uri = "annotationpolicies/TestOperationInputPolicy.xml", 
+                    placement = Policy.Placement.BINDING_OPERATION_INPUT),
+            @Policy(uri = "annotationpolicies/TestOperationOutputPolicy.xml", 
+                    placement = Policy.Placement.BINDING_OPERATION_OUTPUT),
+            @Policy(uri = "annotationpolicies/TestOperationPTPolicy.xml", 
+                    placement = Policy.Placement.PORT_TYPE_OPERATION),
+            @Policy(uri = "annotationpolicies/TestOperationPTInputPolicy.xml", 
+                    placement = Policy.Placement.PORT_TYPE_OPERATION_INPUT),
+            @Policy(uri = "annotationpolicies/TestOperationPTOutputPolicy.xml", 
+                    placement = Policy.Placement.PORT_TYPE_OPERATION_OUTPUT)
+        }
+        )
+        int echoInt(int i);
+    }
+    
+    
+    @Policies({
+        @Policy(uri = "annotationpolicies/TestImplPolicy.xml")
+    }
+    )
+    @WebService()
+    public static class TestImpl implements TestInterface {
+        public int echoInt(int i) {
+            return i;
+        }
+    }
+}

Propchange: cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyAnnotationTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyAnnotationTest.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyEngineTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyEngineTest.java?rev=806330&r1=806329&r2=806330&view=diff
==============================================================================
--- cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyEngineTest.java (original)
+++ cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyEngineTest.java Thu Aug 20 20:00:40 2009
@@ -105,7 +105,7 @@
         assertTrue(engine.isEnabled()); 
         assertSame(selector, engine.getAlternativeSelector());
         assertNotNull(engine.createOutPolicyInfo());
-        
+        bus.shutdown(true);
     }
     
     @Test

Modified: cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/spring/PolicyBeansTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/spring/PolicyBeansTest.java?rev=806330&r1=806329&r2=806330&view=diff
==============================================================================
--- cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/spring/PolicyBeansTest.java (original)
+++ cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/spring/PolicyBeansTest.java Thu Aug 20 20:00:40 2009
@@ -28,42 +28,38 @@
 import org.apache.cxf.ws.policy.PolicyProvider;
 import org.apache.cxf.ws.policy.attachment.external.ExternalAttachmentProvider;
 import org.apache.cxf.ws.policy.selector.MaximalAlternativeSelector;
-import org.junit.After;
 import org.junit.Test;
 
 public class PolicyBeansTest extends Assert {
     
-    private Bus bus;
-    
-    @After
-    public void shutdown() {
-        if (null != bus) {
-            bus.shutdown(true);
-        }
-    }
 
     @Test
     public void testParse() {
-        bus = new SpringBusFactory().createBus("org/apache/cxf/ws/policy/spring/beans.xml");
-        PolicyEngine pe = bus.getExtension(PolicyEngine.class);
-        assertTrue("Policy engine is not enabled", pe.isEnabled());
-        assertTrue("Unknown assertions are not ignored", pe.isIgnoreUnknownAssertions());
-        
-        assertEquals(MaximalAlternativeSelector.class.getName(), 
-                     pe.getAlternativeSelector().getClass().getName()); 
-        
-        
-        PolicyEngineImpl pei = (PolicyEngineImpl)pe;
-        Collection<PolicyProvider> providers = pei.getPolicyProviders();
-        assertEquals(4, providers.size());
-        int n = 0;
-        for (PolicyProvider pp : providers) {
-            if (pp instanceof ExternalAttachmentProvider) {
-                n++;
+        Bus bus = new SpringBusFactory().createBus("org/apache/cxf/ws/policy/spring/beans.xml");
+        try {
+            PolicyEngine pe = bus.getExtension(PolicyEngine.class);
+            assertTrue("Policy engine is not enabled", pe.isEnabled());
+            assertTrue("Unknown assertions are not ignored", pe.isIgnoreUnknownAssertions());
+            
+            assertEquals(MaximalAlternativeSelector.class.getName(), 
+                         pe.getAlternativeSelector().getClass().getName()); 
+            
+            
+            PolicyEngineImpl pei = (PolicyEngineImpl)pe;
+            Collection<PolicyProvider> providers = pei.getPolicyProviders();
+            assertEquals(4, providers.size());
+            int n = 0;
+            for (PolicyProvider pp : providers) {
+                if (pp instanceof ExternalAttachmentProvider) {
+                    n++;
+                }
             }
+            assertEquals("Unexpected number of external providers", 2, n);
+        } finally {
+            bus.shutdown(true);
         }
-        assertEquals("Unexpected number of external providers", 2, n);
     }
+        
     
    
 }

Added: cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestImplPolicy.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestImplPolicy.xml?rev=806330&view=auto
==============================================================================
--- cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestImplPolicy.xml (added)
+++ cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestImplPolicy.xml Thu Aug 20 20:00:40 2009
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+ 
+  http://www.apache.org/licenses/LICENSE-2.0
+ 
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+	<wsp:ExactlyOne />
+</wsp:Policy>
\ No newline at end of file

Propchange: cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestImplPolicy.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestImplPolicy.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestImplPolicy.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestInterfacePolicy.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestInterfacePolicy.xml?rev=806330&view=auto
==============================================================================
--- cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestInterfacePolicy.xml (added)
+++ cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestInterfacePolicy.xml Thu Aug 20 20:00:40 2009
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+ 
+  http://www.apache.org/licenses/LICENSE-2.0
+ 
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+	<wsp:ExactlyOne />
+</wsp:Policy>
\ No newline at end of file

Propchange: cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestInterfacePolicy.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestInterfacePolicy.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestInterfacePolicy.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestOperationInputPolicy.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestOperationInputPolicy.xml?rev=806330&view=auto
==============================================================================
--- cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestOperationInputPolicy.xml (added)
+++ cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestOperationInputPolicy.xml Thu Aug 20 20:00:40 2009
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+ 
+  http://www.apache.org/licenses/LICENSE-2.0
+ 
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+	<wsp:ExactlyOne />
+</wsp:Policy>
\ No newline at end of file

Propchange: cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestOperationInputPolicy.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestOperationInputPolicy.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestOperationInputPolicy.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestOperationOutputPolicy.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestOperationOutputPolicy.xml?rev=806330&view=auto
==============================================================================
--- cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestOperationOutputPolicy.xml (added)
+++ cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestOperationOutputPolicy.xml Thu Aug 20 20:00:40 2009
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+ 
+  http://www.apache.org/licenses/LICENSE-2.0
+ 
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+	<wsp:ExactlyOne />
+</wsp:Policy>
\ No newline at end of file

Propchange: cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestOperationOutputPolicy.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestOperationOutputPolicy.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestOperationOutputPolicy.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestOperationPTInputPolicy.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestOperationPTInputPolicy.xml?rev=806330&view=auto
==============================================================================
--- cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestOperationPTInputPolicy.xml (added)
+++ cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestOperationPTInputPolicy.xml Thu Aug 20 20:00:40 2009
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+ 
+  http://www.apache.org/licenses/LICENSE-2.0
+ 
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+	<wsp:ExactlyOne />
+</wsp:Policy>
\ No newline at end of file

Propchange: cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestOperationPTInputPolicy.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestOperationPTInputPolicy.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestOperationPTInputPolicy.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestOperationPTOutputPolicy.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestOperationPTOutputPolicy.xml?rev=806330&view=auto
==============================================================================
--- cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestOperationPTOutputPolicy.xml (added)
+++ cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestOperationPTOutputPolicy.xml Thu Aug 20 20:00:40 2009
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+ 
+  http://www.apache.org/licenses/LICENSE-2.0
+ 
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+	<wsp:ExactlyOne />
+</wsp:Policy>
\ No newline at end of file

Propchange: cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestOperationPTOutputPolicy.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestOperationPTOutputPolicy.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestOperationPTOutputPolicy.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestOperationPTPolicy.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestOperationPTPolicy.xml?rev=806330&view=auto
==============================================================================
--- cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestOperationPTPolicy.xml (added)
+++ cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestOperationPTPolicy.xml Thu Aug 20 20:00:40 2009
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+ 
+  http://www.apache.org/licenses/LICENSE-2.0
+ 
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+	<wsp:ExactlyOne />
+</wsp:Policy>
\ No newline at end of file

Propchange: cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestOperationPTPolicy.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestOperationPTPolicy.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestOperationPTPolicy.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestOperationPolicy.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestOperationPolicy.xml?rev=806330&view=auto
==============================================================================
--- cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestOperationPolicy.xml (added)
+++ cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestOperationPolicy.xml Thu Aug 20 20:00:40 2009
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+ 
+  http://www.apache.org/licenses/LICENSE-2.0
+ 
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+	<wsp:ExactlyOne />
+</wsp:Policy>
\ No newline at end of file

Propchange: cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestOperationPolicy.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestOperationPolicy.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestOperationPolicy.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestPortTypePolicy.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestPortTypePolicy.xml?rev=806330&view=auto
==============================================================================
--- cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestPortTypePolicy.xml (added)
+++ cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestPortTypePolicy.xml Thu Aug 20 20:00:40 2009
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+ 
+  http://www.apache.org/licenses/LICENSE-2.0
+ 
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<wsp:Policy xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy">
+	<wsp:ExactlyOne />
+</wsp:Policy>
\ No newline at end of file

Propchange: cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestPortTypePolicy.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestPortTypePolicy.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: cxf/trunk/rt/ws/policy/src/test/resources/annotationpolicies/TestPortTypePolicy.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml