Package org.apache.maven.archiva.model

Examples of org.apache.maven.archiva.model.RepositoryContentStatistics


        List<InvalidRepositoryContentConsumer> invalidConsumers = new ArrayList<InvalidRepositoryContentConsumer>();
        InvalidScanConsumer badconsumer = new InvalidScanConsumer();
        invalidConsumers.add( badconsumer );

        RepositoryScanner scanner = lookupRepositoryScanner();
        RepositoryContentStatistics stats =
            scanner.scan( repository, knownConsumers, invalidConsumers, getIgnoreList(), RepositoryScanner.FRESH_SCAN );

        assertNotNull( "Stats should not be null.", stats );
        assertMinimumHits( "Stats.totalFileCount", actualProjectPaths.size(), stats.getTotalFileCount() );
        assertMinimumHits( "Processed Count", actualProjectPaths.size(), consumer.getProcessCount() );
    }
View Full Code Here


        List<InvalidRepositoryContentConsumer> invalidConsumers = new ArrayList<InvalidRepositoryContentConsumer>();
        InvalidScanConsumer badconsumer = new InvalidScanConsumer();
        invalidConsumers.add( badconsumer );

        RepositoryScanner scanner = lookupRepositoryScanner();
        RepositoryContentStatistics stats =
            scanner.scan( repository, knownConsumers, invalidConsumers, getIgnoreList(), RepositoryScanner.FRESH_SCAN );

        assertNotNull( "Stats should not be null.", stats );
        assertMinimumHits( "Stats.totalFileCount", actualArtifactPaths.size(), stats.getTotalFileCount() );
        assertMinimumHits( "Processed Count", actualArtifactPaths.size(), consumer.getProcessCount() );
    }
View Full Code Here

        throws ObjectNotFoundException, ArchivaDatabaseException
    {
        Assert.assertTrue( constraint instanceof RepositoryContentStatisticsByRepositoryConstraint );

        List<RepositoryContentStatistics> stats = new ArrayList<RepositoryContentStatistics>();
        RepositoryContentStatistics statistics = new RepositoryContentStatistics();
        statistics.setRepositoryId( "repo-ident" );
        stats.add( statistics );

        return stats;
    }
View Full Code Here

       

        List<RepositoryContentStatistics> stats = new ArrayList<RepositoryContentStatistics>();
        for ( String repo : configuration.getConfiguration().getManagedRepositoriesAsMap().keySet() )
        {
            RepositoryContentStatistics statistics = new RepositoryContentStatistics();
            statistics.setRepositoryId( repo );
            stats.add( statistics );
        }
        return stats;
    }
View Full Code Here

        dirWalker.addDirectoryWalkListener( scannerInstance );

        // Execute scan.
        dirWalker.scan();

        RepositoryContentStatistics stats = scannerInstance.getStatistics();

        ConsumerIdClosure consumerIdList;

        consumerIdList = new ConsumerIdClosure();
        CollectionUtils.forAllDo( knownContentConsumers, consumerIdList );
        stats.setKnownConsumers( consumerIdList.getList() );

        consumerIdList = new ConsumerIdClosure();
        CollectionUtils.forAllDo( invalidContentConsumers, consumerIdList );
        stats.setInvalidConsumers( consumerIdList.getList() );

        return stats;
    }
View Full Code Here

        dirWalker.addDirectoryWalkListener( scannerInstance );

        // Execute scan.
        dirWalker.scan();

        RepositoryContentStatistics stats = scannerInstance.getStatistics();

        ConsumerIdClosure consumerIdList;

        consumerIdList = new ConsumerIdClosure();
        CollectionUtils.forAllDo( knownContentConsumers, consumerIdList );
        stats.setKnownConsumers( consumerIdList.getList() );

        consumerIdList = new ConsumerIdClosure();
        CollectionUtils.forAllDo( invalidContentConsumers, consumerIdList );
        stats.setInvalidConsumers( consumerIdList.getList() );

        return stats;
    }
View Full Code Here

        RepositoryScanner scanner = (RepositoryScanner) plexus.lookup( RepositoryScanner.class );

        try
        {
            RepositoryContentStatistics stats = scanner.scan( repo, knownConsumerList, invalidConsumerList,
                                                              ignoredContent, RepositoryScanner.FRESH_SCAN );

            System.out.println( "\n" + stats.toDump( repo ) );
        }
        catch ( RepositoryException e )
        {
            e.printStackTrace( System.err );
        }
View Full Code Here

        dirWalker.addDirectoryWalkListener( scannerInstance );

        // Execute scan.
        dirWalker.scan();

        RepositoryContentStatistics stats = scannerInstance.getStatistics();

        ConsumerIdClosure consumerIdList;

        consumerIdList = new ConsumerIdClosure();
        CollectionUtils.forAllDo( knownContentConsumers, consumerIdList );
        stats.setKnownConsumers( consumerIdList.getList() );

        consumerIdList = new ConsumerIdClosure();
        CollectionUtils.forAllDo( invalidContentConsumers, consumerIdList );
        stats.setInvalidConsumers( consumerIdList.getList() );

        return stats;
    }
View Full Code Here

        this.logger = logger;

        this.consumerProcessFile = new ConsumerProcessFileClosure( logger );
        this.consumerWantsFile = new ConsumerWantsFilePredicate();

        stats = new RepositoryContentStatistics();
        stats.setRepositoryId( repository.getId() );

        Closure triggerBeginScan = new TriggerBeginScanClosure( repository, logger );

        CollectionUtils.forAllDo( knownConsumerList, triggerBeginScan );
View Full Code Here

        List invalidConsumers = new ArrayList();
        InvalidScanConsumer badconsumer = new InvalidScanConsumer();
        invalidConsumers.add( badconsumer );

        RepositoryScanner scanner = lookupRepositoryScanner();
        RepositoryContentStatistics stats = scanner.scan( repository, knownConsumers, invalidConsumers,
                                                          getIgnoreList(), RepositoryScanner.FRESH_SCAN );

        assertNotNull( "Stats should not be null.", stats );
        assertMinimumHits( "Stats.totalFileCount", 17, stats.getTotalFileCount() );
        assertMinimumHits( "Processed Count", 17, consumer.getProcessCount() );
        assertEquals( "Processed Count (of invalid items)", 6, badconsumer.getProcessCount() );
    }
View Full Code Here

TOP

Related Classes of org.apache.maven.archiva.model.RepositoryContentStatistics

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.