use of org.apache.cxf.ws.policy.PolicyProvider in project cxf by apache.
the class PolicyBeansTest method testParse.
@Test
public void testParse() {
Bus bus = new SpringBusFactory().createBus("org/apache/cxf/ws/policy/spring/beans.xml");
try {
PolicyEngine pe = bus.getExtension(PolicyEngine.class);
assertTrue("Policy engine is not enabled", pe.isEnabled());
assertTrue("Unknown assertions are not ignored", pe.isIgnoreUnknownAssertions());
assertEquals(MaximalAlternativeSelector.class.getName(), pe.getAlternativeSelector().getClass().getName());
PolicyEngineImpl pei = (PolicyEngineImpl) pe;
Collection<PolicyProvider> providers = pei.getPolicyProviders();
assertEquals(4, providers.size());
int n = 0;
for (PolicyProvider pp : providers) {
if (pp instanceof ExternalAttachmentProvider) {
n++;
}
}
assertEquals("Unexpected number of external providers", 2, n);
} finally {
bus.shutdown(true);
}
}
Aggregations