Package org.apache.maven.plugin.testing

Examples of org.apache.maven.plugin.testing.ArtifactStubFactory


   
    public void testArtifactFilterWithClassifier() throws IOException, ArtifactFilterException
    {
        File outputFolder = new File( "target/filters/" );
        FileUtils.deleteDirectory( outputFolder );
        ArtifactStubFactory fact = new ArtifactStubFactory( outputFolder, false );
        Set artifacts = fact.getClassifiedArtifacts();
        FilterArtifacts fa = new FilterArtifacts();
        fa.addFilter( new ClassifierFilter( "", "four" ) );
        Set results = fa.filter( artifacts );
        assertEquals( 3, results.size() );
        fa.addFilter( new ClassifierFilter( "two,three", "" ) );
View Full Code Here


    protected void setUp()
        throws Exception
    {
        super.setUp();
        filterClass = ArtifactIdFilter.class;
        ArtifactStubFactory factory = new ArtifactStubFactory( null, false );
        artifacts = factory.getArtifactArtifacts();
    }
View Full Code Here

     * @throws IOException Signals that an I/O exception has occurred.
     */
    public void testMojo()
        throws IOException
    {
        ArtifactStubFactory factory = new ArtifactStubFactory();
        MockProject project = new MockProject();
        EnforcerRuleHelper helper = EnforcerTestUtils.getHelper( project );

        project.setArtifact( factory.getReleaseArtifact() );

        EnforcerRule rule = new RequireReleaseVersion();

        TestEnforcerRuleUtils.execute( rule, helper, false );

        project.setArtifact( factory.getSnapshotArtifact() );

        TestEnforcerRuleUtils.execute( rule, helper, true );

        project.setArtifact( factory.getReleaseArtifact() );

        MockProject parent = new MockProject();
        parent.setArtifact( factory.getSnapshotArtifact() );
        project.setParent( parent );
        helper = EnforcerTestUtils.getHelper(project);

        ( (RequireReleaseVersion) rule ).setFailWhenParentIsSnapshot( true );
        TestEnforcerRuleUtils.execute( rule, helper, true );
View Full Code Here

     * @throws IOException Signals that an I/O exception has occurred.
     */
    public void testRule()
        throws IOException
    {
        ArtifactStubFactory factory = new ArtifactStubFactory();
        MockProject project = new MockProject();
        EnforcerRuleHelper helper = EnforcerTestUtils.getHelper( project );
        project.setArtifacts( factory.getMixedArtifacts() );
        project.setDependencyArtifacts( factory.getScopedArtifacts() );
        BannedDependencies rule = new BannedDependencies();

        ArrayList excludes = new ArrayList();
        rule.setSearchTransitive( false );

View Full Code Here

     * @throws IOException Signals that an I/O exception has occurred.
     */
    public void testIncludes()
        throws IOException
    {
        ArtifactStubFactory factory = new ArtifactStubFactory();
        MockProject project = new MockProject();
        EnforcerRuleHelper helper = EnforcerTestUtils.getHelper( project );
        project.setArtifacts( factory.getMixedArtifacts() );
        project.setDependencyArtifacts( factory.getScopedArtifacts() );
        BannedDependencies rule = new BannedDependencies();

        ArrayList excludes = new ArrayList();
        ArrayList includes = new ArrayList();

View Full Code Here

        assertEquals( 0, rule.files.length );

        MockProject project = new MockProject();
        File f = File.createTempFile( "enforcer", "tmp" );
        f.deleteOnExit();
        ArtifactStubFactory factory = new ArtifactStubFactory();
        Artifact a = factory.getReleaseArtifact();
        a.setFile( f );

        project.setArtifact(a);

        // sanity check the mockProject
View Full Code Here

     */
    public void testRule()
        throws IOException
    {

        ArtifactStubFactory factory = new ArtifactStubFactory();
        MockProject project = new MockProject();
        EnforcerRuleHelper helper = EnforcerTestUtils.getHelper( project );
        project.setArtifacts( factory.getMixedArtifacts() );
        project.setDependencyArtifacts( factory.getScopedArtifacts() );
        NoSnapshots rule = new NoSnapshots();
        rule.setSearchTransitive( false );

        TestEnforcerRuleUtils.execute( rule, helper, false );

        rule.setSearchTransitive( true );

        TestEnforcerRuleUtils.execute( rule, helper, true );

        project.setArtifact( factory.getSnapshotArtifact() );

        TestEnforcerRuleUtils.execute( rule, helper, true );
    }
View Full Code Here

     */
    public void testRule()
        throws IOException
    {

        ArtifactStubFactory factory = new ArtifactStubFactory();
        MockProject project = new MockProject();
        EnforcerRuleHelper helper = EnforcerTestUtils.getHelper( project );
        project.setArtifacts( factory.getMixedArtifacts() );
        project.setDependencyArtifacts( factory.getScopedArtifacts() );
        RequireReleaseDeps rule = new RequireReleaseDeps();
        rule.setSearchTransitive( false );

        TestEnforcerRuleUtils.execute( rule, helper, false );

        rule.setSearchTransitive( true );

        TestEnforcerRuleUtils.execute( rule, helper, true );

        // test onlyWhenRelease in each case

        project.setArtifact( factory.getSnapshotArtifact() );

        TestEnforcerRuleUtils.execute( rule, helper, true );

        rule.onlyWhenRelease = true;

        TestEnforcerRuleUtils.execute( rule, helper, false );

        project.setArtifact( factory.getReleaseArtifact() );

        TestEnforcerRuleUtils.execute( rule, helper, true );

        MockProject parent = new MockProject();
        parent.setArtifact( factory.getSnapshotArtifact() );
        project.setParent( parent );
        project.setArtifacts( null );
        project.setDependencyArtifacts( null );
        helper = EnforcerTestUtils.getHelper(project);

View Full Code Here

TOP

Related Classes of org.apache.maven.plugin.testing.ArtifactStubFactory

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.