cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r629609 [2/3] - in /incubator/cxf/trunk: api/src/main/java/org/apache/cxf/ws/policy/ api/src/main/java/org/apache/cxf/ws/policy/builder/jaxb/ api/src/main/java/org/apache/cxf/ws/policy/builder/primitive/ api/src/main/java/org/apache/cxf/ws/...
Date Wed, 20 Feb 2008 20:40:46 GMT
Modified: incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/MAPAggregator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/MAPAggregator.java?rev=629609&r1=629608&r2=629609&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/MAPAggregator.java (original)
+++ incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/MAPAggregator.java Wed Feb 20 12:40:27 2008
@@ -28,6 +28,7 @@
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.logging.Level;
 import java.util.logging.Logger;
+
 import javax.wsdl.extensions.ExtensibilityElement;
 import javax.xml.namespace.QName;
 import javax.xml.ws.WebFault;
@@ -236,8 +237,7 @@
         if (null == aim) {
             return false;            
         }
-        Collection<AssertionInfo> ais = aim.get(MetadataConstants.ADDRESSING_ASSERTION_QNAME);
-        if (null == ais || ais.size() == 0) {
+        if (null == aim.get(MetadataConstants.ADDRESSING_ASSERTION_QNAME)) {
             return false;
         }
         // no need to analyse the content of the Addressing assertion here
@@ -259,16 +259,13 @@
             return false;
             
         }
-        Collection<AssertionInfo> ais = aim.get(MetadataConstants.USING_ADDRESSING_2004_QNAME);
-        if (null != ais || ais.size() > 0) {
+        if (null != aim.get(MetadataConstants.USING_ADDRESSING_2004_QNAME)) {
             return true;
         }
-        ais = aim.get(MetadataConstants.USING_ADDRESSING_2005_QNAME);
-        if (null != ais || ais.size() > 0) {
+        if (null != aim.get(MetadataConstants.USING_ADDRESSING_2005_QNAME)) {
             return true;
         }
-        ais = aim.get(MetadataConstants.USING_ADDRESSING_2006_QNAME);
-        if (null != ais || ais.size() > 0) {
+        if (null != aim.get(MetadataConstants.USING_ADDRESSING_2006_QNAME)) {
             return true;
         } 
         return false;
@@ -279,7 +276,7 @@
      * Policies.
      * @param message the current message
      */
-    private void assertAddressing(Message message) {
+    private void assertAddressing(Message message, boolean anonymous) {
         AssertionInfoMap aim = message.get(AssertionInfoMap.class);
         if (null == aim) {
             return;
@@ -293,15 +290,25 @@
         };
         
         for (QName type : types) {
-            Collection<AssertionInfo> ais = aim.get(type);
-            if (null != ais) {
-                for (AssertionInfo ai : ais) {
-                    ai.setAsserted(true);
-                }
+            assertAssertion(aim, type);
+            if (type.equals(MetadataConstants.ADDRESSING_ASSERTION_QNAME)) {
+                if (anonymous) {
+                    assertAssertion(aim, MetadataConstants.ANON_RESPONSES_ASSERTION_QNAME);
+                } else {
+                    assertAssertion(aim, MetadataConstants.NON_ANON_RESPONSES_ASSERTION_QNAME);
+                }        
             }
         }
+        
+        
     }
 
+    private void assertAssertion(AssertionInfoMap aim, QName type) {
+        Collection<AssertionInfo> aic = aim.getAssertionInfo(type);
+        for (AssertionInfo ai : aic) {
+            ai.setAsserted(true);
+        }
+    }
 
     /**
      * @param exts list of extension elements
@@ -369,8 +376,10 @@
                                               ContextUtils.retrieveMAPFaultName(message)));
             }
         }
-        if (null != ContextUtils.retrieveMAPs(message, false, ContextUtils.isOutbound(message))) {            
-            assertAddressing(message);
+        AddressingPropertiesImpl theMaps = 
+            ContextUtils.retrieveMAPs(message, false, ContextUtils.isOutbound(message));
+        if (null != theMaps) {            
+            assertAddressing(message, ContextUtils.isGenericAddress(theMaps.getReplyTo()));
         }
         return continueProcessing;
     }

Modified: incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/policy/AddressingAssertionBuilder.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/policy/AddressingAssertionBuilder.java?rev=629609&r1=629608&r2=629609&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/policy/AddressingAssertionBuilder.java (original)
+++ incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/policy/AddressingAssertionBuilder.java Wed Feb 20 12:40:27 2008
@@ -31,13 +31,13 @@
 import org.apache.cxf.Bus;
 import org.apache.cxf.ws.policy.AssertionBuilder;
 import org.apache.cxf.ws.policy.AssertionBuilderRegistry;
+import org.apache.cxf.ws.policy.PolicyAssertion;
 import org.apache.cxf.ws.policy.PolicyBuilder;
 import org.apache.cxf.ws.policy.PolicyConstants;
 import org.apache.cxf.ws.policy.builder.primitive.NestedPrimitiveAssertion;
 import org.apache.cxf.ws.policy.builder.primitive.NestedPrimitiveAssertionBuilder;
 import org.apache.cxf.ws.policy.builder.primitive.PrimitiveAssertion;
 import org.apache.cxf.ws.policy.builder.primitive.PrimitiveAssertionBuilder;
-import org.apache.neethi.Assertion;
 
 /**
  * 
@@ -57,7 +57,7 @@
         KNOWN.add(MetadataConstants.NON_ANON_RESPONSES_ASSERTION_QNAME);
     }
     
-    public Assertion build(Element elem) {
+    public PolicyAssertion build(Element elem) {
         
         String localName = elem.getLocalName();
         QName qn = new QName(elem.getNamespaceURI(), localName);
@@ -87,7 +87,7 @@
         return KNOWN;
     }
 
-    public Assertion buildCompatible(Assertion a, Assertion b) {
+    public PolicyAssertion buildCompatible(PolicyAssertion a, PolicyAssertion b) {
         QName qn = a.getName();
         if (MetadataConstants.ADDRESSING_ASSERTION_QNAME.equals(qn)) {
             NestedPrimitiveAssertionBuilder npab = new NestedPrimitiveAssertionBuilder();

Modified: incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/policy/AddressingPolicyInterceptorProvider.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/policy/AddressingPolicyInterceptorProvider.java?rev=629609&r1=629608&r2=629609&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/policy/AddressingPolicyInterceptorProvider.java (original)
+++ incubator/cxf/trunk/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/policy/AddressingPolicyInterceptorProvider.java Wed Feb 20 12:40:27 2008
@@ -24,18 +24,16 @@
 
 import javax.xml.namespace.QName;
 
-import org.apache.cxf.interceptor.AbstractAttributedInterceptorProvider;
 import org.apache.cxf.ws.addressing.MAPAggregator;
 import org.apache.cxf.ws.addressing.soap.MAPCodec;
-import org.apache.cxf.ws.policy.PolicyInterceptorProvider;
+import org.apache.cxf.ws.policy.AbstractPolicyInterceptorProvider;
 
 /**
  * Instead of parametrising an instance of org.apache.cxf.policy.PolicyInterceptorProviderImpl
  * we use this class to reduce the impact of changes to the addressing metadata namespace
  * (only need to update Metadataconstants, otherwise cfg file fragement also).
  */
-public class AddressingPolicyInterceptorProvider  extends AbstractAttributedInterceptorProvider 
-    implements PolicyInterceptorProvider {
+public class AddressingPolicyInterceptorProvider extends AbstractPolicyInterceptorProvider {
 
     private static final Collection<QName> ASSERTION_TYPES;
     private static final MAPAggregator MAP_AGGREGATOR = new MAPAggregator();
@@ -53,7 +51,7 @@
     }
     
     public AddressingPolicyInterceptorProvider() {
-        super();
+        super(ASSERTION_TYPES);
         getInInterceptors().add(MAP_AGGREGATOR);
         getInInterceptors().add(MAP_CODEC);
         
@@ -66,8 +64,5 @@
         getOutFaultInterceptors().add(MAP_AGGREGATOR);
         getOutFaultInterceptors().add(MAP_CODEC);
     }
-
-    public Collection<QName> getAssertionTypes() {
-        return ASSERTION_TYPES;
-    }
+    
 }

Modified: incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/AssertionBuilderRegistryImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/AssertionBuilderRegistryImpl.java?rev=629609&r1=629608&r2=629609&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/AssertionBuilderRegistryImpl.java (original)
+++ incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/AssertionBuilderRegistryImpl.java Wed Feb 20 12:40:27 2008
@@ -35,7 +35,6 @@
 import org.apache.cxf.configuration.spring.MapProvider;
 import org.apache.cxf.extension.BusExtension;
 import org.apache.cxf.extension.RegistryImpl;
-import org.apache.neethi.Assertion;
 
 /**
  * 
@@ -73,7 +72,7 @@
         ignoreUnknownAssertions = ignore;
     }
 
-    public Assertion build(Element element) {
+    public PolicyAssertion build(Element element) {
 
         AssertionBuilder builder;
 

Modified: incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/ClientPolicyInFaultInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/ClientPolicyInFaultInterceptor.java?rev=629609&r1=629608&r2=629609&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/ClientPolicyInFaultInterceptor.java (original)
+++ incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/ClientPolicyInFaultInterceptor.java Wed Feb 20 12:40:27 2008
@@ -33,7 +33,6 @@
 import org.apache.cxf.phase.Phase;
 import org.apache.cxf.service.model.EndpointInfo;
 import org.apache.cxf.transport.Conduit;
-import org.apache.neethi.Assertion;
 
 /**
  * 
@@ -85,7 +84,7 @@
         
         // insert assertions of endpoint's fault vocabulary into message
         
-        Collection<Assertion> assertions = ep.getFaultVocabulary();
+        Collection<PolicyAssertion> assertions = ep.getFaultVocabulary();
         if (null != assertions) {
             msg.put(AssertionInfoMap.class, new AssertionInfoMap(assertions));
         }

Modified: incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/ClientPolicyInInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/ClientPolicyInInterceptor.java?rev=629609&r1=629608&r2=629609&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/ClientPolicyInInterceptor.java (original)
+++ incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/ClientPolicyInInterceptor.java Wed Feb 20 12:40:27 2008
@@ -33,7 +33,6 @@
 import org.apache.cxf.phase.Phase;
 import org.apache.cxf.service.model.EndpointInfo;
 import org.apache.cxf.transport.Conduit;
-import org.apache.neethi.Assertion;
 
 /**
  * 
@@ -82,7 +81,7 @@
         
         // insert assertions of endpoint's vocabulary into message
         
-        Collection<Assertion> assertions = ep.getVocabulary();
+        Collection<PolicyAssertion> assertions = ep.getVocabulary();
         if (null != assertions) {
             msg.put(AssertionInfoMap.class, new AssertionInfoMap(assertions));
         }

Modified: incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/ClientPolicyOutInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/ClientPolicyOutInterceptor.java?rev=629609&r1=629608&r2=629609&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/ClientPolicyOutInterceptor.java (original)
+++ incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/ClientPolicyOutInterceptor.java Wed Feb 20 12:40:27 2008
@@ -34,7 +34,6 @@
 import org.apache.cxf.service.model.BindingOperationInfo;
 import org.apache.cxf.service.model.EndpointInfo;
 import org.apache.cxf.transport.Conduit;
-import org.apache.neethi.Assertion;
 
 /**
  * 
@@ -90,14 +89,14 @@
         
         // insert assertions of the chosen alternative into the message
         
-        Collection<Assertion> assertions = effectivePolicy.getChosenAlternative();
+        Collection<PolicyAssertion> assertions = effectivePolicy.getChosenAlternative();
         if (null != assertions) {
             if (LOG.isLoggable(Level.FINEST)) {
                 StringBuffer buf = new StringBuffer();
                 buf.append("Chosen alternative: ");
                 String nl = System.getProperty("line.separator");
                 buf.append(nl);
-                for (Assertion a : assertions) {
+                for (PolicyAssertion a : assertions) {
                     PolicyUtils.printPolicyComponent(a, buf, 1);
                 }
                 LOG.finest(buf.toString());

Modified: incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EffectivePolicyImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EffectivePolicyImpl.java?rev=629609&r1=629608&r2=629609&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EffectivePolicyImpl.java (original)
+++ incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EffectivePolicyImpl.java Wed Feb 20 12:40:27 2008
@@ -38,7 +38,6 @@
 import org.apache.cxf.service.model.EndpointInfo;
 import org.apache.cxf.transport.Conduit;
 import org.apache.cxf.transport.Destination;
-import org.apache.neethi.Assertion;
 import org.apache.neethi.Policy;
 
 /**
@@ -50,7 +49,7 @@
     private static final Logger LOG = LogUtils.getL7dLogger(EffectivePolicyImpl.class);
     
     protected Policy policy;     
-    protected Collection<Assertion> chosenAlternative;
+    protected Collection<PolicyAssertion> chosenAlternative;
     protected List<Interceptor> interceptors;
     
     public Policy getPolicy() {
@@ -61,7 +60,7 @@
         return interceptors;
     }
     
-    public Collection<Assertion> getChosenAlternative() {
+    public Collection<PolicyAssertion> getChosenAlternative() {
         return chosenAlternative;
     }
     
@@ -118,7 +117,7 @@
     }
 
     void chooseAlternative(PolicyEngineImpl engine, Assertor assertor) {
-        Collection<Assertion> alternative = engine.getAlternativeSelector()
+        Collection<PolicyAssertion> alternative = engine.getAlternativeSelector()
             .selectAlternative(policy, engine, assertor);
         if (null == alternative) {
             PolicyUtils.logPolicy(LOG, Level.FINE, "No alternative supported.", getPolicy());
@@ -132,7 +131,7 @@
         PolicyInterceptorProviderRegistry reg 
             = engine.getBus().getExtension(PolicyInterceptorProviderRegistry.class);
         List<Interceptor> out = new ArrayList<Interceptor>();
-        for (Assertion a : getChosenAlternative()) {
+        for (PolicyAssertion a : getChosenAlternative()) {
             if (a.isOptional()) {
                 continue;
             }
@@ -151,7 +150,7 @@
         policy = ep;
     }
     
-    void setChosenAlternative(Collection<Assertion> c) {
+    void setChosenAlternative(Collection<PolicyAssertion> c) {
         chosenAlternative = c;
     }
     

Modified: incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EndpointPolicyImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EndpointPolicyImpl.java?rev=629609&r1=629608&r2=629609&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EndpointPolicyImpl.java (original)
+++ incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EndpointPolicyImpl.java Wed Feb 20 12:40:27 2008
@@ -22,6 +22,7 @@
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashSet;
+import java.util.Iterator;
 import java.util.List;
 import java.util.ResourceBundle;
 import java.util.Set;
@@ -30,11 +31,11 @@
 
 import org.apache.cxf.common.i18n.BundleUtils;
 import org.apache.cxf.common.i18n.Message;
+import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.interceptor.Interceptor;
 import org.apache.cxf.service.model.BindingFaultInfo;
 import org.apache.cxf.service.model.BindingOperationInfo;
 import org.apache.cxf.service.model.EndpointInfo;
-import org.apache.neethi.Assertion;
 import org.apache.neethi.ExactlyOne;
 import org.apache.neethi.Policy;
 
@@ -46,9 +47,9 @@
     private static final ResourceBundle BUNDLE = BundleUtils.getBundle(EndpointPolicyImpl.class);
     
     private Policy policy;
-    private Collection<Assertion> chosenAlternative;
-    private Collection<Assertion> vocabulary;
-    private Collection<Assertion> faultVocabulary;
+    private Collection<PolicyAssertion> chosenAlternative;
+    private Collection<PolicyAssertion> vocabulary;
+    private Collection<PolicyAssertion> faultVocabulary;
     private List<Interceptor> interceptors;
     private List<Interceptor> faultInterceptors;
     
@@ -84,15 +85,15 @@
         return epi;
     }
     
-    public Collection<Assertion> getChosenAlternative() {
+    public Collection<PolicyAssertion> getChosenAlternative() {
         return chosenAlternative;
     }
     
-    public Collection<Assertion> getVocabulary() {
+    public Collection<PolicyAssertion> getVocabulary() {
         return vocabulary;
     }
     
-    public Collection<Assertion> getFaultVocabulary() {
+    public Collection<PolicyAssertion> getFaultVocabulary() {
         return faultVocabulary;
     }    
     
@@ -125,8 +126,12 @@
     }
 
     void chooseAlternative() {
-        Collection<Assertion> alternative = engine.getAlternativeSelector()
-            .selectAlternative(policy, engine, assertor);
+        Collection<PolicyAssertion> alternative = null;
+        if (requestor) {
+            alternative = engine.getAlternativeSelector().selectAlternative(policy, engine, assertor);
+        } else {
+            alternative = getSupportedAlternatives();
+        }
         if (null == alternative) {
             throw new PolicyException(new Message("NO_ALTERNATIVE_EXC", BUNDLE));
         } else {
@@ -134,15 +139,26 @@
         }
     }
     
+    protected Collection<PolicyAssertion> getSupportedAlternatives() {
+        Collection<PolicyAssertion> alternatives = new ArrayList<PolicyAssertion>();
+        for (Iterator it = policy.getAlternatives(); it.hasNext();) {
+            List<PolicyAssertion> alternative = CastUtils.cast((List)it.next(), PolicyAssertion.class);
+            if (engine.supportsAlternative(alternative, assertor)) {
+                alternatives.addAll(alternative);
+            }
+        }
+        return alternatives;
+    }
+    
     void initializeVocabulary() {
-        vocabulary = new ArrayList<Assertion>();
+        vocabulary = new ArrayList<PolicyAssertion>();
         if (requestor) {
-            faultVocabulary = new ArrayList<Assertion>();
+            faultVocabulary = new ArrayList<PolicyAssertion>();
         }
        
         // vocabulary of alternative chosen for endpoint
         
-        for (Assertion a : getChosenAlternative()) {
+        for (PolicyAssertion a : getChosenAlternative()) {
             if (a.isOptional()) {
                 continue;
             }
@@ -157,7 +173,7 @@
         
         for (BindingOperationInfo boi : ei.getBinding().getOperations()) {
             Policy p = engine.getAggregatedOperationPolicy(boi);
-            Collection<Assertion> c = engine.getAssertions(p, false);
+            Collection<PolicyAssertion> c = engine.getAssertions(p, false);
             vocabulary.addAll(c);
             if (null != faultVocabulary) {
                 faultVocabulary.addAll(c);
@@ -187,7 +203,7 @@
         }
         
         Set<QName> v = new HashSet<QName>();
-        for (Assertion a : vocabulary) {
+        for (PolicyAssertion a : vocabulary) {
             v.add(a.getName());
         }
         
@@ -203,7 +219,7 @@
         }
         
         Set<QName> faultV = new HashSet<QName>();
-        for (Assertion a : faultVocabulary) {
+        for (PolicyAssertion a : faultVocabulary) {
             faultV.add(a.getName());
         }
         
@@ -221,15 +237,15 @@
         policy = ep;
     }
     
-    void setChosenAlternative(Collection<Assertion> c) {
+    void setChosenAlternative(Collection<PolicyAssertion> c) {
         chosenAlternative = c;
     }
     
-    void setVocabulary(Collection<Assertion> v) {
+    void setVocabulary(Collection<PolicyAssertion> v) {
         vocabulary = v;
     }
     
-    void setFaultVocabulary(Collection<Assertion> v) {
+    void setFaultVocabulary(Collection<PolicyAssertion> v) {
         faultVocabulary = v;
     }
     

Modified: incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyBuilderImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyBuilderImpl.java?rev=629609&r1=629608&r2=629609&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyBuilderImpl.java (original)
+++ incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyBuilderImpl.java Wed Feb 20 12:40:27 2008
@@ -38,7 +38,6 @@
 import org.apache.cxf.extension.BusExtension;
 import org.apache.cxf.helpers.DOMUtils;
 import org.apache.neethi.All;
-import org.apache.neethi.Assertion;
 import org.apache.neethi.Constants;
 import org.apache.neethi.ExactlyOne;
 import org.apache.neethi.Policy;
@@ -46,8 +45,6 @@
 import org.apache.neethi.PolicyReference;
 
 
-
-
 /**
  * PolicyBuilderImpl is an implementation of the PolicyBuilder interface,
  * provides methods to create Policy and PolicyReferenceObjects
@@ -198,7 +195,7 @@
                 }
 
             } else if (null != assertionBuilderRegistry) {
-                Assertion a = assertionBuilderRegistry.build(childElement);
+                PolicyAssertion a = assertionBuilderRegistry.build(childElement);
                 if (null != a) {
                     operator.addPolicyComponent(a);
                 }

Modified: incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java?rev=629609&r1=629608&r2=629609&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java (original)
+++ incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java Wed Feb 20 12:40:27 2008
@@ -44,7 +44,6 @@
 import org.apache.cxf.transport.Conduit;
 import org.apache.cxf.transport.Destination;
 import org.apache.cxf.ws.policy.selector.MinimalAlternativeSelector;
-import org.apache.neethi.Assertion;
 import org.apache.neethi.Constants;
 import org.apache.neethi.Policy;
 import org.apache.neethi.PolicyComponent;
@@ -451,12 +450,12 @@
      * @param includeOptional flag indicating if optional assertions should be included
      * @return the assertions
      */
-    Collection<Assertion> getAssertions(PolicyComponent pc, boolean includeOptional) {
+    Collection<PolicyAssertion> getAssertions(PolicyComponent pc, boolean includeOptional) {
     
-        Collection<Assertion> assertions = new ArrayList<Assertion>();
+        Collection<PolicyAssertion> assertions = new ArrayList<PolicyAssertion>();
     
         if (Constants.TYPE_ASSERTION == pc.getType()) {
-            Assertion a = (Assertion)pc;
+            PolicyAssertion a = (PolicyAssertion)pc;
             if (includeOptional || !a.isOptional()) {
                 assertions.add(a);
             }
@@ -467,12 +466,12 @@
     }
 
     void addAssertions(PolicyComponent pc, boolean includeOptional, 
-                               Collection<Assertion> assertions) {
+                               Collection<PolicyAssertion> assertions) {
    
         if (Constants.TYPE_ASSERTION == pc.getType()) {
-            Assertion a = (Assertion)pc;
+            PolicyAssertion a = (PolicyAssertion)pc;
             if (includeOptional || !a.isOptional()) {
-                assertions.add((Assertion)pc);            
+                assertions.add((PolicyAssertion)pc);            
             }
             return;
         } 
@@ -498,9 +497,9 @@
      * @return the vocabulary
      */
     Set<QName> getVocabulary(PolicyComponent pc, boolean includeOptional) {
-        Collection<Assertion> assertions = getAssertions(pc, includeOptional);
+        Collection<PolicyAssertion> assertions = getAssertions(pc, includeOptional);
         Set<QName> vocabulary = new HashSet<QName>();
-        for (Assertion a : assertions) {
+        for (PolicyAssertion a : assertions) {
             vocabulary.add(a.getName());
         }
         return vocabulary;
@@ -526,9 +525,11 @@
      * @param Assertor the assertor
      * @return true iff the alternative can be supported
      */
-    public boolean supportsAlternative(Collection<Assertion> alternative, Assertor assertor) {
-        PolicyInterceptorProviderRegistry pipr = bus.getExtension(PolicyInterceptorProviderRegistry.class);
-        for (Assertion a : alternative) {
+    public boolean supportsAlternative(Collection<PolicyAssertion> alternative, 
+                                       Assertor assertor) {
+        PolicyInterceptorProviderRegistry pipr = 
+            bus.getExtension(PolicyInterceptorProviderRegistry.class);
+        for (PolicyAssertion a : alternative) {
             if (!(a.isOptional() 
                 || (null != pipr.get(a.getName())) 
                 || (null != assertor && assertor.canAssert(a.getName())))) {

Modified: incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyInterceptorProviderRegistryImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyInterceptorProviderRegistryImpl.java?rev=629609&r1=629608&r2=629609&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyInterceptorProviderRegistryImpl.java (original)
+++ incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyInterceptorProviderRegistryImpl.java Wed Feb 20 12:40:27 2008
@@ -30,7 +30,6 @@
 import org.apache.cxf.extension.BusExtension;
 import org.apache.cxf.extension.RegistryImpl;
 import org.apache.cxf.interceptor.Interceptor;
-import org.apache.neethi.Assertion;
 
 /**
  * 
@@ -54,9 +53,10 @@
         return PolicyInterceptorProviderRegistry.class;
     }
     
-    public List<Interceptor> getInterceptors(Collection<Assertion> alternative, boolean out, boolean fault) {
+    public List<Interceptor> getInterceptors(Collection<PolicyAssertion> alternative, 
+                                             boolean out, boolean fault) {
         List<Interceptor> interceptors = new ArrayList<Interceptor>();
-        for (Assertion a : alternative) {
+        for (PolicyAssertion a : alternative) {
             if (a.isOptional()) {
                 continue;
             }

Modified: incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyUtils.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyUtils.java?rev=629609&r1=629608&r2=629609&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyUtils.java (original)
+++ incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyUtils.java Wed Feb 20 12:40:27 2008
@@ -112,7 +112,7 @@
             buf.append(")");
             nl(buf);
             if (pc instanceof NestedPrimitiveAssertion) {
-                PolicyComponent nested = ((NestedPrimitiveAssertion)pc).getNested();
+                PolicyComponent nested = ((NestedPrimitiveAssertion)pc).getPolicy();
                 level++;
                 printPolicyComponent(nested, buf, level);
                 level--;                

Modified: incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/ServerPolicyInInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/ServerPolicyInInterceptor.java?rev=629609&r1=629608&r2=629609&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/ServerPolicyInInterceptor.java (original)
+++ incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/ServerPolicyInInterceptor.java Wed Feb 20 12:40:27 2008
@@ -33,7 +33,6 @@
 import org.apache.cxf.phase.Phase;
 import org.apache.cxf.service.model.EndpointInfo;
 import org.apache.cxf.transport.Destination;
-import org.apache.neethi.Assertion;
 
 /**
  * 
@@ -82,7 +81,7 @@
         
         // insert assertions of endpoint's vocabulary into message
         
-        Collection<Assertion> assertions = ep.getVocabulary();
+        Collection<PolicyAssertion> assertions = ep.getVocabulary();
         if (null != assertions) {
             msg.put(AssertionInfoMap.class, new AssertionInfoMap(assertions));
         }

Modified: incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/ServerPolicyOutFaultInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/ServerPolicyOutFaultInterceptor.java?rev=629609&r1=629608&r2=629609&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/ServerPolicyOutFaultInterceptor.java (original)
+++ incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/ServerPolicyOutFaultInterceptor.java Wed Feb 20 12:40:27 2008
@@ -35,7 +35,6 @@
 import org.apache.cxf.service.model.BindingOperationInfo;
 import org.apache.cxf.service.model.EndpointInfo;
 import org.apache.cxf.transport.Destination;
-import org.apache.neethi.Assertion;
 
 /**
  * 
@@ -96,7 +95,7 @@
         
         // insert assertions of the chosen alternative into the message
         
-        Collection<Assertion> assertions = effectivePolicy.getChosenAlternative();
+        Collection<PolicyAssertion> assertions = effectivePolicy.getChosenAlternative();
         if (null != assertions) {
             msg.put(AssertionInfoMap.class, new AssertionInfoMap(assertions));
         }

Modified: incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/ServerPolicyOutInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/ServerPolicyOutInterceptor.java?rev=629609&r1=629608&r2=629609&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/ServerPolicyOutInterceptor.java (original)
+++ incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/ServerPolicyOutInterceptor.java Wed Feb 20 12:40:27 2008
@@ -34,7 +34,6 @@
 import org.apache.cxf.service.model.BindingOperationInfo;
 import org.apache.cxf.service.model.EndpointInfo;
 import org.apache.cxf.transport.Destination;
-import org.apache.neethi.Assertion;
 
 /**
  * 
@@ -86,7 +85,7 @@
         
         // insert assertions of the chosen alternative into the message
              
-        Collection<Assertion> assertions = effectivePolicy.getChosenAlternative();
+        Collection<PolicyAssertion> assertions = effectivePolicy.getChosenAlternative();
         if (null != assertions) {
             msg.put(AssertionInfoMap.class, new AssertionInfoMap(assertions));
         }

Modified: incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/mtom/MTOMAssertionBuilder.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/mtom/MTOMAssertionBuilder.java?rev=629609&r1=629608&r2=629609&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/mtom/MTOMAssertionBuilder.java (original)
+++ incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/mtom/MTOMAssertionBuilder.java Wed Feb 20 12:40:27 2008
@@ -30,10 +30,10 @@
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.ws.policy.AssertionBuilder;
+import org.apache.cxf.ws.policy.PolicyAssertion;
 import org.apache.cxf.ws.policy.PolicyConstants;
 import org.apache.cxf.ws.policy.builder.primitive.PrimitiveAssertion;
 import org.apache.cxf.ws.policy.builder.primitive.PrimitiveAssertionBuilder;
-import org.apache.neethi.Assertion;
 
 public class MTOMAssertionBuilder implements AssertionBuilder {
     private static final Collection<QName> KNOWN = new ArrayList<QName>();
@@ -46,7 +46,7 @@
         bus = b;
     }
 
-    public Assertion build(Element elem) {
+    public PolicyAssertion build(Element elem) {
         String localName = elem.getLocalName();
         QName qn = new QName(elem.getNamespaceURI(), localName);
 
@@ -75,7 +75,7 @@
         return KNOWN;
     }
 
-    public Assertion buildCompatible(Assertion a, Assertion b) {
+    public PolicyAssertion buildCompatible(PolicyAssertion a, PolicyAssertion b) {
         QName qn = a.getName();
         if (MetadataConstants.MTOM_ASSERTION_QNAME.equals(qn)) {
             PrimitiveAssertionBuilder pab = new PrimitiveAssertionBuilder();

Modified: incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/mtom/MTOMPolicyInterceptorProvider.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/mtom/MTOMPolicyInterceptorProvider.java?rev=629609&r1=629608&r2=629609&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/mtom/MTOMPolicyInterceptorProvider.java (original)
+++ incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/mtom/MTOMPolicyInterceptorProvider.java Wed Feb 20 12:40:27 2008
@@ -24,11 +24,9 @@
 
 import javax.xml.namespace.QName;
 
-import org.apache.cxf.interceptor.AbstractAttributedInterceptorProvider;
-import org.apache.cxf.ws.policy.PolicyInterceptorProvider;
+import org.apache.cxf.ws.policy.AbstractPolicyInterceptorProvider;
 
-public class MTOMPolicyInterceptorProvider  extends AbstractAttributedInterceptorProvider 
-    implements PolicyInterceptorProvider {
+public class MTOMPolicyInterceptorProvider extends AbstractPolicyInterceptorProvider {
 
     private static final Collection<QName> ASSERTION_TYPES;
     private static final MTOMPolicyInterceptor INTERCEPTOR = new MTOMPolicyInterceptor();
@@ -40,7 +38,7 @@
     }
     
     public MTOMPolicyInterceptorProvider() {
-        super();
+        super(ASSERTION_TYPES);
         getInInterceptors().add(INTERCEPTOR);
         
         getOutInterceptors().add(INTERCEPTOR);
@@ -49,8 +47,5 @@
         
         getOutFaultInterceptors().add(INTERCEPTOR);
     }
-
-    public Collection<QName> getAssertionTypes() {
-        return ASSERTION_TYPES;
-    }
+    
 }

Modified: incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/selector/FirstAlternativeSelector.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/selector/FirstAlternativeSelector.java?rev=629609&r1=629608&r2=629609&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/selector/FirstAlternativeSelector.java (original)
+++ incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/selector/FirstAlternativeSelector.java Wed Feb 20 12:40:27 2008
@@ -26,8 +26,8 @@
 import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.ws.policy.AlternativeSelector;
 import org.apache.cxf.ws.policy.Assertor;
+import org.apache.cxf.ws.policy.PolicyAssertion;
 import org.apache.cxf.ws.policy.PolicyEngine;
-import org.apache.neethi.Assertion;
 import org.apache.neethi.Policy;
 
 /**
@@ -35,10 +35,12 @@
  */
 public class FirstAlternativeSelector implements AlternativeSelector {
     
-    public Collection<Assertion> selectAlternative(Policy policy, PolicyEngine engine, Assertor assertor) {
+    public Collection<PolicyAssertion> selectAlternative(
+        Policy policy, PolicyEngine engine, Assertor assertor) {
         Iterator alternatives = policy.getAlternatives();
         while (alternatives.hasNext()) {
-            List<Assertion> alternative = CastUtils.cast((List)alternatives.next(), Assertion.class);
+            List<PolicyAssertion> alternative = 
+                CastUtils.cast((List)alternatives.next(), PolicyAssertion.class);
             if (engine.supportsAlternative(alternative, assertor)) {
                 return alternative;
             }

Modified: incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/selector/MaximalAlternativeSelector.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/selector/MaximalAlternativeSelector.java?rev=629609&r1=629608&r2=629609&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/selector/MaximalAlternativeSelector.java (original)
+++ incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/selector/MaximalAlternativeSelector.java Wed Feb 20 12:40:27 2008
@@ -26,8 +26,8 @@
 import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.ws.policy.AlternativeSelector;
 import org.apache.cxf.ws.policy.Assertor;
+import org.apache.cxf.ws.policy.PolicyAssertion;
 import org.apache.cxf.ws.policy.PolicyEngine;
-import org.apache.neethi.Assertion;
 import org.apache.neethi.Policy;
 
 /**
@@ -35,11 +35,13 @@
  */
 public class MaximalAlternativeSelector implements AlternativeSelector {
 
-    public Collection<Assertion> selectAlternative(Policy policy, PolicyEngine engine, Assertor assertor) {
-        Collection<Assertion> choice = null;
+    public Collection<PolicyAssertion> selectAlternative(
+        Policy policy, PolicyEngine engine, Assertor assertor) {
+        Collection<PolicyAssertion> choice = null;
         Iterator alternatives = policy.getAlternatives();
         while (alternatives.hasNext()) {
-            List<Assertion> alternative = CastUtils.cast((List)alternatives.next(), Assertion.class);
+            List<PolicyAssertion> alternative = 
+                CastUtils.cast((List)alternatives.next(), PolicyAssertion.class);
             if (engine.supportsAlternative(alternative, assertor) 
                 && (null == choice || alternative.size() > choice.size())) {
                 choice = alternative;

Modified: incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/selector/MinimalAlternativeSelector.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/selector/MinimalAlternativeSelector.java?rev=629609&r1=629608&r2=629609&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/selector/MinimalAlternativeSelector.java (original)
+++ incubator/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/selector/MinimalAlternativeSelector.java Wed Feb 20 12:40:27 2008
@@ -26,8 +26,8 @@
 import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.ws.policy.AlternativeSelector;
 import org.apache.cxf.ws.policy.Assertor;
+import org.apache.cxf.ws.policy.PolicyAssertion;
 import org.apache.cxf.ws.policy.PolicyEngine;
-import org.apache.neethi.Assertion;
 import org.apache.neethi.Policy;
 
 /**
@@ -35,11 +35,13 @@
  */
 public class MinimalAlternativeSelector implements AlternativeSelector {
 
-    public Collection<Assertion> selectAlternative(Policy policy, PolicyEngine engine, Assertor assertor) {
-        Collection<Assertion> choice = null;
+    public Collection<PolicyAssertion> selectAlternative(
+        Policy policy, PolicyEngine engine, Assertor assertor) {
+        Collection<PolicyAssertion> choice = null;
         Iterator alternatives = policy.getAlternatives();
         while (alternatives.hasNext()) {
-            List<Assertion> alternative = CastUtils.cast((List)alternatives.next(), Assertion.class);
+            List<PolicyAssertion> alternative = 
+                CastUtils.cast((List)alternatives.next(), PolicyAssertion.class);
             if (engine.supportsAlternative(alternative, assertor) 
                 && (null == choice || alternative.size() < choice.size())) {
                 choice = alternative;

Modified: incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/EffectivePolicyImplTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/EffectivePolicyImplTest.java?rev=629609&r1=629608&r2=629609&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/EffectivePolicyImplTest.java (original)
+++ incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/EffectivePolicyImplTest.java Wed Feb 20 12:40:27 2008
@@ -35,7 +35,6 @@
 import org.apache.cxf.service.model.EndpointInfo;
 import org.apache.cxf.transport.Conduit;
 import org.apache.cxf.transport.Destination;
-import org.apache.neethi.Assertion;
 import org.apache.neethi.Policy;
 import org.easymock.classextension.EasyMock;
 import org.easymock.classextension.IMocksControl;
@@ -64,8 +63,8 @@
         assertNull(effectivePolicy.getInterceptors());
         
         Policy p = control.createMock(Policy.class);
-        Assertion a = control.createMock(Assertion.class);
-        List<Assertion> la = Collections.singletonList(a);
+        PolicyAssertion a = control.createMock(PolicyAssertion.class);
+        List<PolicyAssertion> la = Collections.singletonList(a);
         Interceptor i = control.createMock(Interceptor.class);
         List<Interceptor> li = Collections.singletonList(i);
         control.replay();
@@ -86,7 +85,7 @@
         EndpointPolicyImpl endpointPolicy = control.createMock(EndpointPolicyImpl.class);
         Policy p = control.createMock(Policy.class);
         EasyMock.expect(endpointPolicy.getPolicy()).andReturn(p);
-        Collection<Assertion> chosenAlternative = new ArrayList<Assertion>();
+        Collection<PolicyAssertion> chosenAlternative = new ArrayList<PolicyAssertion>();
         EasyMock.expect(endpointPolicy.getChosenAlternative()).andReturn(chosenAlternative);
         PolicyEngineImpl pe = control.createMock(PolicyEngineImpl.class);
         effectivePolicy.initialiseInterceptors(pe);
@@ -247,11 +246,11 @@
         
         control.reset();        
         EasyMock.expect(engine.getAlternativeSelector()).andReturn(selector);
-        Collection<Assertion> alternative = new ArrayList<Assertion>();
+        Collection<PolicyAssertion> alternative = new ArrayList<PolicyAssertion>();
         EasyMock.expect(selector.selectAlternative(policy, engine, assertor)).andReturn(alternative);
         control.replay();        
         epi.chooseAlternative(engine, assertor);
-        Collection<Assertion> choice = epi.getChosenAlternative();
+        Collection<PolicyAssertion> choice = epi.getChosenAlternative();
         assertSame(choice, alternative);   
         control.verify();
     }
@@ -259,7 +258,7 @@
     @Test
     public void testInitialiseOutInterceptors() {
         EffectivePolicyImpl epi = new EffectivePolicyImpl();        
-        List<Assertion> alternative = new ArrayList<Assertion>();
+        List<PolicyAssertion> alternative = new ArrayList<PolicyAssertion>();
         epi.setChosenAlternative(alternative);
         
         PolicyEngineImpl engine = control.createMock(PolicyEngineImpl.class);
@@ -273,7 +272,7 @@
         
         control.reset();
         setupPolicyInterceptorProviderRegistry(engine, reg);
-        Assertion a = control.createMock(Assertion.class);        
+        PolicyAssertion a = control.createMock(PolicyAssertion.class);        
         alternative.add(a);
         EasyMock.expect(a.isOptional()).andReturn(true);
         control.replay();

Modified: incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/EndpointPolicyImplTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/EndpointPolicyImplTest.java?rev=629609&r1=629608&r2=629609&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/EndpointPolicyImplTest.java (original)
+++ incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/EndpointPolicyImplTest.java Wed Feb 20 12:40:27 2008
@@ -38,7 +38,6 @@
 import org.apache.cxf.service.model.EndpointInfo;
 import org.apache.cxf.service.model.ServiceInfo;
 import org.apache.neethi.All;
-import org.apache.neethi.Assertion;
 import org.apache.neethi.Constants;
 import org.apache.neethi.ExactlyOne;
 import org.apache.neethi.Policy;
@@ -80,8 +79,8 @@
         assertNull(epi.getFaultVocabulary());
         
         Policy p = control.createMock(Policy.class);
-        Assertion a = control.createMock(Assertion.class);
-        List<Assertion> la = Collections.singletonList(a);
+        PolicyAssertion a = control.createMock(PolicyAssertion.class);
+        List<PolicyAssertion> la = Collections.singletonList(a);
         Interceptor i = control.createMock(Interceptor.class);
         List<Interceptor> li = Collections.singletonList(i);
         control.replay();
@@ -175,11 +174,11 @@
         
         control.reset();        
         EasyMock.expect(engine.getAlternativeSelector()).andReturn(selector);
-        Collection<Assertion> alternative = new ArrayList<Assertion>();
+        Collection<PolicyAssertion> alternative = new ArrayList<PolicyAssertion>();
         EasyMock.expect(selector.selectAlternative(policy, engine, assertor)).andReturn(alternative);
         control.replay();        
         epi.chooseAlternative();
-        Collection<Assertion> choice = epi.getChosenAlternative();
+        Collection<PolicyAssertion> choice = epi.getChosenAlternative();
         assertSame(choice, alternative);   
         control.verify();
     }
@@ -200,12 +199,12 @@
         PolicyEngineImpl engine = control.createMock(PolicyEngineImpl.class);
         
         EndpointPolicyImpl epi = new EndpointPolicyImpl(ei, engine, requestor, null);   
-        List<Assertion> alternative = new ArrayList<Assertion>();
+        List<PolicyAssertion> alternative = new ArrayList<PolicyAssertion>();
         epi.setChosenAlternative(alternative);
-        Assertion ea = control.createMock(Assertion.class);        
+        PolicyAssertion ea = control.createMock(PolicyAssertion.class);        
         alternative.add(ea);
         EasyMock.expect(ea.isOptional()).andReturn(false);
-        Assertion eaOpt = control.createMock(Assertion.class);        
+        PolicyAssertion eaOpt = control.createMock(PolicyAssertion.class);        
         alternative.add(eaOpt);
         EasyMock.expect(eaOpt.isOptional()).andReturn(true);
         
@@ -216,7 +215,7 @@
         
         Policy op = control.createMock(Policy.class);
         EasyMock.expect(engine.getAggregatedOperationPolicy(boi)).andReturn(op);
-        Assertion oa = control.createMock(Assertion.class);
+        PolicyAssertion oa = control.createMock(PolicyAssertion.class);
         EasyMock.expect(engine.getAssertions(op, false)).andReturn(Collections.singletonList(oa));
         BindingMessageInfo bmi = control.createMock(BindingMessageInfo.class);
         if (requestor) {
@@ -226,21 +225,21 @@
         }
         Policy mp = control.createMock(Policy.class);
         EasyMock.expect(engine.getAggregatedMessagePolicy(bmi)).andReturn(mp);
-        Assertion ma = control.createMock(Assertion.class);
+        PolicyAssertion ma = control.createMock(PolicyAssertion.class);
         EasyMock.expect(engine.getAssertions(mp, false)).andReturn(Collections.singletonList(ma));
-        Assertion fa = null;
+        PolicyAssertion fa = null;
         if (requestor) {
             BindingFaultInfo bfi = control.createMock(BindingFaultInfo.class);
             EasyMock.expect(boi.getFaults()).andReturn(Collections.singletonList(bfi));
             Policy fp = control.createMock(Policy.class);
             EasyMock.expect(engine.getAggregatedFaultPolicy(bfi)).andReturn(fp);
-            fa = control.createMock(Assertion.class);
+            fa = control.createMock(PolicyAssertion.class);
             EasyMock.expect(engine.getAssertions(fp, false)).andReturn(Collections.singletonList(fa));
         }
         
         control.replay();
         epi.initializeVocabulary();
-        Collection<Assertion> expected = new ArrayList<Assertion>();
+        Collection<PolicyAssertion> expected = new ArrayList<PolicyAssertion>();
         expected.add(ea);
         expected.add(oa);
         expected.add(ma);
@@ -257,12 +256,13 @@
         control.verify();          
     }
     
-    private void verifyVocabulary(Collection<Assertion> expected, Collection<Assertion> actual) {
+    private void verifyVocabulary(Collection<PolicyAssertion> expected, 
+                                  Collection<PolicyAssertion> actual) {
         
         assertEquals(expected.size(), actual.size());
-        for (Iterator<Assertion> i = expected.iterator(); i.hasNext();) {
-            Assertion e = i.next();
-            Iterator<Assertion> j = actual.iterator();
+        for (Iterator<PolicyAssertion> i = expected.iterator(); i.hasNext();) {
+            PolicyAssertion e = i.next();
+            Iterator<PolicyAssertion> j = actual.iterator();
             boolean eFound = false;
             while (j.hasNext()) {
                 if (e == j.next()) {
@@ -299,12 +299,12 @@
             CastUtils.cast(pops.get(0).getPolicyComponents(), All.class);
         assertEquals("2 alternatives should be available", 2, alts.size());
         
-        List<Assertion> assertions1 = 
-            CastUtils.cast(alts.get(0).getAssertions(), Assertion.class);
+        List<PolicyAssertion> assertions1 = 
+            CastUtils.cast(alts.get(0).getAssertions(), PolicyAssertion.class);
         assertEquals("1 assertion should be available", 1, assertions1.size());
             
-        List<Assertion> assertions2 = 
-                CastUtils.cast(alts.get(1).getAssertions(), Assertion.class);
+        List<PolicyAssertion> assertions2 = 
+                CastUtils.cast(alts.get(1).getAssertions(), PolicyAssertion.class);
         assertEquals("1 assertion should be available", 1, assertions2.size());    
         
         QName n1 = assertions1.get(0).getName();
@@ -313,8 +313,8 @@
                    n1.equals(aqn1) && n2.equals(aqn2) || n1.equals(aqn2) && n2.equals(aqn1));
     }
     
-    private Assertion mockAssertion(QName name, int howMany, boolean normalize) {
-        Assertion a = control.createMock(Assertion.class);        
+    private PolicyAssertion mockAssertion(QName name, int howMany, boolean normalize) {
+        PolicyAssertion a = control.createMock(PolicyAssertion.class);        
         EasyMock.expect(a.getName()).andReturn(name).times(howMany);
         if (normalize) {
             EasyMock.expect(a.getType()).andReturn(Constants.TYPE_ASSERTION).times(howMany);
@@ -339,8 +339,8 @@
         PolicyEngineImpl engine = control.createMock(PolicyEngineImpl.class);
         
         EndpointPolicyImpl epi = new EndpointPolicyImpl(ei, engine, requestor, null);        
-        Collection<Assertion> v = new ArrayList<Assertion>();
-        Collection<Assertion> fv = new ArrayList<Assertion>();
+        Collection<PolicyAssertion> v = new ArrayList<PolicyAssertion>();
+        Collection<PolicyAssertion> fv = new ArrayList<PolicyAssertion>();
         QName aqn = new QName("http://x.y.z", "a");
         v.add(mockAssertion(aqn, requestor ? 2 : 1, false));
         v.add(mockAssertion(aqn, requestor ? 2 : 1, false));

Modified: incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyEngineTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyEngineTest.java?rev=629609&r1=629608&r2=629609&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyEngineTest.java (original)
+++ incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyEngineTest.java Wed Feb 20 12:40:27 2008
@@ -42,7 +42,6 @@
 import org.apache.cxf.transport.Conduit;
 import org.apache.cxf.transport.Destination;
 import org.apache.cxf.ws.policy.builder.primitive.PrimitiveAssertion;
-import org.apache.neethi.Assertion;
 import org.apache.neethi.Constants;
 import org.apache.neethi.Policy;
 import org.apache.neethi.PolicyComponent;
@@ -593,7 +592,7 @@
         Method m = PolicyEngineImpl.class.getDeclaredMethod("addAssertions",
             new Class[] {PolicyComponent.class, boolean.class, Collection.class});
         engine = control.createMock(PolicyEngineImpl.class, new Method[] {m});
-        Assertion a = control.createMock(Assertion.class);
+        PolicyAssertion a = control.createMock(PolicyAssertion.class);
         EasyMock.expect(a.getType()).andReturn(Constants.TYPE_ASSERTION);
         EasyMock.expect(a.isOptional()).andReturn(true);
         
@@ -606,7 +605,7 @@
         // EasyMock.expect(a.isOptional()).andReturn(false);
         
         control.replay();
-        Collection<Assertion> ca = engine.getAssertions(a, true);
+        Collection<PolicyAssertion> ca = engine.getAssertions(a, true);
         assertEquals(1, ca.size());
         assertSame(a, ca.iterator().next());
         control.verify();
@@ -615,7 +614,7 @@
         Policy p = control.createMock(Policy.class);
         EasyMock.expect(p.getType()).andReturn(Constants.TYPE_POLICY);
         engine.addAssertions(EasyMock.eq(p), EasyMock.eq(false), 
-                             CastUtils.cast(EasyMock.isA(Collection.class), Assertion.class));
+                             CastUtils.cast(EasyMock.isA(Collection.class), PolicyAssertion.class));
         EasyMock.expectLastCall();
         
         control.replay();
@@ -626,9 +625,9 @@
     @Test
     public void testAddAssertions() {
         engine = new PolicyEngineImpl();
-        Collection<Assertion> assertions = new ArrayList<Assertion>();
+        Collection<PolicyAssertion> assertions = new ArrayList<PolicyAssertion>();
         
-        Assertion a = control.createMock(Assertion.class);
+        PolicyAssertion a = control.createMock(PolicyAssertion.class);
         EasyMock.expect(a.getType()).andReturn(Constants.TYPE_ASSERTION);
         EasyMock.expect(a.isOptional()).andReturn(true);
         

Modified: incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyExtensionsTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyExtensionsTest.java?rev=629609&r1=629608&r2=629609&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyExtensionsTest.java (original)
+++ incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyExtensionsTest.java Wed Feb 20 12:40:27 2008
@@ -29,13 +29,11 @@
 import org.apache.cxf.Bus;
 import org.apache.cxf.BusFactory;
 import org.apache.cxf.bus.spring.SpringBusFactory;
-import org.apache.cxf.interceptor.AbstractAttributedInterceptorProvider;
 import org.apache.cxf.ws.policy.attachment.ServiceModelPolicyProvider;
 import org.apache.cxf.ws.policy.attachment.external.DomainExpressionBuilder;
 import org.apache.cxf.ws.policy.attachment.external.DomainExpressionBuilderRegistry;
 import org.apache.cxf.ws.policy.attachment.external.ExternalAttachmentProvider;
 import org.apache.cxf.ws.policy.attachment.wsdl11.Wsdl11AttachmentPolicyProvider;
-import org.apache.neethi.Assertion;
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -121,28 +119,22 @@
         public TestAssertionBuilder() {
             knownElements.add(KNOWN);
         }
-        public Assertion build(Element arg0) {
+        public PolicyAssertion build(Element arg0) {
             return null;
         }
 
         public Collection<QName> getKnownElements() {
             return knownElements;
         }
-        public Assertion buildCompatible(Assertion a, Assertion b) {
+        public PolicyAssertion buildCompatible(PolicyAssertion a, PolicyAssertion b) {
             return null;
         }       
     }
     
-    public static class TestPolicyInterceptorProvider extends AbstractAttributedInterceptorProvider 
-        implements PolicyInterceptorProvider {
-        Collection<QName> assertionTypes = new ArrayList<QName>();
-
+    public static class TestPolicyInterceptorProvider extends AbstractPolicyInterceptorProvider {
+        
         public TestPolicyInterceptorProvider() {
-            assertionTypes.add(KNOWN);
+            super(KNOWN);
         }
-
-        public Collection<QName> getAssertionTypes() {
-            return assertionTypes;
-        } 
     }
 }

Modified: incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyInterceptorsTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyInterceptorsTest.java?rev=629609&r1=629608&r2=629609&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyInterceptorsTest.java (original)
+++ incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyInterceptorsTest.java Wed Feb 20 12:40:27 2008
@@ -36,7 +36,6 @@
 import org.apache.cxf.service.model.FaultInfo;
 import org.apache.cxf.transport.Conduit;
 import org.apache.cxf.transport.Destination;
-import org.apache.neethi.Assertion;
 import org.easymock.classextension.EasyMock;
 import org.easymock.classextension.IMocksControl;
 import org.junit.Assert;
@@ -92,7 +91,8 @@
         EasyMock.expect(message.getInterceptorChain()).andReturn(ic);
         ic.add(i);
         EasyMock.expectLastCall();
-        Collection<Assertion> assertions = CastUtils.cast(Collections.EMPTY_LIST, Assertion.class);
+        Collection<PolicyAssertion> assertions = 
+            CastUtils.cast(Collections.EMPTY_LIST, PolicyAssertion.class);
         EasyMock.expect(effectivePolicy.getChosenAlternative()).andReturn(assertions);
         message.put(EasyMock.eq(AssertionInfoMap.class), EasyMock.isA(AssertionInfoMap.class));
         EasyMock.expectLastCall();
@@ -119,7 +119,8 @@
         EasyMock.expect(message.getInterceptorChain()).andReturn(ic);
         ic.add(i);
         EasyMock.expectLastCall();
-        Collection<Assertion> assertions = CastUtils.cast(Collections.EMPTY_LIST, Assertion.class);
+        Collection<PolicyAssertion> assertions = 
+            CastUtils.cast(Collections.EMPTY_LIST, PolicyAssertion.class);
         EasyMock.expect(endpointPolicy.getVocabulary()).andReturn(assertions);
         message.put(EasyMock.eq(AssertionInfoMap.class), EasyMock.isA(AssertionInfoMap.class));
         EasyMock.expectLastCall();
@@ -146,7 +147,8 @@
         EasyMock.expect(message.getInterceptorChain()).andReturn(ic);
         ic.add(i);
         EasyMock.expectLastCall();
-        Collection<Assertion> assertions = CastUtils.cast(Collections.EMPTY_LIST, Assertion.class);
+        Collection<PolicyAssertion> assertions = 
+            CastUtils.cast(Collections.EMPTY_LIST, PolicyAssertion.class);
         EasyMock.expect(endpointPolicy.getFaultVocabulary()).andReturn(assertions);
         message.put(EasyMock.eq(AssertionInfoMap.class), EasyMock.isA(AssertionInfoMap.class));
         EasyMock.expectLastCall();
@@ -173,7 +175,8 @@
         EasyMock.expect(message.getInterceptorChain()).andReturn(ic);
         ic.add(i);
         EasyMock.expectLastCall();
-        Collection<Assertion> assertions = CastUtils.cast(Collections.EMPTY_LIST, Assertion.class);
+        Collection<PolicyAssertion> assertions = 
+            CastUtils.cast(Collections.EMPTY_LIST, PolicyAssertion.class);
         EasyMock.expect(endpointPolicy.getVocabulary()).andReturn(assertions);
         message.put(EasyMock.eq(AssertionInfoMap.class), EasyMock.isA(AssertionInfoMap.class));
         EasyMock.expectLastCall();
@@ -201,7 +204,8 @@
         EasyMock.expect(message.getInterceptorChain()).andReturn(ic);
         ic.add(i);
         EasyMock.expectLastCall();
-        Collection<Assertion> assertions = CastUtils.cast(Collections.EMPTY_LIST, Assertion.class);
+        Collection<PolicyAssertion> assertions = 
+            CastUtils.cast(Collections.EMPTY_LIST, PolicyAssertion.class);
         EasyMock.expect(effectivePolicy.getChosenAlternative()).andReturn(assertions);
         message.put(EasyMock.eq(AssertionInfoMap.class), EasyMock.isA(AssertionInfoMap.class));
         EasyMock.expectLastCall();
@@ -246,7 +250,8 @@
         EasyMock.expect(message.getInterceptorChain()).andReturn(ic);
         ic.add(i);
         EasyMock.expectLastCall();
-        Collection<Assertion> assertions = CastUtils.cast(Collections.EMPTY_LIST, Assertion.class);
+        Collection<PolicyAssertion> assertions = 
+            CastUtils.cast(Collections.EMPTY_LIST, PolicyAssertion.class);
         EasyMock.expect(effectivePolicy.getChosenAlternative()).andReturn(assertions);
         message.put(EasyMock.eq(AssertionInfoMap.class), EasyMock.isA(AssertionInfoMap.class));
         EasyMock.expectLastCall();

Modified: incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/TestAssertion.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/TestAssertion.java?rev=629609&r1=629608&r2=629609&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/TestAssertion.java (original)
+++ incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/TestAssertion.java Wed Feb 20 12:40:27 2008
@@ -23,14 +23,14 @@
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamWriter;
 
-import org.apache.neethi.Assertion;
 import org.apache.neethi.Constants;
+import org.apache.neethi.Policy;
 import org.apache.neethi.PolicyComponent;
 
 /**
  * 
  */
-public class TestAssertion implements Assertion {
+public class TestAssertion implements PolicyAssertion {
     
     private QName name;
     private boolean optional;
@@ -64,5 +64,15 @@
 
     public short getType() {
         return Constants.TYPE_ASSERTION;
+    }
+
+    public Policy getPolicy() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public boolean isAsserted(AssertionInfoMap aim) {
+        // TODO Auto-generated method stub
+        return false;
     }
 }

Modified: incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/attachment/external/ExternalAttachmentProviderTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/attachment/external/ExternalAttachmentProviderTest.java?rev=629609&r1=629608&r2=629609&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/attachment/external/ExternalAttachmentProviderTest.java (original)
+++ incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/attachment/external/ExternalAttachmentProviderTest.java Wed Feb 20 12:40:27 2008
@@ -35,11 +35,11 @@
 import org.apache.cxf.service.model.BindingOperationInfo;
 import org.apache.cxf.service.model.EndpointInfo;
 import org.apache.cxf.service.model.ServiceInfo;
+import org.apache.cxf.ws.policy.PolicyAssertion;
 import org.apache.cxf.ws.policy.PolicyBuilder;
 import org.apache.cxf.ws.policy.PolicyConstants;
 import org.apache.cxf.ws.policy.PolicyException;
 import org.apache.cxf.ws.policy.builder.primitive.PrimitiveAssertion;
-import org.apache.neethi.Assertion;
 import org.apache.neethi.Policy;
 import org.easymock.classextension.EasyMock;
 import org.easymock.classextension.IMocksControl;
@@ -61,7 +61,7 @@
     
     private IMocksControl control;
     private Policy policy;
-    private Assertion assertion;
+    private PolicyAssertion assertion;
     private PolicyAttachment attachment;
     private Collection<PolicyAttachment> attachments = new ArrayList<PolicyAttachment>();
     

Modified: incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/builder/primitive/NestedPrimitiveAssertionTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/builder/primitive/NestedPrimitiveAssertionTest.java?rev=629609&r1=629608&r2=629609&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/builder/primitive/NestedPrimitiveAssertionTest.java (original)
+++ incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/builder/primitive/NestedPrimitiveAssertionTest.java Wed Feb 20 12:40:27 2008
@@ -29,10 +29,10 @@
 import org.apache.cxf.Bus;
 import org.apache.cxf.ws.policy.AssertionBuilderRegistry;
 import org.apache.cxf.ws.policy.AssertionBuilderRegistryImpl;
+import org.apache.cxf.ws.policy.PolicyAssertion;
 import org.apache.cxf.ws.policy.PolicyBuilderImpl;
 import org.apache.cxf.ws.policy.PolicyConstants;
 import org.apache.cxf.ws.policy.util.PolicyComparator;
-import org.apache.neethi.Assertion;
 import org.apache.neethi.Policy;
 import org.apache.neethi.PolicyComponent;
 import org.easymock.classextension.EasyMock;
@@ -106,7 +106,7 @@
         assertTrue(pc instanceof NestedPrimitiveAssertion);
         NestedPrimitiveAssertion npc = (NestedPrimitiveAssertion)pc;
         assertEquals(TEST_NAME1, npc.getName());
-        Policy nested = npc.getNested();
+        Policy nested = npc.getPolicy();
         assertTrue(nested.isEmpty());
     }
     
@@ -120,12 +120,14 @@
         assertTrue(pc instanceof NestedPrimitiveAssertion);
         NestedPrimitiveAssertion npc = (NestedPrimitiveAssertion)pc;
         assertEquals(TEST_NAME1, npc.getName());
-        Policy nested = npc.getNested();
+        Policy nested = npc.getPolicy();
         assertEquals(2, nested.getPolicyComponents().size());
-        Assertion a1 = (Assertion)(nested.getPolicyComponents().get(0));
+        PolicyAssertion a1 = 
+            (PolicyAssertion)(nested.getPolicyComponents().get(0));
         assertTrue(a1 instanceof PrimitiveAssertion);
         assertTrue(TEST_NAME2.equals(a1.getName()) || TEST_NAME3.equals(a1.getName()));
-        Assertion a2 = (Assertion)(nested.getPolicyComponents().get(0));
+        PolicyAssertion a2 = 
+            (PolicyAssertion)(nested.getPolicyComponents().get(0));
         assertTrue(a2 instanceof PrimitiveAssertion);
         assertTrue(TEST_NAME2.equals(a2.getName()) || TEST_NAME3.equals(a2.getName()));       
     }

Modified: incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/selector/FirstAlternativeSelectorTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/selector/FirstAlternativeSelectorTest.java?rev=629609&r1=629608&r2=629609&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/selector/FirstAlternativeSelectorTest.java (original)
+++ incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/selector/FirstAlternativeSelectorTest.java Wed Feb 20 12:40:27 2008
@@ -24,10 +24,10 @@
 import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.ws.policy.AlternativeSelector;
 import org.apache.cxf.ws.policy.Assertor;
+import org.apache.cxf.ws.policy.PolicyAssertion;
 import org.apache.cxf.ws.policy.PolicyEngine;
 import org.apache.cxf.ws.policy.TestAssertion;
 import org.apache.neethi.All;
-import org.apache.neethi.Assertion;
 import org.apache.neethi.ExactlyOne;
 import org.apache.neethi.Policy;
 import org.easymock.classextension.EasyMock;
@@ -58,10 +58,11 @@
         Policy policy = new Policy();
         ExactlyOne ea = new ExactlyOne();
         All all = new All();
-        Assertion a1 = new TestAssertion(); 
+        PolicyAssertion a1 = new TestAssertion(); 
         all.addAssertion(a1);
         ea.addPolicyComponent(all);
-        Collection<Assertion> firstAlternative = CastUtils.cast(all.getPolicyComponents(), Assertion.class);
+        Collection<PolicyAssertion> firstAlternative = 
+            CastUtils.cast(all.getPolicyComponents(), PolicyAssertion.class);
         policy.addPolicyComponent(ea);
         
         EasyMock.expect(engine.supportsAlternative(firstAlternative, assertor)).andReturn(false);
@@ -73,7 +74,7 @@
         control.reset();        
         EasyMock.expect(engine.supportsAlternative(firstAlternative, assertor)).andReturn(true);
         control.replay();         
-        Collection<Assertion> chosen = selector.selectAlternative(policy, engine, assertor); 
+        Collection<PolicyAssertion> chosen = selector.selectAlternative(policy, engine, assertor); 
         assertSame(1, chosen.size());
         assertSame(chosen.size(), firstAlternative.size());
         assertSame(chosen.iterator().next(), firstAlternative.iterator().next());
@@ -83,8 +84,8 @@
         All other = new All();
         other.addAssertion(a1);
         ea.addPolicyComponent(other);
-        Collection<Assertion> secondAlternative = 
-            CastUtils.cast(other.getPolicyComponents(), Assertion.class);
+        Collection<PolicyAssertion> secondAlternative = 
+            CastUtils.cast(other.getPolicyComponents(), PolicyAssertion.class);
         EasyMock.expect(engine.supportsAlternative(firstAlternative, assertor)).andReturn(false);
         EasyMock.expect(engine.supportsAlternative(secondAlternative, assertor)).andReturn(true);
         control.replay();        

Modified: incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/selector/MinimalMaximalAlternativeSelectorTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/selector/MinimalMaximalAlternativeSelectorTest.java?rev=629609&r1=629608&r2=629609&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/selector/MinimalMaximalAlternativeSelectorTest.java (original)
+++ incubator/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/selector/MinimalMaximalAlternativeSelectorTest.java Wed Feb 20 12:40:27 2008
@@ -24,10 +24,10 @@
 import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.ws.policy.AlternativeSelector;
 import org.apache.cxf.ws.policy.Assertor;
+import org.apache.cxf.ws.policy.PolicyAssertion;
 import org.apache.cxf.ws.policy.PolicyEngine;
 import org.apache.cxf.ws.policy.TestAssertion;
 import org.apache.neethi.All;
-import org.apache.neethi.Assertion;
 import org.apache.neethi.ExactlyOne;
 import org.apache.neethi.Policy;
 import org.easymock.classextension.EasyMock;
@@ -59,19 +59,22 @@
         Policy policy = new Policy();
         ExactlyOne ea = new ExactlyOne();
         All all = new All();
-        Assertion a1 = new TestAssertion(); 
+        PolicyAssertion a1 = new TestAssertion(); 
         all.addAssertion(a1);
         ea.addPolicyComponent(all);
-        Collection<Assertion> maxAlternative = CastUtils.cast(all.getPolicyComponents(), Assertion.class);
+        Collection<PolicyAssertion> maxAlternative = 
+            CastUtils.cast(all.getPolicyComponents(), PolicyAssertion.class);
         all = new All();
         ea.addPolicyComponent(all);
-        Collection<Assertion> minAlternative = CastUtils.cast(all.getPolicyComponents(), Assertion.class);
+        Collection<PolicyAssertion> minAlternative = 
+            CastUtils.cast(all.getPolicyComponents(), PolicyAssertion.class);
         policy.addPolicyComponent(ea);  
         EasyMock.expect(engine.supportsAlternative(maxAlternative, assertor)).andReturn(true);
         EasyMock.expect(engine.supportsAlternative(minAlternative, assertor)).andReturn(true);
         
         control.replay();        
-        Collection<Assertion> choice = selector.selectAlternative(policy, engine, assertor); 
+        Collection<PolicyAssertion> choice = 
+            selector.selectAlternative(policy, engine, assertor); 
         assertEquals(0, choice.size());
         control.verify();
     }
@@ -86,19 +89,21 @@
         Policy policy = new Policy();
         ExactlyOne ea = new ExactlyOne();
         All all = new All();
-        Assertion a1 = new TestAssertion(); 
+        PolicyAssertion a1 = new TestAssertion(); 
         all.addAssertion(a1);
         ea.addPolicyComponent(all);
-        Collection<Assertion> maxAlternative = CastUtils.cast(all.getPolicyComponents(), Assertion.class);
+        Collection<PolicyAssertion> maxAlternative = 
+            CastUtils.cast(all.getPolicyComponents(), PolicyAssertion.class);
         all = new All();
         ea.addPolicyComponent(all);
-        Collection<Assertion> minAlternative = CastUtils.cast(all.getPolicyComponents(), Assertion.class);
+        Collection<PolicyAssertion> minAlternative = 
+            CastUtils.cast(all.getPolicyComponents(), PolicyAssertion.class);
         policy.addPolicyComponent(ea);  
         EasyMock.expect(engine.supportsAlternative(maxAlternative, assertor)).andReturn(true);
         EasyMock.expect(engine.supportsAlternative(minAlternative, assertor)).andReturn(true);
         
         control.replay();        
-        Collection<Assertion> choice = selector.selectAlternative(policy, engine, assertor); 
+        Collection<PolicyAssertion> choice = selector.selectAlternative(policy, engine, assertor); 
         assertEquals(1, choice.size());
         assertSame(a1, choice.iterator().next());
         control.verify();

Modified: incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java?rev=629609&r1=629608&r2=629609&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java (original)
+++ incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/RMEndpoint.java Wed Feb 20 12:40:27 2008
@@ -50,11 +50,11 @@
 import org.apache.cxf.ws.addressing.Names;
 import org.apache.cxf.ws.policy.EffectivePolicy;
 import org.apache.cxf.ws.policy.EndpointPolicy;
+import org.apache.cxf.ws.policy.PolicyAssertion;
 import org.apache.cxf.ws.policy.PolicyEngine;
 import org.apache.cxf.ws.policy.PolicyInterceptorProviderRegistry;
 import org.apache.cxf.ws.rm.manager.SequenceTerminationPolicyType;
 import org.apache.cxf.ws.rm.manager.SourcePolicyType;
-import org.apache.neethi.Assertion;
 import org.apache.neethi.Policy;
 
 public class RMEndpoint {
@@ -585,7 +585,7 @@
             interceptors = reg.getInterceptors(endpointPolicy.getChosenAlternative(), outbound, fault);
         }
 
-        public Collection<Assertion> getChosenAlternative() {
+        public Collection<PolicyAssertion> getChosenAlternative() {
             return endpointPolicy.getChosenAlternative();
         }
 

Modified: incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RMAssertionBuilder.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RMAssertionBuilder.java?rev=629609&r1=629608&r2=629609&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RMAssertionBuilder.java (original)
+++ incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RMAssertionBuilder.java Wed Feb 20 12:40:27 2008
@@ -21,10 +21,10 @@
 
 import javax.xml.bind.JAXBException;
 
+import org.apache.cxf.ws.policy.PolicyAssertion;
 import org.apache.cxf.ws.policy.builder.jaxb.JaxbAssertion;
 import org.apache.cxf.ws.policy.builder.jaxb.JaxbAssertionBuilder;
 import org.apache.cxf.ws.rm.RMConstants;
-import org.apache.neethi.Assertion;
 import org.apache.neethi.Constants;
 import org.apache.neethi.PolicyComponent;
 
@@ -38,7 +38,7 @@
     }
 
     @Override
-    public Assertion buildCompatible(Assertion a, Assertion b) {
+    public PolicyAssertion buildCompatible(PolicyAssertion a, PolicyAssertion b) {
         if (RMConstants.getRMAssertionQName().equals(a.getName())
             && RMConstants.getRMAssertionQName().equals(b.getName())) {
             
@@ -70,15 +70,16 @@
         @Override
         public boolean equal(PolicyComponent policyComponent) {
             if (policyComponent.getType() != Constants.TYPE_ASSERTION
-                || !getName().equals(((Assertion)policyComponent).getName())) {
+                || !getName().equals(((PolicyAssertion)policyComponent).getName())) {
                 return false;
             }
-            JaxbAssertion<RMAssertion> other = JaxbAssertion.cast((Assertion)policyComponent);            
+            JaxbAssertion<RMAssertion> other = 
+                    JaxbAssertion.cast((PolicyAssertion)policyComponent);            
             return PolicyUtils.equals(this.getData(), other.getData());  
         }
         
         @Override
-        protected Assertion cloneMandatory() {
+        protected PolicyAssertion cloneMandatory() {
             RMPolicyAssertion a = new RMPolicyAssertion();
             a.setData(getData());
             return a;        

Modified: incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RMPolicyInterceptorProvider.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RMPolicyInterceptorProvider.java?rev=629609&r1=629608&r2=629609&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RMPolicyInterceptorProvider.java (original)
+++ incubator/cxf/trunk/rt/ws/rm/src/main/java/org/apache/cxf/ws/rm/policy/RMPolicyInterceptorProvider.java Wed Feb 20 12:40:27 2008
@@ -24,14 +24,12 @@
 import javax.xml.namespace.QName;
 
 import org.apache.cxf.Bus;
-import org.apache.cxf.interceptor.AbstractAttributedInterceptorProvider;
-import org.apache.cxf.ws.policy.PolicyInterceptorProvider;
+import org.apache.cxf.ws.policy.AbstractPolicyInterceptorProvider;
 import org.apache.cxf.ws.rm.RMInInterceptor;
 import org.apache.cxf.ws.rm.RMOutInterceptor;
 import org.apache.cxf.ws.rm.soap.RMSoapInterceptor;
 
-public class RMPolicyInterceptorProvider extends AbstractAttributedInterceptorProvider implements
-    PolicyInterceptorProvider {
+public class RMPolicyInterceptorProvider extends AbstractPolicyInterceptorProvider {
 
     private static final Collection<QName> ASSERTION_TYPES;
     private RMInInterceptor rmIn = new RMInInterceptor();
@@ -45,7 +43,7 @@
     }
 
     public RMPolicyInterceptorProvider(Bus bus) {
-        super();
+        super(ASSERTION_TYPES);
         rmIn.setBus(bus);
         rmOut.setBus(bus);
         
@@ -60,9 +58,5 @@
 
         getOutFaultInterceptors().add(rmOut);
         getOutFaultInterceptors().add(rmSoap);
-    }
-
-    public Collection<QName> getAssertionTypes() {
-        return ASSERTION_TYPES;
     }
 }

Modified: incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/AbstractRMInterceptorTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/AbstractRMInterceptorTest.java?rev=629609&r1=629608&r2=629609&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/AbstractRMInterceptorTest.java (original)
+++ incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/AbstractRMInterceptorTest.java Wed Feb 20 12:40:27 2008
@@ -31,7 +31,7 @@
 import org.apache.cxf.phase.Phase;
 import org.apache.cxf.ws.policy.AssertionInfo;
 import org.apache.cxf.ws.policy.AssertionInfoMap;
-import org.apache.neethi.Assertion;
+import org.apache.cxf.ws.policy.PolicyAssertion;
 import org.easymock.classextension.EasyMock;
 import org.easymock.classextension.IMocksControl;
 import org.junit.After;
@@ -146,7 +146,7 @@
         AssertionInfoMap aim = control.createMock(AssertionInfoMap.class);
         Collection<AssertionInfo> ais = new ArrayList<AssertionInfo>();
         EasyMock.expect(message.get(AssertionInfoMap.class)).andReturn(aim).times(2);
-        Assertion a = control.createMock(Assertion.class);        
+        PolicyAssertion a = control.createMock(PolicyAssertion.class);        
         AssertionInfo ai = new AssertionInfo(a);
         EasyMock.expectLastCall();
         control.replay();

Modified: incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMEndpointTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMEndpointTest.java?rev=629609&r1=629608&r2=629609&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMEndpointTest.java (original)
+++ incubator/cxf/trunk/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/RMEndpointTest.java Wed Feb 20 12:40:27 2008
@@ -45,9 +45,9 @@
 import org.apache.cxf.ws.addressing.Names;
 import org.apache.cxf.ws.policy.EffectivePolicy;
 import org.apache.cxf.ws.policy.EndpointPolicy;
+import org.apache.cxf.ws.policy.PolicyAssertion;
 import org.apache.cxf.ws.policy.PolicyEngine;
 import org.apache.cxf.ws.policy.PolicyInterceptorProviderRegistry;
-import org.apache.neethi.Assertion;
 import org.apache.neethi.Policy;
 import org.easymock.classextension.EasyMock;
 import org.easymock.classextension.IMocksControl;
@@ -285,7 +285,7 @@
         EasyMock.expect(ae.getEndpointInfo()).andReturn(aei);
         EndpointPolicy epi = control.createMock(EndpointPolicy.class);
         EasyMock.expect(pe.getServerEndpointPolicy(aei, null)).andReturn(epi);
-        EasyMock.expect(epi.getChosenAlternative()).andReturn(new ArrayList<Assertion>());
+        EasyMock.expect(epi.getChosenAlternative()).andReturn(new ArrayList<PolicyAssertion>());
 
         pe.setServerEndpointPolicy(ei, epi);
         EasyMock.expectLastCall();
@@ -338,7 +338,7 @@
     @Test
     public void testEffectivePolicyImpl() {
         EndpointPolicy ep = control.createMock(EndpointPolicy.class);
-        Collection<Assertion> alt = new ArrayList<Assertion>();
+        Collection<PolicyAssertion> alt = new ArrayList<PolicyAssertion>();
         EasyMock.expect(ep.getChosenAlternative()).andReturn(alt).times(2);
         PolicyInterceptorProviderRegistry reg = control.createMock(PolicyInterceptorProviderRegistry.class);
         List<Interceptor> li = new ArrayList<Interceptor>();



Mime
View raw message