EasyMock.expect(reg.get(TEST_NAME2)).andReturn(ab1).anyTimes();
EasyMock.expect(reg.get(TEST_NAME3)).andReturn(ab2).anyTimes();
control.replay();
for (int i = 0; i < policies.length; i++) {
PolicyAssertion a =
(PolicyAssertion)policies[i].getFirstPolicyComponent();
PolicyAssertion compatible = npab.buildCompatible(a, a);
assertNotNull("assertion in policy " + i + " should be compatible with itself.", compatible);
}
for (int i = 1; i < 5; i++) {
PolicyAssertion a =
(PolicyAssertion)policies[0].getFirstPolicyComponent();
PolicyAssertion b = (PolicyAssertion)policies[i].getFirstPolicyComponent();
PolicyAssertion compatible = npab.buildCompatible(a, b);
assertNotNull("assertion in policy 0 should be compatible with assertion in policy " + i + ".",
compatible);
}
for (int i = 2; i < 5; i++) {
PolicyAssertion a =
(PolicyAssertion)policies[1].getFirstPolicyComponent();
PolicyAssertion b =
(PolicyAssertion)policies[i].getFirstPolicyComponent();
PolicyAssertion compatible = npab.buildCompatible(a, b);
assertNotNull("assertion in policy " + 1 + " should be compatible with assertion in policy i.",
compatible);
}
control.verify();