ModelResolver resolver = new TestModelResolver(getClass().getClassLoader());
URL url = getClass().getResource("definitions_with_policysets.xml");
URI uri = URI.create("definitions_with_policysets.xml");
scaDefnDocProcessor.setDomainModelResolver(resolver);
SCADefinitions scaDefns = scaDefnDocProcessor.read(null, uri, url);
CompositeProcessor compositeProcessor = new CompositeProcessor(new ContributionFactoryImpl(), assemblyFactory, policyFactory, mapper, staxProcessor);
InputStream is = getClass().getResourceAsStream("Calculator.composite");
XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
Composite composite = compositeProcessor.read(reader);
assertNotNull(composite);
staxProcessor.resolve(scaDefns, resolver);
staxProcessor.resolve(composite, resolver);
CompositeBuilderImpl compositeUtil = new CompositeBuilderImpl(assemblyFactory, scaBindingFactory, intentAttachPointTypeFactory, mapper, scaDefns.getPolicySets(), null);
compositeUtil.build(composite);
//intents are computed and erased since there will be matching policysets
assertEquals(((PolicySetAttachPoint)composite.getComponents().get(0)).getRequiredIntents().size(), 0);
assertEquals(((PolicySetAttachPoint)composite.getComponents().get(5)).getRequiredIntents().size(), 0);