Package org.apache.tuscany.sca.definitions

Examples of org.apache.tuscany.sca.definitions.Definitions


        composite = (Composite)documentProcessor.read(null, uri, url);
        assertNotNull(composite);

        url = BuildPolicyTestCase.class.getResource("another_test_definitions.xml");
        uri = URI.create("another_test_definitions.xml");
        Definitions definitions = (Definitions)policyDefinitionsProcessor.read(null, uri, url);
        assertNotNull(definitions);
        policyDefinitions.add(definitions);

        documentProcessor.resolve(definitions, resolver);
        documentProcessor.resolve(composite, resolver);
View Full Code Here


        builders = extensionPoints.getExtensionPoint(BuilderExtensionPoint.class);
    }

    @Test
    public void testBuild() throws Exception {
        Definitions definitions = load("test_definitions.xml");
        Composite composite = load("Calculator.composite");
       
        CompositeBuilder uriBuilder = new StructuralURIBuilderImpl(extensionPoints);

        BuilderContext builderContext = new BuilderContext(extensionPoints);
View Full Code Here

        return model;
    }

    @Test
    public void testComplexBuild() throws Exception {
        Definitions definitions = load("definitions.xml");
        Composite composite1 = load("Composite1.composite");
        Composite composite2 = load("Composite2.composite");
        Composite composite3 = load("Composite3.composite");
        Composite composite4 = load("Composite4.composite");
        composite1.getIncludes().clear();
View Full Code Here

            URLArtifactProcessorExtensionPoint processors =
                registry.getExtensionPoint(URLArtifactProcessorExtensionPoint.class);
            URLArtifactProcessor<Definitions> processor = processors.getProcessor(Definitions.class);
            ProcessorContext context = new ProcessorContext(monitorFactory.createMonitor());
            for (URL url : documents) {
                Definitions def;
                try {
                    def = processor.read(null, DEFINITIONS_URI, url, context);
                    definitions.add(def);
                } catch (ContributionReadException e) {
                    logger.log(Level.SEVERE, e.getMessage(), e);
View Full Code Here

        XMLStreamReader reader = inputFactory.createXMLStreamReader(new StringReader(WS_POLICY1));
       
        artifact = processor.read(reader, new ProcessorContext());
        assertNotNull(artifact);
        Assert.assertTrue(artifact instanceof Definitions);
        Definitions definitions1 = (Definitions) artifact;

        // Read the second definitions string
       
        reader = inputFactory.createXMLStreamReader(new StringReader(WS_POLICY2));

        artifact = processor.read(reader, new ProcessorContext());
        assertNotNull(artifact);
        Assert.assertTrue(artifact instanceof Definitions);
        Definitions definitions2 = (Definitions) artifact; 
       
        // compare the policies using the policy builder
       
        // create dummy endpoints and endpoint references
        AssemblyFactory assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
View Full Code Here

        InputStream is = getClass().getResourceAsStream("TestAllCalculator.composite");
        Composite composite = staxProcessor.read(is, Composite.class, context);
       
        URL url = getClass().getResource("test_definitions.xml");
        URI uri = URI.create("test_definitions.xml");
        Definitions scaDefns = (Definitions)policyDefinitionsProcessor.read(null, uri, url, context);
        assertNotNull(scaDefns);
        policyDefinitionsProcessor.resolve(scaDefns, resolver, context);
       
        staxProcessor.resolve(composite, resolver, context);
        // compositeBuilder.build(composite, null, monitor);
View Full Code Here

    public void testPolicyIntents() throws Exception {
        ModelResolver resolver = new TestModelResolver(getClass().getClassLoader());
       
        URL url = getClass().getResource("definitions.xml");
        URI uri = URI.create("definitions.xml");
        Definitions scaDefns = 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);
View Full Code Here

    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);
View Full Code Here

        Composite composite = readComposite("TestAllCalculator.composite");
       
        URL url = getClass().getResource("test_definitions.xml");
        URI uri = URI.create("test_definitions.xml");
        Definitions scaDefns = (Definitions)policyDefinitionsProcessor.read(null, uri, url, context);
        assertNotNull(scaDefns);
       
        policyDefinitionsProcessor.resolve(scaDefns, resolver, context);
       
        staxProcessor.resolve(composite, resolver, context);
View Full Code Here

        composite = (Composite)documentProcessor.read(null, uri, url, context);
        assertNotNull(composite);

        url = BuildPolicyTestCase.class.getResource("test_definitions.xml");
        uri = URI.create("test_definitions.xml");
        Definitions definitions = (Definitions)policyDefinitionsProcessor.read(null, uri, url, context);
        assertNotNull(definitions);
        policyDefinitions.add(definitions);

        documentProcessor.resolve(definitions, resolver, context);
        documentProcessor.resolve(composite, resolver, context);
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.definitions.Definitions

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.