cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r830532 - in /cxf/trunk/rt/ws/policy/src: main/java/org/apache/cxf/ws/policy/ test/java/org/apache/cxf/ws/policy/
Date Wed, 28 Oct 2009 13:33:12 GMT
Author: dkulp
Date: Wed Oct 28 13:33:12 2009
New Revision: 830532

URL: http://svn.apache.org/viewvc?rev=830532&view=rev
Log:
[CXF-2499] Proper support for message level policies.
Patches from Christian Connert applied

Modified:
    cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EffectivePolicyImpl.java
    cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java
    cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/EffectivePolicyImplTest.java
    cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyEngineTest.java

Modified: cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EffectivePolicyImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EffectivePolicyImpl.java?rev=830532&r1=830531&r2=830532&view=diff
==============================================================================
--- cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EffectivePolicyImpl.java
(original)
+++ cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EffectivePolicyImpl.java
Wed Oct 28 13:33:12 2009
@@ -82,16 +82,16 @@
                     BindingOperationInfo boi, 
                     PolicyEngineImpl engine, 
                     Assertor assertor,
-                    boolean requestor) {
-        initialisePolicy(ei, boi, engine, requestor, assertor);
+                    boolean requestor, boolean request) {
+        initialisePolicy(ei, boi, engine, requestor, request, assertor);
         chooseAlternative(engine, assertor);
         initialiseInterceptors(engine, false);  
     }
     void initialise(EndpointInfo ei, 
                     BindingOperationInfo boi, 
                     PolicyEngineImpl engine, 
-                    boolean requestor) {
-        Assertor assertor = initialisePolicy(ei, boi, engine, requestor, null);
+                    boolean requestor, boolean request) {
+        Assertor assertor = initialisePolicy(ei, boi, engine, requestor, request, null);
         chooseAlternative(engine, assertor);
         initialiseInterceptors(engine, requestor);  
     }
@@ -108,13 +108,14 @@
     Assertor initialisePolicy(EndpointInfo ei,
                           BindingOperationInfo boi,  
                           PolicyEngineImpl engine, 
-                          boolean requestor,
+                          boolean requestor, boolean request,
                           Assertor assertor) {
         
         if (boi.isUnwrapped()) {
             boi = boi.getUnwrappedOperation();
         }
-        BindingMessageInfo bmi = requestor ? boi.getInput() : boi.getOutput();
+        
+        BindingMessageInfo bmi = request ? boi.getInput() : boi.getOutput();
         EndpointPolicy ep;
         if (requestor) {
             ep = engine.getClientEndpointPolicy(ei, (Conduit)assertor);

Modified: cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java?rev=830532&r1=830531&r2=830532&view=diff
==============================================================================
--- cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java (original)
+++ cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java Wed
Oct 28 13:33:12 2009
@@ -178,7 +178,7 @@
             if (c instanceof Assertor) {
                 assertor = (Assertor)c;
             }
-            epi.initialise(ei, boi, this, assertor, true);
+            epi.initialise(ei, boi, this, assertor, true, true);
             boi.setProperty(POLICY_INFO_REQUEST_CLIENT, epi);
             effectivePolicy = epi;
         }
@@ -200,7 +200,7 @@
             if (d instanceof Assertor) {
                 assertor = (Assertor)d;
             }
-            epi.initialise(ei, boi, this, assertor, false);
+            epi.initialise(ei, boi, this, assertor, false, false);
             boi.setProperty(POLICY_INFO_RESPONSE_SERVER, epi);
             effectivePolicy = epi;
         }
@@ -268,7 +268,7 @@
         EffectivePolicy effectivePolicy = (EffectivePolicy)boi.getProperty(POLICY_INFO_REQUEST_SERVER);
         if (null == effectivePolicy) {
             EffectivePolicyImpl epi = createOutPolicyInfo();
-            epi.initialise(ei, boi, this, false);
+            epi.initialise(ei, boi, this, false, true);
             boi.setProperty(POLICY_INFO_REQUEST_SERVER, epi);
             effectivePolicy = epi;
         }
@@ -284,7 +284,7 @@
         EffectivePolicy effectivePolicy = (EffectivePolicy)boi.getProperty(POLICY_INFO_RESPONSE_CLIENT);
         if (null == effectivePolicy) {
             EffectivePolicyImpl epi = createOutPolicyInfo();
-            epi.initialise(ei, boi, this, true);        
+            epi.initialise(ei, boi, this, true, true);        
             boi.setProperty(POLICY_INFO_RESPONSE_CLIENT, epi);
             effectivePolicy = epi;
         }

Modified: cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/EffectivePolicyImplTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/EffectivePolicyImplTest.java?rev=830532&r1=830531&r2=830532&view=diff
==============================================================================
--- cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/EffectivePolicyImplTest.java
(original)
+++ cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/EffectivePolicyImplTest.java
Wed Oct 28 13:33:12 2009
@@ -102,6 +102,7 @@
                          BindingOperationInfo.class, 
                          PolicyEngineImpl.class,
                          boolean.class,
+                         boolean.class,
                          Assertor.class});
         Method m2 = EffectivePolicyImpl.class.getDeclaredMethod("chooseAlternative",
             new Class[] {PolicyEngineImpl.class, Assertor.class});
@@ -115,7 +116,7 @@
         Assertor a = control.createMock(Assertor.class);
         boolean requestor = true;
        
-        effectivePolicy.initialisePolicy(ei, boi, pe, requestor, a);
+        effectivePolicy.initialisePolicy(ei, boi, pe, requestor, requestor, a);
         EasyMock.expectLastCall().andReturn(a);
         effectivePolicy.chooseAlternative(pe, a);
         EasyMock.expectLastCall();
@@ -123,7 +124,7 @@
         EasyMock.expectLastCall();
         
         control.replay();
-        effectivePolicy.initialise(ei, boi, pe, a, requestor);
+        effectivePolicy.initialise(ei, boi, pe, a, requestor, requestor);
         control.verify();        
     }
     
@@ -194,7 +195,7 @@
         
         control.replay();
         EffectivePolicyImpl epi = new EffectivePolicyImpl();
-        epi.initialisePolicy(ei, boi, engine, requestor, null);
+        epi.initialisePolicy(ei, boi, engine, requestor, requestor, null);
         assertSame(merged, epi.getPolicy());
         control.verify();
     }

Modified: cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyEngineTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyEngineTest.java?rev=830532&r1=830531&r2=830532&view=diff
==============================================================================
--- cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyEngineTest.java (original)
+++ cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyEngineTest.java Wed
Oct 28 13:33:12 2009
@@ -118,7 +118,7 @@
         AssertingConduit conduit = control.createMock(AssertingConduit.class);
         EffectivePolicyImpl epi = control.createMock(EffectivePolicyImpl.class);
         EasyMock.expect(engine.createOutPolicyInfo()).andReturn(epi);
-        epi.initialise(ei, boi, engine, conduit, true);
+        epi.initialise(ei, boi, engine, conduit, true, true);
         EasyMock.expectLastCall();
         control.replay();
         assertSame(epi, engine.getEffectiveClientRequestPolicy(ei, boi, conduit));
@@ -149,7 +149,7 @@
         AssertingDestination destination = control.createMock(AssertingDestination.class);
         EffectivePolicyImpl epi = control.createMock(EffectivePolicyImpl.class);
         EasyMock.expect(engine.createOutPolicyInfo()).andReturn(epi);
-        epi.initialise(ei, boi, engine, destination, false);
+        epi.initialise(ei, boi, engine, destination, false, false);
         EasyMock.expectLastCall();
         control.replay();
         assertSame(epi, engine.getEffectiveServerResponsePolicy(ei, boi, destination));
@@ -207,7 +207,7 @@
         BindingOperationInfo boi = createMockBindingOperationInfo(); 
         EffectivePolicyImpl epi = control.createMock(EffectivePolicyImpl.class);
         EasyMock.expect(engine.createOutPolicyInfo()).andReturn(epi);
-        epi.initialise(ei, boi, engine, false);
+        epi.initialise(ei, boi, engine, false, true);
         EasyMock.expectLastCall();
         control.replay();
         assertSame(epi, engine.getEffectiveServerRequestPolicy(ei, boi));
@@ -236,7 +236,7 @@
         BindingOperationInfo boi = createMockBindingOperationInfo(); 
         EffectivePolicyImpl epi = control.createMock(EffectivePolicyImpl.class);
         EasyMock.expect(engine.createOutPolicyInfo()).andReturn(epi);
-        epi.initialise(ei, boi, engine, true);
+        epi.initialise(ei, boi, engine, true, true);
         EasyMock.expectLastCall();
         control.replay();
         assertSame(epi, engine.getEffectiveClientResponsePolicy(ei, boi));



Mime
View raw message