Examples of ArtifactStub


Examples of org.apache.maven.plugin.testing.stubs.ArtifactStub

    private Maven2OsgiConverter maven2Osgi = new DefaultMaven2OsgiConverter();

    public void testGetBundleSymbolicName()
    {
        ArtifactStub artifact = getTestArtifact();
        String s;
        s = maven2Osgi.getBundleSymbolicName( artifact );
        assertEquals( "org.apache.commons.logging", s );

        artifact.setGroupId( "org.apache.commons" );
        s = maven2Osgi.getBundleSymbolicName( artifact );
        assertEquals( "org.apache.commons.logging", s );

        artifact.setGroupId( "org.apache.commons.commons-logging" );
        s = maven2Osgi.getBundleSymbolicName( artifact );
        assertEquals( "org.apache.commons.commons-logging", s );

        artifact.setGroupId( "org.apache" );
        artifact.setArtifactId( "org.apache.commons-logging" );
        s = maven2Osgi.getBundleSymbolicName( artifact );
        assertEquals( "org.apache.commons-logging", s );

        artifact.setFile( getTestFile( "junit-3.8.2.jar" ) );
        artifact.setGroupId( "junit" );
        artifact.setArtifactId( "junit" );
        s = maven2Osgi.getBundleSymbolicName( artifact );
        assertEquals( "junit", s );

        artifact.setFile( getTestFile( "xml-apis-1.0.b2.jar" ) );
        artifact.setGroupId( "xml-apis" );
        artifact.setArtifactId( "a" );
        s = maven2Osgi.getBundleSymbolicName( artifact );
        assertEquals( "xml-apis.a", s );

        artifact.setFile( getTestFile( "test-1.jar" ) );
        artifact.setGroupId( "test" );
        artifact.setArtifactId( "test" );
        s = maven2Osgi.getBundleSymbolicName( artifact );
        assertEquals( "test", s );

        artifact.setFile( getTestFile( "xercesImpl-2.6.2.jar" ) );
        artifact.setGroupId( "xerces" );
        artifact.setArtifactId( "xercesImpl" );
        s = maven2Osgi.getBundleSymbolicName( artifact );
        assertEquals( "xerces.Impl", s );

        artifact.setFile( getTestFile( "aopalliance-1.0.jar" ) );
        artifact.setGroupId( "org.aopalliance" );
        artifact.setArtifactId( "aopalliance" );
        s = maven2Osgi.getBundleSymbolicName( artifact );
        assertEquals( "org.aopalliance", s );
    }
View Full Code Here

Examples of org.apache.maven.plugin.testing.stubs.ArtifactStub

        assertEquals( "org.aopalliance", s );
    }

    public void testGetBundleFileName()
    {
        ArtifactStub artifact = getTestArtifact();
        String s;
        s = maven2Osgi.getBundleFileName( artifact );
        assertEquals( "org.apache.commons.logging_1.1.0.jar", s );

        artifact.setGroupId( "org.aopalliance" );
        artifact.setArtifactId( "aopalliance" );
        s = maven2Osgi.getBundleFileName( artifact );
        assertEquals( "org.aopalliance_1.1.0.jar", s );
    }
View Full Code Here

Examples of org.apache.maven.plugin.testing.stubs.ArtifactStub

        assertEquals( "org.aopalliance_1.1.0.jar", s );
    }

    public void testGetVersion()
    {
        ArtifactStub artifact = getTestArtifact();
        String s = maven2Osgi.getVersion( artifact );
        assertEquals( "1.1.0", s );
    }
View Full Code Here

Examples of org.apache.maven.plugin.testing.stubs.ArtifactStub

        assertEquals( "0.0.0.4aug2000r7-dev", osgiVersion );
    }

    private ArtifactStub getTestArtifact()
    {
        ArtifactStub a = new ArtifactStub();
        a.setGroupId( "commons-logging" );
        a.setArtifactId( "commons-logging" );
        a.setVersion( "1.1" );
        a.setFile( getTestFile( "commons-logging-1.1.jar" ) );
        return a;
    }
View Full Code Here

Examples of org.apache.maven.plugin.testing.stubs.ArtifactStub

    }


    public void testSnapshotMatch()
    {
        ArtifactStub artifact = getArtifactStub();
        String bundleName;

        artifact.setVersion( "2.1-SNAPSHOT" );
        bundleName = "group.artifact_2.1.0.20070207_193904_2.jar";

        assertTrue( plugin.snapshotMatch( artifact, bundleName ) );

        artifact.setVersion( "2-SNAPSHOT" );
        assertFalse( plugin.snapshotMatch( artifact, bundleName ) );

        artifact.setArtifactId( "artifactx" );
        artifact.setVersion( "2.1-SNAPSHOT" );
        assertFalse( plugin.snapshotMatch( artifact, bundleName ) );
    }
View Full Code Here

Examples of org.apache.maven.plugin.testing.stubs.ArtifactStub

        if ( testFile.exists() )
        {
            testFile.delete();
        }

        ArtifactStub artifact = new ArtifactStub();
        artifact.setGroupId( "group" );
        artifact.setArtifactId( "artifact" );
        artifact.setVersion( "1.0.0.0" );

        MavenProject project = new MavenProjectStub();
        project.setGroupId( artifact.getGroupId() );
        project.setArtifactId( artifact.getArtifactId() );
        project.setVersion( artifact.getVersion() );
        project.setArtifact( artifact );
        project.setArtifacts( Collections.EMPTY_SET );
        project.setDependencyArtifacts( Collections.EMPTY_SET );
        File bundleFile = getTestFile( "src/test/resources/org.apache.maven.maven-model_2.1.0.SNAPSHOT.jar" );
        artifact.setFile( bundleFile );

        BundleInfo bundleInfo = plugin.bundle( project );

        Map exports = bundleInfo.getExportedPackages();
        String[] packages = new String[]
View Full Code Here

Examples of org.apache.maven.plugin.testing.stubs.ArtifactStub

    }


    protected ArtifactStub getArtifactStub()
    {
        ArtifactStub artifact = new ArtifactStub();
        artifact.setGroupId( "group" );
        artifact.setArtifactId( "artifact" );
        artifact.setVersion( "1.0" );
        return artifact;
    }
View Full Code Here

Examples of org.apache.maven.plugin.testing.stubs.ArtifactStub

        File testPom = new File( getBasedir(), pomXml );

        CompilerMojo mojo = (CompilerMojo) lookupMojo( "compile", testPom );

        setVariableValueToObject( mojo, "log", new DebugEnabledLog() );
        setVariableValueToObject( mojo, "projectArtifact", new ArtifactStub() );
        setVariableValueToObject( mojo, "classpathElements", Collections.EMPTY_LIST );

        assertNotNull( mojo );

        return mojo;
View Full Code Here

Examples of org.apache.maven.plugin.testing.stubs.ArtifactStub

        File testPom = new File( getBasedir(), pomXml );

        CompilerMojo mojo = (CompilerMojo) lookupMojo( "compile", testPom );

        setVariableValueToObject( mojo, "log", new DebugEnabledLog() );
        setVariableValueToObject( mojo, "projectArtifact", new ArtifactStub() );
        setVariableValueToObject( mojo, "classpathElements", Collections.EMPTY_LIST );
        setVariableValueToObject( mojo, "mavenSession", getMockMavenSession() );
        setVariableValueToObject( mojo, "mojoExecution", getMockMojoExecution() );

        assertNotNull( mojo );
View Full Code Here

Examples of org.apache.maven.plugin.testing.stubs.ArtifactStub

    private Maven2OsgiConverter maven2Osgi = new DefaultMaven2OsgiConverter();

    public void testGetBundleSymbolicName()
    {
        ArtifactStub artifact = getTestArtifact();
        String s;
        s = maven2Osgi.getBundleSymbolicName( artifact );
        assertEquals( "org.apache.commons.logging", s );

        artifact.setGroupId( "org.apache.commons" );
        s = maven2Osgi.getBundleSymbolicName( artifact );
        assertEquals( "org.apache.commons.logging", s );

        artifact.setGroupId( "org.apache.commons.commons-logging" );
        s = maven2Osgi.getBundleSymbolicName( artifact );
        assertEquals( "org.apache.commons.commons-logging", s );

        artifact.setGroupId( "org.apache" );
        artifact.setArtifactId( "org.apache.commons-logging" );
        s = maven2Osgi.getBundleSymbolicName( artifact );
        assertEquals( "org.apache.commons-logging", s );

        artifact.setFile( getTestFile( "junit-3.8.2.jar" ) );
        artifact.setGroupId( "junit" );
        artifact.setArtifactId( "junit" );
        s = maven2Osgi.getBundleSymbolicName( artifact );
        assertEquals( "junit", s );

        artifact.setFile( getTestFile( "xml-apis-1.0.b2.jar" ) );
        artifact.setGroupId( "xml-apis" );
        artifact.setArtifactId( "a" );
        s = maven2Osgi.getBundleSymbolicName( artifact );
        assertEquals( "xml-apis.a", s );

        artifact.setFile( getTestFile( "test-1.jar" ) );
        artifact.setGroupId( "test" );
        artifact.setArtifactId( "test" );
        s = maven2Osgi.getBundleSymbolicName( artifact );
        assertEquals( "test", s );

        artifact.setFile( getTestFile( "xercesImpl-2.6.2.jar" ) );
        artifact.setGroupId( "xerces" );
        artifact.setArtifactId( "xercesImpl" );
        s = maven2Osgi.getBundleSymbolicName( artifact );
        assertEquals( "xerces.Impl", s );

        artifact.setFile( getTestFile( "aopalliance-1.0.jar" ) );
        artifact.setGroupId( "org.aopalliance" );
        artifact.setArtifactId( "aopalliance" );
        s = maven2Osgi.getBundleSymbolicName( artifact );
        assertEquals( "org.aopalliance", s );
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.