cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1310407 - in /cxf/branches/2.5.x-fixes/rt/ws/policy/src: main/java/org/apache/cxf/ws/policy/ test/java/org/apache/cxf/ws/policy/
Date Fri, 06 Apr 2012 15:44:47 GMT
Author: dkulp
Date: Fri Apr  6 15:44:47 2012
New Revision: 1310407

URL: http://svn.apache.org/viewvc?rev=1310407&view=rev
Log:
Fix compile and test failures

Modified:
    cxf/branches/2.5.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EffectivePolicyImpl.java
    cxf/branches/2.5.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/EffectivePolicyImplTest.java
    cxf/branches/2.5.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyInterceptorsTest.java

Modified: cxf/branches/2.5.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EffectivePolicyImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EffectivePolicyImpl.java?rev=1310407&r1=1310406&r2=1310407&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EffectivePolicyImpl.java
(original)
+++ cxf/branches/2.5.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EffectivePolicyImpl.java
Fri Apr  6 15:44:47 2012
@@ -220,18 +220,20 @@ public class EffectivePolicyImpl impleme
                                 boolean useIn,
                                  boolean fault) {
         QName qn = a.getName();
-        
+        PolicyInterceptorProvider pp = reg.get(qn);
         List<Interceptor<? extends org.apache.cxf.message.Message>> i = null;
         if (useIn & !fault) {
-            i = reg.getInInterceptorsForAssertion(qn);
+            i = pp.getInInterceptors();
         } else if (!useIn && !fault) {
-            i = reg.getOutInterceptorsForAssertion(qn);
+            i = pp.getOutInterceptors();
         } else if (useIn && fault) {
-            i = reg.getInFaultInterceptorsForAssertion(qn);
+            i = pp.getInFaultInterceptors();
         } else if (!useIn && fault) {
-            i = reg.getOutFaultInterceptorsForAssertion(qn);
+            i = pp.getOutFaultInterceptors();
+        }
+        if (i != null) {
+            out.addAll(i);
         }
-        out.addAll(i);
 
         if (a instanceof PolicyContainingAssertion) {
             Policy p = ((PolicyContainingAssertion)a).getPolicy();

Modified: cxf/branches/2.5.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/EffectivePolicyImplTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/EffectivePolicyImplTest.java?rev=1310407&r1=1310406&r2=1310407&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/EffectivePolicyImplTest.java
(original)
+++ cxf/branches/2.5.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/EffectivePolicyImplTest.java
Fri Apr  6 15:44:47 2012
@@ -299,6 +299,7 @@ public class EffectivePolicyImplTest ext
         
         PolicyEngineImpl engine = control.createMock(PolicyEngineImpl.class);
         PolicyInterceptorProviderRegistry reg = control.createMock(PolicyInterceptorProviderRegistry.class);
+        PolicyInterceptorProvider pp = control.createMock(PolicyInterceptorProvider.class);
         setupPolicyInterceptorProviderRegistry(engine, reg);
         
         control.replay();
@@ -310,7 +311,8 @@ public class EffectivePolicyImplTest ext
         setupPolicyInterceptorProviderRegistry(engine, reg);
 
         List<Interceptor<? extends Message>> m = new ArrayList<Interceptor<?
extends Message>>();
-        setupRegistryInterceptors(useIn, fault, reg, null, m);
+        EasyMock.expect(reg.get(null)).andReturn(pp);
+        setupRegistryInterceptors(useIn, fault, reg, pp, null, m);
         PolicyAssertion a = control.createMock(PolicyAssertion.class);        
         alternative.add(a);
         control.replay();
@@ -319,25 +321,25 @@ public class EffectivePolicyImplTest ext
         control.verify();
         
         control.reset();
-        setupPolicyInterceptorProviderRegistry(engine, reg);
         QName qn = new QName("http://x.y.z", "a");
         EasyMock.expect(a.getName()).andReturn(qn);
+        EasyMock.expect(reg.get(qn)).andReturn(pp);
+        setupPolicyInterceptorProviderRegistry(engine, reg);
         m = new ArrayList<Interceptor<? extends Message>>();
-        setupRegistryInterceptors(useIn, fault, reg, qn, m);
+        setupRegistryInterceptors(useIn, fault, reg, pp, qn, m);
         control.replay();
         epi.initialiseInterceptors(engine, useIn, fault);
         assertEquals(0, epi.getInterceptors().size());
         control.verify();
         
         control.reset();
-        setupPolicyInterceptorProviderRegistry(engine, reg);
         EasyMock.expect(a.getName()).andReturn(qn);        
-        PolicyInterceptorProvider pp = control.createMock(PolicyInterceptorProvider.class);
              
         EasyMock.expect(reg.get(qn)).andReturn(pp);
+        setupPolicyInterceptorProviderRegistry(engine, reg);
         Interceptor<Message> pi = control.createMock(Interceptor.class);
         m = new ArrayList<Interceptor<? extends Message>>();
         m.add(pi);
-        setupRegistryInterceptors(useIn, fault, reg, qn, m);
+        setupRegistryInterceptors(useIn, fault, reg, pp, qn, m);
         control.replay();
         epi.initialiseInterceptors(engine, useIn, fault);
         assertEquals(1, epi.getInterceptors().size());
@@ -346,19 +348,21 @@ public class EffectivePolicyImplTest ext
     }
 
     private void setupRegistryInterceptors(boolean useIn, boolean fault,
-                                           PolicyInterceptorProviderRegistry reg, QName qn,
+                                           PolicyInterceptorProviderRegistry reg,
+                                           PolicyInterceptorProvider pp,
+                                           QName qn,
                                            List<Interceptor<? extends Message>>
m) {
         if (useIn && !fault) {
-            EasyMock.expect(reg.getInInterceptorsForAssertion(qn))
+            EasyMock.expect(pp.getInInterceptors())
                 .andReturn(m);
         } else if (!useIn && !fault) {
-            EasyMock.expect(reg.getOutInterceptorsForAssertion(qn))
+            EasyMock.expect(pp.getOutInterceptors())
                 .andReturn(m);
         } else if (useIn && fault) {
-            EasyMock.expect(reg.getInFaultInterceptorsForAssertion(qn))
+            EasyMock.expect(pp.getInFaultInterceptors())
                 .andReturn(m);
         } else if (!useIn && fault) {
-            EasyMock.expect(reg.getOutFaultInterceptorsForAssertion(qn))
+            EasyMock.expect(pp.getOutFaultInterceptors())
                 .andReturn(m);
         }
     }

Modified: cxf/branches/2.5.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyInterceptorsTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyInterceptorsTest.java?rev=1310407&r1=1310406&r2=1310407&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyInterceptorsTest.java
(original)
+++ cxf/branches/2.5.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyInterceptorsTest.java
Fri Apr  6 15:44:47 2012
@@ -469,16 +469,19 @@ public class PolicyInterceptorsTest exte
         PolicyInterceptorProviderRegistry reg = control
             .createMock(PolicyInterceptorProviderRegistry.class);
         EasyMock.expect(bus.getExtension(PolicyInterceptorProviderRegistry.class)).andReturn(reg);
+        PolicyInterceptorProvider pp = control.createMock(PolicyInterceptorProvider.class);
+        EasyMock.expect(reg.get(ASSERTION_QNAME)).andReturn(pp);
+
         
         List<Interceptor<? extends Message>> li = createMockInterceptorList();
         if (in && fault) {
-            EasyMock.expect(reg.getInFaultInterceptorsForAssertion(ASSERTION_QNAME)).andReturn(li);
+            EasyMock.expect(pp.getInFaultInterceptors()).andReturn(li);
         } else if (!in && fault) {
-            EasyMock.expect(reg.getOutFaultInterceptorsForAssertion(ASSERTION_QNAME)).andReturn(li);
+            EasyMock.expect(pp.getOutFaultInterceptors()).andReturn(li);
         } else if (in && !fault) {
-            EasyMock.expect(reg.getInInterceptorsForAssertion(ASSERTION_QNAME)).andReturn(li);
+            EasyMock.expect(pp.getInInterceptors()).andReturn(li);
         } else if (!in && !fault) {
-            EasyMock.expect(reg.getOutInterceptorsForAssertion(ASSERTION_QNAME)).andReturn(li);
+            EasyMock.expect(pp.getOutInterceptors()).andReturn(li);
         }
         InterceptorChain ic = control.createMock(InterceptorChain.class);
         EasyMock.expect(message.getInterceptorChain()).andReturn(ic).anyTimes();



Mime
View raw message