Examples of KnownRepositoryContentConsumer


Examples of org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer

        assertNotNull( "Known Consumer Map should not be null", knownConsumerMap );
        assertEquals( "Known Consumer Map.size", expectedSelectedKnownIds.length, knownConsumerMap.size() );

        for ( String expectedId : expectedSelectedKnownIds )
        {
            KnownRepositoryContentConsumer consumer = knownConsumerMap.get( expectedId );
            assertNotNull( "Known[" + expectedId + "] should not be null.", consumer );
            assertEquals( "Known[" + expectedId + "].id", expectedId, consumer.getId() );
        }
    }
View Full Code Here

Examples of org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer

    }

    public void testConsumerByRetentionCount()
        throws Exception
    {
        KnownRepositoryContentConsumer repoPurgeConsumer = (KnownRepositoryContentConsumer) lookup(
            KnownRepositoryContentConsumer.class, "repo-purge-consumer-by-retention-count" );

        populateDbForRetentionCountTest();

        repoPurgeConsumer.beginScan( getRepository() );

        File testDir = new File( "target/test" );
        FileUtils.copyDirectoryToDirectory( new File( "target/test-classes/test-repo" ), testDir );

        repoPurgeConsumer.processFile( PATH_TO_BY_RETENTION_COUNT_ARTIFACT );

        // assert if removed from repo
        assertFalse( new File(
            "target/test/test-repo/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT/jruby-rake-plugin-1.0RC1-20070504.153317-1.jar" ).exists() );
        assertFalse( new File(
View Full Code Here

Examples of org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer

    public void testConsumerByDaysOld()
        throws Exception
    {
        populateDbForDaysOldTest();

        KnownRepositoryContentConsumer repoPurgeConsumer = (KnownRepositoryContentConsumer) lookup(
            KnownRepositoryContentConsumer.class, "repo-purge-consumer-by-days-old" );

        repoPurgeConsumer.beginScan( getRepository() );

        File testDir = new File( "target/test" );
        FileUtils.copyDirectoryToDirectory( new File( "target/test-classes/test-repo" ), testDir );

        setLastModified();

        repoPurgeConsumer.processFile( PATH_TO_BY_DAYS_OLD_ARTIFACT );

        assertFalse( new File(
            "target/test/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-SNAPSHOT.jar" ).exists() );
        assertFalse( new File(
            "target/test/test-repo/org/apache/maven/plugins/maven-install-plugin/2.2-SNAPSHOT/maven-install-plugin-2.2-SNAPSHOT.jar.md5" ).exists() );
View Full Code Here

Examples of org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer

    }

    public void testReleasedSnapshotsWereNotCleaned()
        throws Exception
    {
        KnownRepositoryContentConsumer repoPurgeConsumer = (KnownRepositoryContentConsumer) lookup(
            KnownRepositoryContentConsumer.class, "repo-purge-consumer-by-retention-count" );

        populateDbForReleasedSnapshotsTest();

        repoPurgeConsumer.beginScan( getRepository() );

        File testDir = new File( "target/test" );
        FileUtils.copyDirectoryToDirectory( new File( "target/test-classes/test-repo" ), testDir );

        repoPurgeConsumer.processFile( PATH_TO_RELEASED_SNAPSHOT );

        // check if the snapshot wasn't removed
        assertTrue(
            new File( "target/test/test-repo/org/apache/maven/plugins/maven-plugin-plugin/2.3-SNAPSHOT" ).exists() );
        assertTrue( new File(
View Full Code Here

Examples of org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer

    }

    public void testReleasedSnapshotsWereCleaned()
        throws Exception
    {
        KnownRepositoryContentConsumer repoPurgeConsumer = (KnownRepositoryContentConsumer) lookup(
            KnownRepositoryContentConsumer.class, "repo-purge-consumer-by-days-old" );

        populateDbForReleasedSnapshotsTest();

        repoPurgeConsumer.beginScan( getRepository() );

        File testDir = new File( "target/test" );
        FileUtils.copyDirectoryToDirectory( new File( "target/test-classes/test-repo" ), testDir );

        repoPurgeConsumer.processFile( PATH_TO_RELEASED_SNAPSHOT );

        // check if the snapshot was removed
        assertFalse(
            new File( "target/test/test-repo/org/apache/maven/plugins/maven-plugin-plugin/2.3-SNAPSHOT" ).exists() );
        assertFalse( new File(
View Full Code Here

Examples of org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer

        {
            boolean satisfies = false;

            if ( object instanceof KnownRepositoryContentConsumer )
            {
                KnownRepositoryContentConsumer known = (KnownRepositoryContentConsumer) object;
                RepositoryScanningConfiguration scanning = archivaConfiguration.getConfiguration()
                    .getRepositoryScanning();

                return scanning.getKnownContentConsumers().contains( known.getId() );
            }

            return satisfies;
        }
View Full Code Here

Examples of org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer

        {
            boolean satisfies = false;

            if ( object instanceof KnownRepositoryContentConsumer )
            {
                KnownRepositoryContentConsumer known = (KnownRepositoryContentConsumer) object;
                RepositoryScanningConfiguration scanning = archivaConfiguration.getConfiguration()
                    .getRepositoryScanning();

                return scanning.getKnownContentConsumers().contains( known.getId() );
            }

            return satisfies;
        }
View Full Code Here

Examples of org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer

        // trigger reload
        FileTypes fileTypes = (FileTypes) lookup( FileTypes.class );
        fileTypes.afterConfigurationChange( null, "repositoryScanning.fileTypes", null );

        KnownRepositoryContentConsumer repoPurgeConsumer =
            (KnownRepositoryContentConsumer) lookup( KnownRepositoryContentConsumer.class, "repository-purge" );

        File repoLocation = getTestFile( "target/test-" + getName() + "/test-repo" );

        File localFile =
View Full Code Here

Examples of org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer

    }

    public void testConsumerByRetentionCount()
        throws Exception
    {
        KnownRepositoryContentConsumer repoPurgeConsumer =
            (KnownRepositoryContentConsumer) lookup( KnownRepositoryContentConsumer.class,
                                                     "repo-purge-consumer-by-retention-count" );

        LuceneRepositoryContentIndexFactoryStub indexFactory = new LuceneRepositoryContentIndexFactoryStub();
        indexFactory.setExpectedRecordsSize( 2 );

        ( (RepositoryPurgeConsumer) repoPurgeConsumer ).setRepositoryContentIndexFactory( indexFactory );

        populateDbForRetentionCountTest();

        ManagedRepositoryConfiguration repoConfiguration = getRepoConfiguration();
        repoConfiguration.setDaysOlder( 0 ); // force days older off to allow retention count purge to execute.
        repoConfiguration.setRetentionCount( TEST_RETENTION_COUNT );
        addRepoToConfiguration( "retention-count", repoConfiguration );

        repoPurgeConsumer.beginScan( repoConfiguration );

        String repoRoot = prepareTestRepo();

        repoPurgeConsumer.processFile( PATH_TO_BY_RETENTION_COUNT_ARTIFACT );

        String versionRoot = repoRoot + "/org/jruby/plugins/jruby-rake-plugin/1.0RC1-SNAPSHOT";

        // assert if removed from repo
        assertDeleted( versionRoot + "/jruby-rake-plugin-1.0RC1-20070504.153317-1.jar" );
View Full Code Here

Examples of org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer

    public void testConsumerByDaysOld()
        throws Exception
    {
        populateDbForDaysOldTest();

        KnownRepositoryContentConsumer repoPurgeConsumer =
            (KnownRepositoryContentConsumer) lookup( KnownRepositoryContentConsumer.class,
                                                     "repo-purge-consumer-by-days-old" );

        LuceneRepositoryContentIndexFactoryStub indexFactory = new LuceneRepositoryContentIndexFactoryStub();
        indexFactory.setExpectedRecordsSize( 2 );

        ( (RepositoryPurgeConsumer) repoPurgeConsumer ).setRepositoryContentIndexFactory( indexFactory );

        ManagedRepositoryConfiguration repoConfiguration = getRepoConfiguration();
        repoConfiguration.setDaysOlder( TEST_DAYS_OLDER );
        addRepoToConfiguration( "days-old", repoConfiguration );

        repoPurgeConsumer.beginScan( repoConfiguration );

        String repoRoot = prepareTestRepo();
        String projectRoot = repoRoot + "/org/apache/maven/plugins/maven-install-plugin";

        setLastModified( projectRoot + "/2.2-SNAPSHOT" );

        repoPurgeConsumer.processFile( PATH_TO_BY_DAYS_OLD_ARTIFACT );

        assertDeleted( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-SNAPSHOT.jar" );
        assertDeleted( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-SNAPSHOT.jar.md5" );
        assertDeleted( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-SNAPSHOT.jar.sha1" );
        assertDeleted( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-SNAPSHOT.pom" );
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.