You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2011/07/08 23:09:36 UTC
svn commit: r1144517 - in /cxf/branches/2.4.x-fixes: ./
api/src/main/java/org/apache/cxf/ws/policy/
rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/
rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/
Author: dkulp
Date: Fri Jul 8 21:09:35 2011
New Revision: 1144517
URL: http://svn.apache.org/viewvc?rev=1144517&view=rev
Log:
Merged revisions 1144515 via svnmerge from
https://svn.apache.org/repos/asf/cxf/trunk
........
r1144515 | dkulp | 2011-07-08 17:06:28 -0400 (Fri, 08 Jul 2011) | 2 lines
[CXF-3649] If its an application level fault, make sure policies are
considered.
........
Modified:
cxf/branches/2.4.x-fixes/ (props changed)
cxf/branches/2.4.x-fixes/api/src/main/java/org/apache/cxf/ws/policy/PolicyEngine.java
cxf/branches/2.4.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EffectivePolicyImpl.java
cxf/branches/2.4.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EndpointPolicyImpl.java
cxf/branches/2.4.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java
cxf/branches/2.4.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyVerificationInFaultInterceptor.java
cxf/branches/2.4.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/ServerPolicyOutFaultInterceptor.java
cxf/branches/2.4.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/EffectivePolicyImplTest.java
cxf/branches/2.4.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyEngineTest.java
cxf/branches/2.4.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyInterceptorsTest.java
cxf/branches/2.4.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyVerificationInFaultInterceptorTest.java
Propchange: cxf/branches/2.4.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified: cxf/branches/2.4.x-fixes/api/src/main/java/org/apache/cxf/ws/policy/PolicyEngine.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/api/src/main/java/org/apache/cxf/ws/policy/PolicyEngine.java?rev=1144517&r1=1144516&r2=1144517&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/api/src/main/java/org/apache/cxf/ws/policy/PolicyEngine.java (original)
+++ cxf/branches/2.4.x-fixes/api/src/main/java/org/apache/cxf/ws/policy/PolicyEngine.java Fri Jul 8 21:09:35 2011
@@ -63,7 +63,8 @@ public interface PolicyEngine {
void setEffectiveServerResponsePolicy(EndpointInfo ei, BindingOperationInfo boi, EffectivePolicy ep);
- EffectivePolicy getEffectiveServerFaultPolicy(EndpointInfo ei, BindingFaultInfo bfi, Destination d);
+ EffectivePolicy getEffectiveServerFaultPolicy(EndpointInfo ei, BindingOperationInfo boi,
+ BindingFaultInfo bfi, Destination d);
void setEffectiveServerFaultPolicy(EndpointInfo ei, BindingFaultInfo bfi, EffectivePolicy ep);
@@ -85,7 +86,9 @@ public interface PolicyEngine {
void setEffectiveClientResponsePolicy(EndpointInfo ei, BindingOperationInfo boi, EffectivePolicy ep);
- EffectivePolicy getEffectiveClientFaultPolicy(EndpointInfo ei, BindingFaultInfo bfi);
+ EffectivePolicy getEffectiveClientFaultPolicy(EndpointInfo ei,
+ BindingOperationInfo boi,
+ BindingFaultInfo bfi);
void setEffectiveClientFaultPolicy(EndpointInfo ei, BindingFaultInfo bfi, EffectivePolicy ep);
Modified: cxf/branches/2.4.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EffectivePolicyImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EffectivePolicyImpl.java?rev=1144517&r1=1144516&r2=1144517&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EffectivePolicyImpl.java (original)
+++ cxf/branches/2.4.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EffectivePolicyImpl.java Fri Jul 8 21:09:35 2011
@@ -98,10 +98,11 @@ public class EffectivePolicyImpl impleme
}
void initialise(EndpointInfo ei,
+ BindingOperationInfo boi,
BindingFaultInfo bfi,
PolicyEngineImpl engine,
Assertor assertor) {
- initialisePolicy(ei, bfi, engine);
+ initialisePolicy(ei, boi, bfi, engine);
chooseAlternative(engine, assertor);
initialiseInterceptors(engine, false);
}
@@ -136,11 +137,13 @@ public class EffectivePolicyImpl impleme
return assertor;
}
- void initialisePolicy(EndpointInfo ei, BindingFaultInfo bfi, PolicyEngineImpl engine) {
- BindingOperationInfo boi = bfi.getBindingOperation();
+ void initialisePolicy(EndpointInfo ei, BindingOperationInfo boi,
+ BindingFaultInfo bfi, PolicyEngineImpl engine) {
policy = engine.getServerEndpointPolicy(ei, (Destination)null).getPolicy();
policy = policy.merge(engine.getAggregatedOperationPolicy(boi));
- policy = policy.merge(engine.getAggregatedFaultPolicy(bfi));
+ if (bfi != null) {
+ policy = policy.merge(engine.getAggregatedFaultPolicy(bfi));
+ }
policy = (Policy)policy.normalize(engine.getRegistry(), true);
}
Modified: cxf/branches/2.4.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EndpointPolicyImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EndpointPolicyImpl.java?rev=1144517&r1=1144516&r2=1144517&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EndpointPolicyImpl.java (original)
+++ cxf/branches/2.4.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/EndpointPolicyImpl.java Fri Jul 8 21:09:35 2011
@@ -228,7 +228,7 @@ public class EndpointPolicyImpl implemen
}
if (boi.getFaults() != null && null != faultVocabulary) {
for (BindingFaultInfo bfi : boi.getFaults()) {
- p = engine.getEffectiveClientFaultPolicy(ei, bfi);
+ p = engine.getEffectiveClientFaultPolicy(ei, boi, bfi);
c = engine.getAssertions(p, false);
if (c != null) {
addAll(faultVocabulary, c);
Modified: cxf/branches/2.4.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java?rev=1144517&r1=1144516&r2=1144517&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java (original)
+++ cxf/branches/2.4.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyEngineImpl.java Fri Jul 8 21:09:35 2011
@@ -227,11 +227,21 @@ public class PolicyEngineImpl implements
boi.setProperty(POLICY_INFO_RESPONSE_SERVER, ep);
}
- public EffectivePolicy getEffectiveServerFaultPolicy(EndpointInfo ei, BindingFaultInfo bfi,
+ public EffectivePolicy getEffectiveServerFaultPolicy(EndpointInfo ei,
+ BindingOperationInfo boi,
+ BindingFaultInfo bfi,
Destination d) {
+ if (bfi == null) {
+ EffectivePolicyImpl epi = createOutPolicyInfo();
+ Assertor assertor = null;
+ if (d instanceof Assertor) {
+ assertor = (Assertor)d;
+ }
+ epi.initialise(ei, boi, bfi, this, assertor);
+ return epi;
+ }
bfi = mapToWrappedBindingFaultInfo(bfi);
-
EffectivePolicy effectivePolicy = (EffectivePolicy)bfi.getProperty(POLICY_INFO_FAULT_SERVER);
if (null == effectivePolicy) {
EffectivePolicyImpl epi = createOutPolicyInfo();
@@ -239,7 +249,7 @@ public class PolicyEngineImpl implements
if (d instanceof Assertor) {
assertor = (Assertor)d;
}
- epi.initialise(ei, bfi, this, assertor);
+ epi.initialise(ei, boi, bfi, this, assertor);
bfi.setProperty(POLICY_INFO_FAULT_SERVER, epi);
effectivePolicy = epi;
}
@@ -326,12 +336,18 @@ public class PolicyEngineImpl implements
boi.setProperty(POLICY_INFO_RESPONSE_CLIENT, ep);
}
- public EffectivePolicy getEffectiveClientFaultPolicy(EndpointInfo ei, BindingFaultInfo bfi) {
- EffectivePolicy effectivePolicy = (EffectivePolicy)bfi.getProperty(POLICY_INFO_FAULT_CLIENT);
+ public EffectivePolicy getEffectiveClientFaultPolicy(EndpointInfo ei, BindingOperationInfo boi,
+ BindingFaultInfo bfi) {
+ EffectivePolicy effectivePolicy = null;
+ if (bfi != null) {
+ effectivePolicy = (EffectivePolicy)bfi.getProperty(POLICY_INFO_FAULT_CLIENT);
+ }
if (null == effectivePolicy) {
EffectivePolicyImpl epi = createOutPolicyInfo();
- epi.initialisePolicy(ei, bfi, this);
- bfi.setProperty(POLICY_INFO_FAULT_CLIENT, epi);
+ epi.initialisePolicy(ei, boi, bfi, this);
+ if (bfi != null) {
+ bfi.setProperty(POLICY_INFO_FAULT_CLIENT, epi);
+ }
effectivePolicy = epi;
}
return effectivePolicy;
Modified: cxf/branches/2.4.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyVerificationInFaultInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyVerificationInFaultInterceptor.java?rev=1144517&r1=1144516&r2=1144517&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyVerificationInFaultInterceptor.java (original)
+++ cxf/branches/2.4.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/PolicyVerificationInFaultInterceptor.java Fri Jul 8 21:09:35 2011
@@ -92,16 +92,16 @@ public class PolicyVerificationInFaultIn
}
BindingFaultInfo bfi = getBindingFaultInfo(message, ex, boi);
- if (null == bfi) {
- LOG.fine("No binding fault info.");
+ if (bfi == null) {
return;
}
-
getTransportAssertions(message);
- EffectivePolicy effectivePolicy = pe.getEffectiveClientFaultPolicy(ei, bfi);
- aim.checkEffectivePolicy(effectivePolicy.getPolicy());
- LOG.fine("Verified policies for inbound message.");
+ EffectivePolicy effectivePolicy = pe.getEffectiveClientFaultPolicy(ei, boi, bfi);
+ if (effectivePolicy != null) {
+ aim.checkEffectivePolicy(effectivePolicy.getPolicy());
+ LOG.fine("Verified policies for inbound message.");
+ }
}
}
Modified: cxf/branches/2.4.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/ServerPolicyOutFaultInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/ServerPolicyOutFaultInterceptor.java?rev=1144517&r1=1144516&r2=1144517&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/ServerPolicyOutFaultInterceptor.java (original)
+++ cxf/branches/2.4.x-fixes/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/ServerPolicyOutFaultInterceptor.java Fri Jul 8 21:09:35 2011
@@ -29,6 +29,7 @@ import org.apache.cxf.common.logging.Log
import org.apache.cxf.endpoint.Endpoint;
import org.apache.cxf.interceptor.Interceptor;
import org.apache.cxf.message.Exchange;
+import org.apache.cxf.message.FaultMode;
import org.apache.cxf.message.Message;
import org.apache.cxf.message.MessageUtils;
import org.apache.cxf.phase.Phase;
@@ -83,12 +84,18 @@ public class ServerPolicyOutFaultInterce
assert null != ex;
BindingFaultInfo bfi = getBindingFaultInfo(msg, ex, boi);
- if (null == bfi) {
- LOG.fine("No binding fault info.");
+
+ if (bfi == null
+ && msg.get(FaultMode.class) != FaultMode.UNCHECKED_APPLICATION_FAULT
+ && msg.get(FaultMode.class) != FaultMode.CHECKED_APPLICATION_FAULT) {
return;
- }
+ }
+
- EffectivePolicy effectivePolicy = pe.getEffectiveServerFaultPolicy(ei, bfi, destination);
+ EffectivePolicy effectivePolicy = pe.getEffectiveServerFaultPolicy(ei, boi, bfi, destination);
+ if (effectivePolicy == null) {
+ return;
+ }
List<Interceptor<? extends Message>> interceptors = effectivePolicy.getInterceptors();
for (Interceptor<? extends Message> oi : interceptors) {
Modified: cxf/branches/2.4.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/EffectivePolicyImplTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/EffectivePolicyImplTest.java?rev=1144517&r1=1144516&r2=1144517&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/EffectivePolicyImplTest.java (original)
+++ cxf/branches/2.4.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/EffectivePolicyImplTest.java Fri Jul 8 21:09:35 2011
@@ -141,7 +141,8 @@ public class EffectivePolicyImplTest ext
@Test
public void testInitialiseFault() throws NoSuchMethodException {
Method m1 = EffectivePolicyImpl.class.getDeclaredMethod("initialisePolicy",
- new Class[] {EndpointInfo.class, BindingFaultInfo.class, PolicyEngineImpl.class});
+ new Class[] {EndpointInfo.class, BindingOperationInfo.class,
+ BindingFaultInfo.class, PolicyEngineImpl.class});
Method m2 = EffectivePolicyImpl.class.getDeclaredMethod("chooseAlternative",
new Class[] {PolicyEngineImpl.class, Assertor.class});
Method m3 = EffectivePolicyImpl.class.getDeclaredMethod("initialiseInterceptors",
@@ -153,7 +154,7 @@ public class EffectivePolicyImplTest ext
PolicyEngineImpl pe = new PolicyEngineImpl();
Assertor a = control.createMock(Assertor.class);
- effectivePolicy.initialisePolicy(ei, bfi, pe);
+ effectivePolicy.initialisePolicy(ei, null, bfi, pe);
EasyMock.expectLastCall();
effectivePolicy.chooseAlternative(pe, a);
EasyMock.expectLastCall();
@@ -161,7 +162,7 @@ public class EffectivePolicyImplTest ext
EasyMock.expectLastCall();
control.replay();
- effectivePolicy.initialise(ei, bfi, pe, a);
+ effectivePolicy.initialise(ei, null, bfi, pe, a);
control.verify();
}
@@ -217,7 +218,7 @@ public class EffectivePolicyImplTest ext
PolicyEngineImpl engine = control.createMock(PolicyEngineImpl.class);
BindingOperationInfo boi = control.createMock(BindingOperationInfo.class);
- EasyMock.expect(bfi.getBindingOperation()).andReturn(boi);
+ EasyMock.expect(bfi.getBindingOperation()).andReturn(boi).anyTimes();
EndpointPolicy endpointPolicy = control.createMock(EndpointPolicy.class);
EasyMock.expect(engine.getServerEndpointPolicy(ei, (Destination)null)).andReturn(endpointPolicy);
Policy ep = control.createMock(Policy.class);
@@ -233,7 +234,7 @@ public class EffectivePolicyImplTest ext
control.replay();
EffectivePolicyImpl epi = new EffectivePolicyImpl();
- epi.initialisePolicy(ei, bfi, engine);
+ epi.initialisePolicy(ei, boi, bfi, engine);
assertSame(merged, epi.getPolicy());
control.verify();
}
Modified: cxf/branches/2.4.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyEngineTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyEngineTest.java?rev=1144517&r1=1144516&r2=1144517&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyEngineTest.java (original)
+++ cxf/branches/2.4.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyEngineTest.java Fri Jul 8 21:09:35 2011
@@ -182,11 +182,11 @@ public class PolicyEngineTest extends As
AssertingDestination destination = control.createMock(AssertingDestination.class);
EffectivePolicyImpl epi = control.createMock(EffectivePolicyImpl.class);
EasyMock.expect(engine.createOutPolicyInfo()).andReturn(epi);
- epi.initialise(ei, bfi, engine, destination);
+ epi.initialise(ei, null, bfi, engine, destination);
EasyMock.expectLastCall();
control.replay();
- assertSame(epi, engine.getEffectiveServerFaultPolicy(ei, bfi, destination));
- assertSame(epi, engine.getEffectiveServerFaultPolicy(ei, bfi, destination));
+ assertSame(epi, engine.getEffectiveServerFaultPolicy(ei, null, bfi, destination));
+ assertSame(epi, engine.getEffectiveServerFaultPolicy(ei, null, bfi, destination));
control.verify();
}
@@ -197,7 +197,7 @@ public class PolicyEngineTest extends As
BindingFaultInfo bfi = new BindingFaultInfo(null, null);
EffectivePolicy epi = control.createMock(EffectivePolicy.class);
engine.setEffectiveServerFaultPolicy(ei, bfi, epi);
- assertSame(epi, engine.getEffectiveServerFaultPolicy(ei, bfi, (Destination)null));
+ assertSame(epi, engine.getEffectiveServerFaultPolicy(ei, null, bfi, (Destination)null));
}
@Test
@@ -267,11 +267,11 @@ public class PolicyEngineTest extends As
BindingFaultInfo bfi = new BindingFaultInfo(null, null);
EffectivePolicyImpl epi = control.createMock(EffectivePolicyImpl.class);
EasyMock.expect(engine.createOutPolicyInfo()).andReturn(epi);
- epi.initialisePolicy(ei, bfi, engine);
+ epi.initialisePolicy(ei, null, bfi, engine);
EasyMock.expectLastCall();
control.replay();
- assertSame(epi, engine.getEffectiveClientFaultPolicy(ei, bfi));
- assertSame(epi, engine.getEffectiveClientFaultPolicy(ei, bfi));
+ assertSame(epi, engine.getEffectiveClientFaultPolicy(ei, null, bfi));
+ assertSame(epi, engine.getEffectiveClientFaultPolicy(ei, null, bfi));
control.verify();
}
@@ -282,7 +282,7 @@ public class PolicyEngineTest extends As
BindingFaultInfo bfi = new BindingFaultInfo(null, null);
EffectivePolicy epi = control.createMock(EffectivePolicy.class);
engine.setEffectiveClientFaultPolicy(ei, bfi, epi);
- assertSame(epi, engine.getEffectiveClientFaultPolicy(ei, bfi));
+ assertSame(epi, engine.getEffectiveClientFaultPolicy(ei, null, bfi));
}
@Test
Modified: cxf/branches/2.4.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyInterceptorsTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyInterceptorsTest.java?rev=1144517&r1=1144516&r2=1144517&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyInterceptorsTest.java (original)
+++ cxf/branches/2.4.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyInterceptorsTest.java Fri Jul 8 21:09:35 2011
@@ -233,7 +233,7 @@ public class PolicyInterceptorsTest exte
BindingFaultInfo bfi = control.createMock(BindingFaultInfo.class);
EasyMock.expect(interceptor.getBindingFaultInfo(message, ex, boi)).andReturn(bfi);
EffectivePolicy effectivePolicy = control.createMock(EffectivePolicyImpl.class);
- EasyMock.expect(pe.getEffectiveServerFaultPolicy(ei, bfi, destination))
+ EasyMock.expect(pe.getEffectiveServerFaultPolicy(ei, boi, bfi, destination))
.andReturn(effectivePolicy);
List<Interceptor<? extends Message>> li = createMockInterceptorList();
EasyMock.expect(effectivePolicy.getInterceptors())
Modified: cxf/branches/2.4.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyVerificationInFaultInterceptorTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyVerificationInFaultInterceptorTest.java?rev=1144517&r1=1144516&r2=1144517&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyVerificationInFaultInterceptorTest.java (original)
+++ cxf/branches/2.4.x-fixes/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/PolicyVerificationInFaultInterceptorTest.java Fri Jul 8 21:09:35 2011
@@ -106,7 +106,7 @@ public class PolicyVerificationInFaultIn
interceptor.getTransportAssertions(message);
EasyMock.expectLastCall();
EffectivePolicyImpl effectivePolicy = control.createMock(EffectivePolicyImpl.class);
- EasyMock.expect(engine.getEffectiveClientFaultPolicy(ei, bfi)).andReturn(effectivePolicy);
+ EasyMock.expect(engine.getEffectiveClientFaultPolicy(ei, boi, bfi)).andReturn(effectivePolicy);
Policy policy = control.createMock(Policy.class);
EasyMock.expect(effectivePolicy.getPolicy()).andReturn(policy);
aim.checkEffectivePolicy(policy);