List scaDefnSink = new ArrayList();
AssemblyFactory factory = new DefaultAssemblyFactory();
PolicyFactory policyFactory = new DefaultPolicyFactory();
resolver = new TestModelResolver();
compositeBuilder = new CompositeBuilderImpl(factory, new TestSCABindingFactoryImpl(), new DefaultIntentAttachPointTypeFactory(), new InterfaceContractMapperImpl(), null);
URLArtifactProcessorExtensionPoint documentProcessors = new DefaultURLArtifactProcessorExtensionPoint(new DefaultModelFactoryExtensionPoint());
documentProcessor = new ExtensibleURLArtifactProcessor(documentProcessors);
// Create Stax processors
DefaultStAXArtifactProcessorExtensionPoint staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(new DefaultModelFactoryExtensionPoint());
ExtensibleStAXArtifactProcessor staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, XMLInputFactory.newInstance(), XMLOutputFactory.newInstance());
staxProcessors.addArtifactProcessor(new CompositeProcessor(new DefaultContributionFactory(), factory, policyFactory, staxProcessor));
staxProcessors.addArtifactProcessor(new ComponentTypeProcessor(factory, policyFactory, staxProcessor));
staxProcessors.addArtifactProcessor(new ConstrainingTypeProcessor(factory, policyFactory, staxProcessor));
staxProcessors.addArtifactProcessor(new SCADefinitionsProcessor(policyFactory, staxProcessor, resolver));
staxProcessors.addArtifactProcessor(new SimpleIntentProcessor(policyFactory, staxProcessor));
staxProcessors.addArtifactProcessor(new ProfileIntentProcessor(policyFactory, staxProcessor));
staxProcessors.addArtifactProcessor(new QualifiedIntentProcessor(policyFactory, staxProcessor));
staxProcessors.addArtifactProcessor(new PolicySetProcessor(policyFactory, staxProcessor));
staxProcessors.addArtifactProcessor(new MockPolicyProcessor());
XMLInputFactory inputFactory = XMLInputFactory.newInstance();
// Create document processors
documentProcessors.addArtifactProcessor(new CompositeDocumentProcessor(staxProcessor, inputFactory, scaDefnSink));
documentProcessors.addArtifactProcessor(new ComponentTypeDocumentProcessor(staxProcessor, inputFactory));
documentProcessors.addArtifactProcessor(new ConstrainingTypeDocumentProcessor(staxProcessor, inputFactory));
scaDefnDocProcessor = new SCADefinitionsDocumentProcessor(staxProcessors, staxProcessor, inputFactory, policyFactory);
documentProcessors.addArtifactProcessor(scaDefnDocProcessor);
URL url = getClass().getResource("CalculatorComponent.constrainingType");
URI uri = URI.create("CalculatorComponent.constrainingType");
ConstrainingType constrainingType = (ConstrainingType)documentProcessor.read(null, uri, url);
assertNotNull(constrainingType);