Package org.apache.maven.archiva.model

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


        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", actualArtifactPaths.size(), stats.getTotalFileCount() );
        assertMinimumHits( "Processed Count", actualArtifactPaths.size(), consumer.getProcessCount() );
    }
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", actualMetadataPaths.size(), stats.getTotalFileCount() );
        assertMinimumHits( "Processed Count", actualMetadataPaths.size(), knownConsumer.getProcessCount() );
    }
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", actualProjectPaths.size(), stats.getTotalFileCount() );
        assertMinimumHits( "Processed Count", actualProjectPaths.size(), consumer.getProcessCount() );
    }
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", actualArtifactPaths.size(), stats.getTotalFileCount() );
        assertMinimumHits( "Processed Count", actualArtifactPaths.size(), consumer.getProcessCount() );
    }
View Full Code Here

{
    private RepositoryContentStatistics createStats( String repoId, String timestamp, long duration, long totalfiles,
                                                     long newfiles )
        throws Exception
    {
        RepositoryContentStatistics stats = new RepositoryContentStatistics();
        stats.setRepositoryId( repoId );
        stats.setDuration( duration );
        stats.setNewFileCount( newfiles );
        stats.setTotalFileCount( totalfiles );
        stats.setWhenGathered( toDate( timestamp ) );

        return stats;
    }
View Full Code Here

        assertNotNull( "Stats: results (not null)", results );
        assertEquals( "Stats: results.size", 1, results.size() );

        Object o = results.get( 0 );
        assertTrue( "Stats: result[0] instanceof RepositoryScanStatistics", o instanceof RepositoryContentStatistics );
        RepositoryContentStatistics stats = (RepositoryContentStatistics) o;
        assertEquals( "Stats: id", "internal", stats.getRepositoryId() );
        assertEquals( "Stats: when gathered", "2007/02/21 10:00:00", fromDate( stats.getWhenGathered() ) );
        assertEquals( "Stats: duration", 20000, stats.getDuration() );
        assertEquals( "Stats: total file count", 12000, stats.getTotalFileCount() );
        assertEquals( "Stats: new file count", 400, stats.getNewFileCount() );
    }
View Full Code Here

                      unprocessedResultList.size() );

        // check correctness of new stats
        List<RepositoryContentStatistics> results =
            (List<RepositoryContentStatistics>) dao.query( new MostRecentRepositoryScanStatistics( TEST_REPO_ID ) );
        RepositoryContentStatistics newStats = results.get( 0 );
        assertEquals( 0, newStats.getNewFileCount() );
        assertEquals( TEST_REPO_ID, newStats.getRepositoryId() );
        assertEquals( 31, newStats.getTotalFileCount() );
        // TODO: can't test these as they weren't stored in the database
//        assertEquals( 8, newStats.getTotalArtifactCount() );
//        assertEquals( 3, newStats.getTotalGroupCount() );
//        assertEquals( 5, newStats.getTotalProjectCount() );
        assertEquals( 14159, newStats.getTotalSize() );

        File newArtifactGroup = new File( repoDir, "org/apache/archiva" );

        FileUtils.copyDirectoryStructure( new File( getBasedir(), "target/test-classes/test-repo/org/apache/archiva" ),
                                          newArtifactGroup );

        // update last modified date
        new File( newArtifactGroup, "archiva-index-methods-jar-test/1.0/pom.xml" ).setLastModified(
            Calendar.getInstance().getTimeInMillis() + 1000 );
        new File( newArtifactGroup,
                  "archiva-index-methods-jar-test/1.0/archiva-index-methods-jar-test-1.0.jar" ).setLastModified(
            Calendar.getInstance().getTimeInMillis() + 1000 );

        assertTrue( newArtifactGroup.exists() );

        taskExecutor.executeTask( repoTask );

        unprocessedResultList = adao.queryArtifacts( new ArtifactsProcessedConstraint( false ) );
        assertNotNull( unprocessedResultList );
        assertEquals( "Incorrect number of unprocessed artifacts detected. One new artifact should have been found.", 1,
                      unprocessedResultList.size() );

        // check correctness of new stats
        results =
            (List<RepositoryContentStatistics>) dao.query( new MostRecentRepositoryScanStatistics( TEST_REPO_ID ) );
        RepositoryContentStatistics updatedStats = results.get( 0 );
        assertEquals( 2, updatedStats.getNewFileCount() );
        assertEquals( TEST_REPO_ID, updatedStats.getRepositoryId() );
        assertEquals( 33, updatedStats.getTotalFileCount() );
        // TODO: can't test these as they weren't stored in the database
//        assertEquals( 8, newStats.getTotalArtifactCount() );
//        assertEquals( 3, newStats.getTotalGroupCount() );
//        assertEquals( 5, newStats.getTotalProjectCount() );
        assertEquals( 19301, updatedStats.getTotalSize() );
    }
View Full Code Here

                      unprocessedResultList.size() );

        // check correctness of new stats
        List<RepositoryContentStatistics> results =
            (List<RepositoryContentStatistics>) dao.query( new MostRecentRepositoryScanStatistics( TEST_REPO_ID ) );
        RepositoryContentStatistics newStats = results.get( 0 );
        assertEquals( 2, newStats.getNewFileCount() );
        assertEquals( TEST_REPO_ID, newStats.getRepositoryId() );
        assertEquals( 33, newStats.getTotalFileCount() );
        // TODO: can't test these as they weren't stored in the database
//        assertEquals( 8, newStats.getTotalArtifactCount() );
//        assertEquals( 3, newStats.getTotalGroupCount() );
//        assertEquals( 5, newStats.getTotalProjectCount() );
        assertEquals( 19301, newStats.getTotalSize() );
    }
View Full Code Here

                      unprocessedResultList.size() );

        // check correctness of new stats
        List<RepositoryContentStatistics> results =
            (List<RepositoryContentStatistics>) dao.query( new MostRecentRepositoryScanStatistics( TEST_REPO_ID ) );
        RepositoryContentStatistics newStats = results.get( 0 );
        assertEquals( 2, newStats.getNewFileCount() );
        assertEquals( TEST_REPO_ID, newStats.getRepositoryId() );
        assertEquals( 33, newStats.getTotalFileCount() );
        // TODO: can't test these as they weren't stored in the database
//        assertEquals( 8, newStats.getTotalArtifactCount() );
//        assertEquals( 3, newStats.getTotalGroupCount() );
//        assertEquals( 5, newStats.getTotalProjectCount() );
        assertEquals( 19301, newStats.getTotalSize() );
    }
View Full Code Here

            Assert.assertEquals( RepositoryContentStatistics.class, constraint.getResultClass() );

            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

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.