Examples of MostRecentRepositoryScanStatistics


Examples of org.apache.maven.archiva.database.constraints.MostRecentRepositoryScanStatistics

                }

                long sinceWhen = RepositoryScanner.FRESH_SCAN;

                List<RepositoryContentStatistics> results = (List<RepositoryContentStatistics>) dao.query(
                    new MostRecentRepositoryScanStatistics( arepo.getId() ) );

                if ( CollectionUtils.isNotEmpty( results ) )
                {
                    RepositoryContentStatistics lastStats = results.get( 0 );
                    if ( !repoTask.isScanAll() )
View Full Code Here

Examples of org.apache.maven.archiva.database.constraints.MostRecentRepositoryScanStatistics

                    throw new TaskExecutionException( "Unable to execute RepositoryTask with invalid repository id: " + repoTask.getRepositoryId() );
                }
   
                long sinceWhen = RepositoryScanner.FRESH_SCAN;
   
                List<RepositoryContentStatistics> results = (List<RepositoryContentStatistics>) dao.query( new MostRecentRepositoryScanStatistics( arepo.getId() ) );
   
                if ( CollectionUtils.isNotEmpty( results ) )
                {
                    RepositoryContentStatistics lastStats = results.get( 0 );
                    sinceWhen = lastStats.getWhenGathered().getTime() + lastStats.getDuration();
View Full Code Here

Examples of org.apache.maven.archiva.database.constraints.MostRecentRepositoryScanStatistics

        {
            ManagedRepositoryConfiguration arepo = archivaConfiguration.getConfiguration().findManagedRepositoryById( repoTask.getRepositoryId() );

            long sinceWhen = RepositoryScanner.FRESH_SCAN;

            List<RepositoryContentStatistics> results = dao.query( new MostRecentRepositoryScanStatistics( arepo.getId() ) );

            if ( CollectionUtils.isNotEmpty( results ) )
            {
                RepositoryContentStatistics lastStats = results.get( 0 );
                sinceWhen = lastStats.getWhenGathered().getTime() + lastStats.getDuration();
View Full Code Here

Examples of org.apache.maven.archiva.database.constraints.MostRecentRepositoryScanStatistics

        repositoryStatistics = new HashMap<String, RepositoryContentStatistics>();
        for ( ManagedRepositoryConfiguration repo : managedRepositories )
        {
            List<RepositoryContentStatistics> results =
                dao.query( new MostRecentRepositoryScanStatistics( repo.getId() ) );
            if ( !results.isEmpty() )
            {
                repositoryStatistics.put( repo.getId(), results.get( 0 ) );
            }
        }
View Full Code Here

Examples of org.apache.maven.archiva.database.constraints.MostRecentRepositoryScanStatistics

        repositoryStatistics = new HashMap<String, RepositoryContentStatistics>();
        for ( ManagedRepositoryConfiguration repo : managedRepositories )
        {
            List<RepositoryContentStatistics> results =
                dao.query( new MostRecentRepositoryScanStatistics( repo.getId() ) );
            if ( !results.isEmpty() )
            {
                repositoryStatistics.put( repo.getId(), results.get( 0 ) );
            }
        }
View Full Code Here

Examples of org.apache.maven.archiva.database.constraints.MostRecentRepositoryScanStatistics

        repositoryStatistics = new HashMap<String, RepositoryContentStatistics>();
        for ( ManagedRepositoryConfiguration repo : managedRepositories )
        {
            List<RepositoryContentStatistics> results =
                (List<RepositoryContentStatistics>) dao.query( new MostRecentRepositoryScanStatistics( repo.getId() ) );
            if ( !results.isEmpty() )
            {
                repositoryStatistics.put( repo.getId(), results.get( 0 ) );
            }
        }
View Full Code Here

Examples of org.apache.maven.archiva.database.constraints.MostRecentRepositoryScanStatistics

        assertEquals( "Incorrect number of unprocessed artifacts detected. No new artifacts should have been found.", 0,
                      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
View Full Code Here

Examples of org.apache.maven.archiva.database.constraints.MostRecentRepositoryScanStatistics

        assertEquals( "Incorrect number of unprocessed artifacts detected. One new artifact should have been found.", 1,
                      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
View Full Code Here

Examples of org.apache.maven.archiva.database.constraints.MostRecentRepositoryScanStatistics

        assertEquals( "Incorrect number of unprocessed artifacts detected. One new artifact should have been found.", 1,
                      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
View Full Code Here

Examples of org.apache.maven.archiva.database.constraints.MostRecentRepositoryScanStatistics

   
    @SuppressWarnings("unchecked")
    private boolean isPreviouslyScanned( ManagedRepositoryConfiguration repoConfig )
    {
        List<RepositoryScanStatistics> results =
            (List<RepositoryScanStatistics>) dao.query( new MostRecentRepositoryScanStatistics( repoConfig.getId() ) );

        if ( results != null && !results.isEmpty() )
        {
            return true;
        }
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.