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

Examples of org.apache.tuscany.sca.contribution.processor.impl.JarContributionProcessor


public class JarContributionPackageProcessorTestCase extends TestCase {
    private static final String JAR_CONTRIBUTION = "/repository/sample-calculator.jar";
   
    public final void testProcessPackageArtifacts() throws Exception {
        JarContributionProcessor jarProcessor = new JarContributionProcessor();

        URL jarURL = getClass().getResource(JAR_CONTRIBUTION);
        InputStream jarStream = jarURL.openStream();
        List<URI> artifacts = null;
        try {
            artifacts = jarProcessor.getArtifacts(jarURL, jarStream);
        } finally {
            IOHelper.closeQuietly(jarStream);
        }
       
        assertNotNull(artifacts);
View Full Code Here


        PackageProcessorExtensionPoint packageProcessors = new DefaultPackageProcessorExtensionPoint();
        PackageProcessor packageProcessor = new ExtensiblePackageProcessor(packageProcessors, describer);
        registry.addExtensionPoint(packageProcessors);

        // Register base package processors
        packageProcessors.addPackageProcessor(new JarContributionProcessor());
        packageProcessors.addPackageProcessor(new FolderContributionProcessor());

        // Create a contribution repository
        ContributionRepository repository;
        try {
View Full Code Here

public class JarContributionPackageProcessorTestCase extends TestCase {
    private static final String JAR_CONTRIBUTION = "/repository/sample-calculator.jar";
   
    public final void testProcessPackageArtifacts() throws Exception {
        JarContributionProcessor jarProcessor = new JarContributionProcessor();

        URL jarURL = getClass().getResource(JAR_CONTRIBUTION);
        InputStream jarStream = jarURL.openStream();
        List<URI> artifacts = null;
        try {
            artifacts = jarProcessor.getArtifacts(jarURL, jarStream);
        } finally {
            IOHelper.closeQuietly(jarStream);
        }
       
        assertNotNull(artifacts);
View Full Code Here

                        bout.write(b);
                    }
                    bout.close();
                    ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
                   
                    PackageProcessor archiveProcessor = entry.getName().toLowerCase().endsWith(".war") ? new WarContributionProcessor() : new JarContributionProcessor();
                    List<URI> artifacts = archiveProcessor.getArtifacts(packageSourceURL, bin);
                    bin.close();
                    for(URI artifact : artifacts) {
                        // don't add in nested application composites
                        if ((artifact.toString().endsWith("ejb-jar.composite") == false) &&
View Full Code Here

                        bout.write(b);
                    }
                    bout.close();
                    ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
                   
                    PackageProcessor archiveProcessor = entry.getName().toLowerCase().endsWith(".war") ? new WarContributionProcessor() : new JarContributionProcessor();
                    List<URI> artifacts = archiveProcessor.getArtifacts(packageSourceURL, bin);
                    bin.close();
                    for(URI artifact : artifacts) {
                        names.add(entry.getName()+"!/"+artifact);
                    }
View Full Code Here

        PackageProcessorExtensionPoint packageProcessors = new DefaultPackageProcessorExtensionPoint();
        PackageProcessor packageProcessor = new ExtensiblePackageProcessor(packageProcessors, describer);
        registry.addExtensionPoint(packageProcessors);

        // Register base package processors
        packageProcessors.addPackageProcessor(new JarContributionProcessor());
        packageProcessors.addPackageProcessor(new FolderContributionProcessor());

        // Create a contribution repository
        ContributionRepository repository;
        try {
View Full Code Here

    protected void setUp() throws Exception {
        super.setUp();
    }
   
    public final void testProcessPackageArtifacts() throws Exception {
        JarContributionProcessor jarProcessor = new JarContributionProcessor();

        URL jarURL = getClass().getResource(JAR_CONTRIBUTION);
        InputStream jarStream = jarURL.openStream();
        List<URI> artifacts = null;
        try {
            artifacts = jarProcessor.getArtifacts(jarURL, jarStream);
        } finally {
            IOHelper.closeQuietly(jarStream);
        }
       
        assertNotNull(artifacts);
View Full Code Here

        PackageProcessorExtensionPoint packageProcessors = new DefaultPackageProcessorExtensionPoint();
        PackageProcessor packageProcessor = new ExtensiblePackageProcessor(packageProcessors, describer);
        extensionRegistry.addExtensionPoint(packageProcessors);

        // Register base package processors
        packageProcessors.addPackageProcessor(new JarContributionProcessor());
        packageProcessors.addPackageProcessor(new FolderContributionProcessor());

        // Create a repository
        ContributionRepository repository = new ContributionRepositoryImpl("target");
View Full Code Here

    @Override
    protected void setUp() throws Exception {
    }
   
    public final void testProcessPackageArtifacts() throws Exception {
        JarContributionProcessor jarProcessor = new JarContributionProcessor();

        URL jarURL = getClass().getResource(JAR_CONTRIBUTION);
        InputStream jarStream = jarURL.openStream();
        List<URI> artifacts = null;
        try {
            artifacts = jarProcessor.getArtifacts(jarURL, jarStream);
        } finally {
            IOHelper.closeQuietly(jarStream);
        }
       
        assertNotNull(artifacts);
View Full Code Here

                        bout.write(b);
                    }
                    bout.close();
                    ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
                   
                    PackageProcessor archiveProcessor = entry.getName().toLowerCase().endsWith(".war") ? new WarContributionProcessor() : new JarContributionProcessor();
                    List<URI> artifacts = archiveProcessor.getArtifacts(packageSourceURL, bin);
                    bin.close();
                    for(URI artifact : artifacts) {
                        names.add(entry.getName()+"!/"+artifact);
                    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.contribution.processor.impl.JarContributionProcessor

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.