public void testPolicySets() throws Exception {
ModelResolver resolver = new TestModelResolver(getClass().getClassLoader());
URL url = getClass().getResource("definitions_with_policysets.xml");
URI uri = URI.create("definitions_with_policysets.xml");
Definitions policyDefinitions = policyDefinitionsProcessor.read(null, uri, url, context);
InputStream is = getClass().getResourceAsStream("Calculator.composite");
XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
Composite composite = (Composite)staxProcessor.read(reader, context);
assertNotNull(composite);
for ( Component component : composite.getComponents() ) {
for ( PolicySet policySet : policyDefinitions.getPolicySets() ) {
component.getPolicySets().add(policySet);
}
}
staxProcessor.resolve(policyDefinitions, resolver, context);