Package org.apache.tuscany.sca.workspace.xml

Examples of org.apache.tuscany.sca.workspace.xml.WorkspaceProcessor


        // Create artifact processors
        inputFactory = modelFactories.getFactory(XMLInputFactory.class);
        StAXArtifactProcessorExtensionPoint staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(modelFactories);
        staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, outputFactory);
        staxProcessors.addArtifactProcessor(new ContributionMetadataProcessor(assemblyFactory, contributionFactory, staxProcessor));
        staxProcessors.addArtifactProcessor(new WorkspaceProcessor(workspaceFactory, contributionFactory, staxProcessor));
        staxProcessors.addArtifactProcessor(new CompositeProcessor(contributionFactory, assemblyFactory, policyFactory, staxProcessor));

        URLArtifactProcessorExtensionPoint urlProcessors = new DefaultURLArtifactProcessorExtensionPoint(modelFactories);
        urlProcessor = new ExtensibleURLArtifactProcessor(urlProcessors);
        urlProcessors.addArtifactProcessor(new ContributionMetadataDocumentProcessor(staxProcessor, inputFactory));
View Full Code Here


    public void testRead() throws Exception {
        XMLStreamReader reader = xmlFactory.createXMLStreamReader(new StringReader(VALID_XML));

        WorkspaceFactory workspaceFactory = new DefaultWorkspaceFactory();
        ContributionFactory contributionFactory = new DefaultContributionFactory();
        WorkspaceProcessor processor = new WorkspaceProcessor(workspaceFactory, contributionFactory, null);
        Workspace workspace = processor.read(reader);
        assertNotNull(workspace);
        assertEquals(2, workspace.getContributions().size());
        assertEquals("uri2", workspace.getContributions().get(1).getURI());
        assertEquals("location2", workspace.getContributions().get(1).getLocation());
  }
View Full Code Here

    public void testReadInvalid() throws Exception {
        XMLStreamReader reader = xmlFactory.createXMLStreamReader(new StringReader(INVALID_XML));
        WorkspaceFactory workspaceFactory = new DefaultWorkspaceFactory();
        ContributionFactory contributionFactory = new DefaultContributionFactory();
        WorkspaceProcessor processor = new WorkspaceProcessor(workspaceFactory, contributionFactory, null);
        try {
            processor.read(reader);
            fail("InvalidException should have been thrown");
        } catch (XMLStreamException e) {
            assertTrue(true);
        }
    }
View Full Code Here

        // Create artifact processors
        inputFactory = modelFactories.getFactory(XMLInputFactory.class);
        StAXArtifactProcessorExtensionPoint staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(modelFactories);
        staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, outputFactory);
        staxProcessors.addArtifactProcessor(new ContributionMetadataProcessor(assemblyFactory, contributionFactory, staxProcessor));
        staxProcessors.addArtifactProcessor(new WorkspaceProcessor(workspaceFactory, contributionFactory, staxProcessor));
        staxProcessors.addArtifactProcessor(new CompositeProcessor(contributionFactory, assemblyFactory, policyFactory, staxProcessor));

        URLArtifactProcessorExtensionPoint urlProcessors = new DefaultURLArtifactProcessorExtensionPoint(modelFactories);
        urlProcessor = new ExtensibleURLArtifactProcessor(urlProcessors);
        urlProcessors.addArtifactProcessor(new ContributionMetadataDocumentProcessor(staxProcessor, inputFactory));
View Full Code Here

    public void testRead() throws Exception {
        XMLStreamReader reader = xmlFactory.createXMLStreamReader(new StringReader(VALID_XML));

        WorkspaceFactory workspaceFactory = new DefaultWorkspaceFactory();
        ContributionFactory contributionFactory = new DefaultContributionFactory();
        WorkspaceProcessor processor = new WorkspaceProcessor(workspaceFactory, contributionFactory, null);
        Workspace workspace = processor.read(reader);
        assertNotNull(workspace);
        assertEquals(2, workspace.getContributions().size());
        assertEquals("uri2", workspace.getContributions().get(1).getURI());
        assertEquals("location2", workspace.getContributions().get(1).getLocation());
  }
View Full Code Here

    public void testReadInvalid() throws Exception {
        XMLStreamReader reader = xmlFactory.createXMLStreamReader(new StringReader(INVALID_XML));
        WorkspaceFactory workspaceFactory = new DefaultWorkspaceFactory();
        ContributionFactory contributionFactory = new DefaultContributionFactory();
        WorkspaceProcessor processor = new WorkspaceProcessor(workspaceFactory, contributionFactory, null);
        try {
            processor.read(reader);
            fail("InvalidException should have been thrown");
        } catch (XMLStreamException e) {
            assertTrue(true);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.workspace.xml.WorkspaceProcessor

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.