Package org.apache.maven.plugin.testing.stubs

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


        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

        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

        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

{
    /** {@inheritDoc} */
    public List<String> getCompileClasspathElements()
        throws DependencyResolutionRequiredException
    {
        throw new DependencyResolutionRequiredException( new ArtifactStub() );
    }
View Full Code Here

        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

    @Before
    public void setupSharedState() {

        // Create a correctly named implementation project Artifact
        fooImplementation = new ArtifactStub();
        fooImplementation.setGroupId("se.jguru.nazgul.foo.impl.something");
        fooImplementation.setArtifactId("foo-impl-something");
        fooImplementation.setVersion("1.0.0");
        fooImplementation.setScope(Artifact.SCOPE_COMPILE);
        fooImplementation.setType("bundle");
View Full Code Here

    @Test
    @SuppressWarnings("unchecked")
    public void validateNoEnforcementOfArtifactsWithIgnoredGroupIDs() throws Exception {

        // Assemble
        final ArtifactStub ignoredImplementationDependency = new ArtifactStub();
        ignoredImplementationDependency.setGroupId("se.jguru.nazgul.foo.generated.impl.something");
        ignoredImplementationDependency.setArtifactId("foo-impl-something");
        ignoredImplementationDependency.setVersion("1.0.0");
        ignoredImplementationDependency.setScope(Artifact.SCOPE_COMPILE);
        ignoredImplementationDependency.setType("bundle");

        final ArtifactStub nonIncludedDependency = new ArtifactStub();
        nonIncludedDependency.setGroupId("org.foobar.something");
        nonIncludedDependency.setArtifactId("something");
        nonIncludedDependency.setVersion("11.2");
        nonIncludedDependency.setScope(Artifact.SCOPE_COMPILE);
        nonIncludedDependency.setType("jar");

        fooApiProject.getDependencyArtifacts().add(ignoredImplementationDependency);
        fooApiProject.getDependencyArtifacts().add(nonIncludedDependency);

        // Act & Assert
View Full Code Here

    @Test(expected = EnforcerRuleException.class)
    @SuppressWarnings("unchecked")
    public void validateExceptionOnFindingApplicationDependenciesInAPIs() throws Exception {

        // Assemble
        final ArtifactStub ignoredImplementationDependency = new ArtifactStub();
        ignoredImplementationDependency.setGroupId("se.jguru.nazgul.foo");
        ignoredImplementationDependency.setArtifactId("fooWarApplicaion");
        ignoredImplementationDependency.setVersion("1.0.0");
        ignoredImplementationDependency.setScope(Artifact.SCOPE_COMPILE);
        ignoredImplementationDependency.setType("war");

        fooApiProject.getDependencyArtifacts().add(ignoredImplementationDependency);

        // Act & Assert
        unitUnderTest.execute(new MockEnforcerRuleHelper(fooApiProject));
View Full Code Here

    @Test(expected = EnforcerRuleException.class)
    @SuppressWarnings("unchecked")
    public void validateExceptionOnFindingTestUtilityDependenciesInAPIs() throws Exception {

        // Assemble
        final ArtifactStub ignoredImplementationDependency = new ArtifactStub();
        ignoredImplementationDependency.setGroupId("se.jguru.nazgul.test.foo");
        ignoredImplementationDependency.setArtifactId("foobar-test");
        ignoredImplementationDependency.setVersion("1.0.0");
        ignoredImplementationDependency.setScope(Artifact.SCOPE_COMPILE);
        ignoredImplementationDependency.setType("jar");

        fooApiProject.getDependencyArtifacts().add(ignoredImplementationDependency);

        // Act & Assert
        unitUnderTest.execute(new MockEnforcerRuleHelper(fooApiProject));
View Full Code Here

TOP

Related Classes of org.apache.maven.plugin.testing.stubs.ArtifactStub

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.