Package org.apache.tuscany.sca.contribution.impl

Examples of org.apache.tuscany.sca.contribution.impl.ContributionFactoryImpl


            repository = new ContributionRepositoryImpl("target");
        } catch (IOException e) {
            throw new ActivationException(e);
        }

        ContributionFactory contributionFactory = new ContributionFactoryImpl();
        ExtensibleURLArtifactProcessor documentProcessor = new ExtensibleURLArtifactProcessor(documentProcessors);
        ContributionService contributionService = new ContributionServiceImpl(repository, packageProcessor,
                                                                              documentProcessor, assemblyFactory,
                                                                              contributionFactory, xmlFactory);
        return contributionService;
View Full Code Here


        factories.addFactory(assemblyFactory);
        PolicyFactory policyFactory = new DefaultPolicyFactory();
        factories.addFactory(policyFactory);
        SCABindingFactory scaBindingFactory = new DefaultSCABindingFactory();
        factories.addFactory(scaBindingFactory);
        ContributionFactory contributionFactory = new ContributionFactoryImpl();
        factories.addFactory(contributionFactory);
       
        // Create a contribution service
        contributionService = ReallySmallRuntimeBuilder.createContributionService(registry,
                                                                                  contributionFactory,
View Full Code Here

    private ModelResolver resolver;
    private ContributionFactory factory;
   
    protected void setUp() throws Exception {
        resolver = new ModelResolverImpl(getClass().getClassLoader());
        factory = new ContributionFactoryImpl();
    }
View Full Code Here

    }

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

        ContributionFactory factory = new ContributionFactoryImpl();
        ContributionMetadataLoaderImpl loader =
            new ContributionMetadataLoaderImpl(new DefaultAssemblyFactory(), factory);
        Contribution contribution = factory.createContribution();
        contribution.setModelResolver(new ModelResolverImpl(getClass().getClassLoader()));
        loader.load(contribution, reader);
        assertNotNull(contribution);
        assertEquals(1, contribution.getImports().size());
        assertEquals(1, contribution.getExports().size());
View Full Code Here

        assertEquals(2, contribution.getDeployables().size());
    }

    public void testLoadInvalid() throws Exception {
        XMLStreamReader reader = xmlFactory.createXMLStreamReader(new StringReader(INVALID_XML));
        ContributionFactory factory = new ContributionFactoryImpl();
        ContributionMetadataLoaderImpl loader =
            new ContributionMetadataLoaderImpl(new DefaultAssemblyFactory(), factory);
        Contribution contribution = factory.createContribution();
        contribution.setModelResolver(new ModelResolverImpl(getClass().getClassLoader()));
        try {
            loader.load(contribution, reader);
            fail("InvalidException should have been thrown");
        } catch (InvalidValueException e) {
View Full Code Here

        ContributionRepository repository = new ContributionRepositoryImpl("target");

        // Create an artifact resolver and contribution service
        this.contributionService = new ContributionServiceImpl(repository, packageProcessor, documentProcessor,
                                                               assemblyFactory,
                                                               new ContributionFactoryImpl(), XMLInputFactory
                                                                   .newInstance());
    }
View Full Code Here

        //new PrintUtil(System.out).print(constrainingType);
    }

    public void testReadComposite() throws Exception {
        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);
View Full Code Here

        staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(modelFactories);
        staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, XMLInputFactory.newInstance(), XMLOutputFactory.newInstance());
        javaFactory = new DefaultJavaInterfaceFactory();
        modelFactories.addFactory(javaFactory);

        staxProcessors.addArtifactProcessor(new CompositeProcessor(new ContributionFactoryImpl(), factory, policyFactory, mapper, staxProcessor));
        staxProcessors.addArtifactProcessor(new ComponentTypeProcessor(factory, policyFactory, staxProcessor));
        staxProcessors.addArtifactProcessor(new ConstrainingTypeProcessor(factory, policyFactory, staxProcessor));

        JavaInterfaceProcessor javaProcessor = new JavaInterfaceProcessor(modelFactories);
        staxProcessors.addArtifactProcessor(javaProcessor);
View Full Code Here

        staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, XMLInputFactory.newInstance(), XMLOutputFactory.newInstance());
       
        JavaImplementationFactory javaImplementationFactory = new DefaultJavaImplementationFactory();
        modelFactories.addFactory(javaImplementationFactory);
       
        CompositeProcessor compositeProcessor = new CompositeProcessor(new ContributionFactoryImpl(), assemblyFactory, policyFactory, mapper, staxProcessor);
        staxProcessors.addArtifactProcessor(compositeProcessor);

        JavaImplementationProcessor javaProcessor = new JavaImplementationProcessor(modelFactories);
        staxProcessors.addArtifactProcessor(javaProcessor);
    }
View Full Code Here

        assemblyFactory = null;
        mapper = null;
    }

    public void testReadComposite() throws Exception {
        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);
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.contribution.impl.ContributionFactoryImpl

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.