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

Examples of org.apache.tuscany.sca.contribution.resolver.impl.ModelResolverImpl


    }

    public void testStoreDuplicatedContributionInRepository() throws Exception {
        URL contributionLocation = getClass().getResource(JAR_CONTRIBUTION);
        String contributionId1 = CONTRIBUTION_001_ID;
        ModelResolver resolver = new ModelResolverImpl(getClass().getClassLoader());
        contributionService.contribute(contributionId1, contributionLocation, resolver, true);
        assertNotNull(contributionService.getContribution(contributionId1));
        String contributionId2 = CONTRIBUTION_002_ID;
        ModelResolver resolver2 = new ModelResolverImpl(getClass().getClassLoader());
        contributionService.contribute(contributionId2, contributionLocation, resolver2, true);
        assertNotNull(contributionService.getContribution(contributionId2));
    }
View Full Code Here


         //File metadataDirectory = new File("target/classes/META-INF/");
         //if (!metadataDirectory.exists()) {
         //    FileHelper.forceMkdir(metadataDirectory);
         //}
         //FileHelper.copyFileToDirectory(calculatorMetadataFile, metadataDirectory);
         ModelResolver resolver = new ModelResolverImpl(getClass().getClassLoader());
         contributionService.contribute(contributionId, rootContributionFolder.toURL(), resolver, false);
         assertNotNull(contributionService.getContribution(contributionId));
    }
View Full Code Here

    }

    public void testAddDeploymentComposites() throws Exception {
        URL contributionLocation = getClass().getResource(JAR_CONTRIBUTION);
        String contributionId = CONTRIBUTION_001_ID;
        ModelResolver resolver = new ModelResolverImpl(getClass().getClassLoader());
        Contribution contribution = contributionService.contribute(contributionId, contributionLocation, resolver, false);
        assertNotNull(contributionService.getContribution(contributionId));

        String artifactId = "contributionComposite.composite";
        Composite composite = (new DefaultAssemblyFactory()).createComposite();
View Full Code Here

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

            ModelResolver modelResolver = null;
           
            // if the contribution is to be resolved using a separate class loader
            // then create a new model resolver
            if (contributionClassLoader != null)  {
                modelResolver = new ModelResolverImpl(contributionClassLoader);
            }
           
            // Add the contribution to the node
            ContributionService contributionService = nodeRuntime.getContributionService();
            Contribution contribution = contributionService.contribute(contributionURI,
View Full Code Here

        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());
        assertEquals(2, contribution.getDeployables().size());
View Full Code Here

        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) {
            assertTrue(true);
View Full Code Here

public class ArtifactResolverTestCase extends TestCase {
   
    private ModelResolver resolver;
   
    protected void setUp() throws Exception {
        resolver = new ModelResolverImpl(getClass().getClassLoader());
    }
View Full Code Here

                ModelResolver modelResolver = null;
               
                // if the contribution is to be resolved using a separate class loader
                // then create a new model resolver
                if (contributionClassLoader != null)  {
                    modelResolver = new ModelResolverImpl(contributionClassLoader);
                }
               
                // Add the contribution to the node
                ContributionService contributionService = nodeRuntime.getContributionService();
                Contribution contribution = contributionService.contribute(contributionURI,
View Full Code Here

        AssemblyFactory assemblyFactory = new DefaultAssemblyFactory();
        ContributionFactory contributionFactory = new ContributionFactoryImpl();
        ContributionMetadataProcessor loader =
            new ContributionMetadataProcessor(assemblyFactory, contributionFactory, null);
        Contribution contribution = contributionFactory.createContribution();
        contribution.setModelResolver(new ModelResolverImpl(getClass().getClassLoader()));
        contribution = loader.read(reader);
        assertNotNull(contribution);
        assertEquals(2, contribution.getDeployables().size());
  }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.contribution.resolver.impl.ModelResolverImpl

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.