Examples of ArtifactsByRepositoryConstraint


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

        dbstats.setWhenGathered( stats.getWhenGathered() );

        // total artifact count
        // note that when gathered is the end of the scan, so we look for all those before that time
        dbstats.setTotalArtifactCount( dao.getArtifactDAO().countArtifacts(
            new ArtifactsByRepositoryConstraint( arepo.getId(), stats.getWhenGathered(), "groupId", true ) ) );

        // total repo size -- TODO: needs to exclude ignored files (eg .svn)
        long size = FileUtils.sizeOfDirectory( new File( arepo.getLocation() ) );
        dbstats.setTotalSize( size );
View Full Code Here

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

               
        // total artifact count
        try
        {
            List<ArchivaArtifact> artifacts = dao.getArtifactDAO().queryArtifacts(
                      new ArtifactsByRepositoryConstraint( arepo.getId(), stats.getWhenGathered(), "groupId", true ) );           
            dbstats.setTotalArtifactCount( artifacts.size() );
        }
        catch ( ObjectNotFoundException oe )
        {
            log.error( "Object not found in the database : " + oe.getMessage() );
View Full Code Here

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

    }

    private void cleanupDatabase( String repoId )
        throws ArchivaDatabaseException
    {
        Constraint constraint = new ArtifactsByRepositoryConstraint( repoId );

        List<ArchivaArtifact> artifacts = archivaDAO.getArtifactDAO().queryArtifacts( constraint );

        for ( ArchivaArtifact artifact : artifacts )
        {
View Full Code Here

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

       
        // get first page
        daoControl.expectAndReturn( dao.getArtifactDAO(), artifactDao );
       
        artifactDaoControl.expectAndReturn( artifactDao.queryArtifacts(
                new ArtifactsByRepositoryConstraint( REPO, RepositoryStatisticsReportGenerator.JAR_TYPE, endDate, "whenGathered") ), jarArtifacts, 5 );
       
        artifactDaoControl.expectAndReturn( artifactDao.queryArtifacts(
                new ArtifactsByRepositoryConstraint( REPO, RepositoryStatisticsReportGenerator.WAR_TYPE, endDate, "whenGathered") ), warArtifacts, 5 );
       
        artifactDaoControl.expectAndReturn( artifactDao.queryArtifacts(
                new ArtifactsByRepositoryConstraint( REPO, RepositoryStatisticsReportGenerator.MAVEN_PLUGIN, endDate, "whenGathered") ), mavenPlugins, 5 );

        artifactDaoControl.expectAndReturn( artifactDao.queryArtifacts(
                new ArtifactsByRepositoryConstraint( REPO, RepositoryStatisticsReportGenerator.EAR_TYPE, endDate, "whenGathered" ) ), earArtifacts, 5 );

        artifactDaoControl.expectAndReturn( artifactDao.queryArtifacts(
                new ArtifactsByRepositoryConstraint( REPO, RepositoryStatisticsReportGenerator.EXE_TYPE, endDate, "whenGathered" ) ), exeArtifacts, 5 );

        artifactDaoControl.expectAndReturn( artifactDao.queryArtifacts(
                new ArtifactsByRepositoryConstraint( REPO, RepositoryStatisticsReportGenerator.DLL_TYPE, endDate, "whenGathered" ) ), dllArtifacts, 5 );

        artifactDaoControl.expectAndReturn( artifactDao.queryArtifacts(
                new ArtifactsByRepositoryConstraint( REPO, RepositoryStatisticsReportGenerator.ZIP_TYPE, endDate, "whenGathered" ) ), zipArtifacts, 5 );

        daoControl.replay();
        artifactDaoControl.replay();
       
        List<RepositoryStatistics> data = generator.generateReport( repoContentStats, REPO, startDate, endDate, limits );
       
        daoControl.verify();
        artifactDaoControl.verify();
       
        assertEquals( 5, data.size() );
       
        RepositoryStatistics stats = (RepositoryStatistics) data.get( 0 );       
        assertEquals( REPO, stats.getRepositoryId() );
        assertEquals( 200, stats.getArtifactCount() );
        assertEquals( 5, stats.getJarCount() );
        assertEquals( 5, stats.getWarCount() );
        assertEquals( 5, stats.getPluginCount() );
        assertEquals( 5, stats.getEarCount() );
        assertEquals( 5, stats.getExeCount() );
        assertEquals( 5, stats.getDllCount() );
        assertEquals( 5, stats.getZipCount() );
        assertEquals( toDate( 2008, 11, 1, 0, 0, 0 ).getTime(), stats.getDateOfScan().getTime() );
        assertEquals( toDate( 2008, 9, 1, 0, 0, 0 ).getTime(), ( (RepositoryStatistics) data.get( 4 ) ).getDateOfScan().getTime() );
       
        // get last page
        limits.setCurrentPage( 5 );
       
        daoControl.reset();
        artifactDaoControl.reset();
       
        artifactDaoControl.setDefaultMatcher( new AlwaysMatcher() );
       
        daoControl.expectAndReturn( dao.getArtifactDAO(), artifactDao );
       
        artifactDaoControl.expectAndReturn( artifactDao.queryArtifacts(
                new ArtifactsByRepositoryConstraint( REPO, RepositoryStatisticsReportGenerator.JAR_TYPE, endDate, "whenGathered") ), jarArtifacts );
       
        artifactDaoControl.expectAndReturn( artifactDao.queryArtifacts(
                new ArtifactsByRepositoryConstraint( REPO, RepositoryStatisticsReportGenerator.WAR_TYPE, endDate, "whenGathered") ), warArtifacts );
       
        artifactDaoControl.expectAndReturn( artifactDao.queryArtifacts(
                new ArtifactsByRepositoryConstraint( REPO, RepositoryStatisticsReportGenerator.MAVEN_PLUGIN, endDate, "whenGathered") ), mavenPlugins );

        artifactDaoControl.expectAndReturn( artifactDao.queryArtifacts(
                new ArtifactsByRepositoryConstraint( REPO, RepositoryStatisticsReportGenerator.EAR_TYPE, endDate, "whenGathered" ) ), earArtifacts );

        artifactDaoControl.expectAndReturn( artifactDao.queryArtifacts(
                new ArtifactsByRepositoryConstraint( REPO, RepositoryStatisticsReportGenerator.EXE_TYPE, endDate, "whenGathered" ) ), exeArtifacts );

        artifactDaoControl.expectAndReturn( artifactDao.queryArtifacts(
                new ArtifactsByRepositoryConstraint( REPO, RepositoryStatisticsReportGenerator.DLL_TYPE, endDate, "whenGathered" ) ), dllArtifacts );

        artifactDaoControl.expectAndReturn( artifactDao.queryArtifacts(
                new ArtifactsByRepositoryConstraint( REPO, RepositoryStatisticsReportGenerator.ZIP_TYPE, endDate, "whenGathered" ) ), zipArtifacts );

        daoControl.replay();
        artifactDaoControl.replay();
       
        data = generator.generateReport( repoContentStats, REPO, startDate, endDate, limits );
View Full Code Here

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

       
        // get first page
        daoControl.expectAndReturn( dao.getArtifactDAO(), artifactDao );
       
        artifactDaoControl.expectAndReturn( artifactDao.queryArtifacts(
                new ArtifactsByRepositoryConstraint( REPO, RepositoryStatisticsReportGenerator.JAR_TYPE, endDate, "whenGathered") ), jarArtifacts, 21 );
       
        artifactDaoControl.expectAndReturn( artifactDao.queryArtifacts(
                new ArtifactsByRepositoryConstraint( REPO, RepositoryStatisticsReportGenerator.WAR_TYPE, endDate, "whenGathered") ), warArtifacts, 21 );
       
        artifactDaoControl.expectAndReturn( artifactDao.queryArtifacts(
                new ArtifactsByRepositoryConstraint( REPO, RepositoryStatisticsReportGenerator.MAVEN_PLUGIN, endDate, "whenGathered") ), mavenPlugins, 21 );

        artifactDaoControl.expectAndReturn( artifactDao.queryArtifacts(
                new ArtifactsByRepositoryConstraint( REPO, RepositoryStatisticsReportGenerator.EAR_TYPE, endDate, "whenGathered" ) ), earArtifacts, 21 );

        artifactDaoControl.expectAndReturn( artifactDao.queryArtifacts(
                new ArtifactsByRepositoryConstraint( REPO, RepositoryStatisticsReportGenerator.EXE_TYPE, endDate, "whenGathered" ) ), exeArtifacts, 21 );

        artifactDaoControl.expectAndReturn( artifactDao.queryArtifacts(
                new ArtifactsByRepositoryConstraint( REPO, RepositoryStatisticsReportGenerator.DLL_TYPE, endDate, "whenGathered" ) ), dllArtifacts, 21 );

        artifactDaoControl.expectAndReturn( artifactDao.queryArtifacts(
                new ArtifactsByRepositoryConstraint( REPO, RepositoryStatisticsReportGenerator.ZIP_TYPE, endDate, "whenGathered" ) ), zipArtifacts, 21 );

        daoControl.replay();
        artifactDaoControl.replay();
       
        List<RepositoryStatistics> data = generator.generateReport( repoContentStats, REPO, startDate, endDate, false );
View Full Code Here

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

        List<RepositoryContentStatistics> repoContentStats = createStatisticsHistoryForSingleRepositoryTest( REPO );
               
        daoControl.expectAndReturn( dao.getArtifactDAO(), artifactDao );
       
        artifactDaoControl.expectAndReturn( artifactDao.queryArtifacts(
                new ArtifactsByRepositoryConstraint( REPO, RepositoryStatisticsReportGenerator.JAR_TYPE, endDate, "whenGathered") ), jarArtifacts, 5 );
       
        artifactDaoControl.expectAndReturn( artifactDao.queryArtifacts(
                new ArtifactsByRepositoryConstraint( REPO, RepositoryStatisticsReportGenerator.WAR_TYPE, endDate, "whenGathered") ), warArtifacts, 5 );
       
        artifactDaoControl.expectAndReturn( artifactDao.queryArtifacts(
                new ArtifactsByRepositoryConstraint( REPO, RepositoryStatisticsReportGenerator.MAVEN_PLUGIN, endDate, "whenGathered") ), mavenPlugins, 5 );

        artifactDaoControl.expectAndReturn( artifactDao.queryArtifacts(
                new ArtifactsByRepositoryConstraint( REPO, RepositoryStatisticsReportGenerator.EAR_TYPE, endDate, "whenGathered" ) ), earArtifacts, 5 );

        artifactDaoControl.expectAndReturn( artifactDao.queryArtifacts(
                new ArtifactsByRepositoryConstraint( REPO, RepositoryStatisticsReportGenerator.EXE_TYPE, endDate, "whenGathered" ) ), exeArtifacts, 5 );

        artifactDaoControl.expectAndReturn( artifactDao.queryArtifacts(
                new ArtifactsByRepositoryConstraint( REPO, RepositoryStatisticsReportGenerator.DLL_TYPE, endDate, "whenGathered" ) ), dllArtifacts, 5 );

        artifactDaoControl.expectAndReturn( artifactDao.queryArtifacts(
                new ArtifactsByRepositoryConstraint( REPO, RepositoryStatisticsReportGenerator.ZIP_TYPE, endDate, "whenGathered" ) ), zipArtifacts, 5 );

        daoControl.replay();
        artifactDaoControl.replay();
       
        List<RepositoryStatistics> data = generator.generateReport( repoContentStats, REPO, startDate, endDate, limits );
View Full Code Here

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

    }

    private void cleanupDatabase( String repoId )
        throws ArchivaDatabaseException
    {
        Constraint constraint = new ArtifactsByRepositoryConstraint( repoId );

        List<ArchivaArtifact> artifacts = archivaDAO.getArtifactDAO().queryArtifacts( constraint );

        for ( ArchivaArtifact artifact : artifacts )
        {
View Full Code Here

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

    {
       
        Calendar greaterThanThisDate = Calendar.getInstance( DateUtils.UTC_TIME_ZONE );
        greaterThanThisDate.add( Calendar.DATE, -( getNumberOfDaysBeforeNow() ) );
       
        Constraint artifactsByRepo = new ArtifactsByRepositoryConstraint( repoId, greaterThanThisDate.getTime(), "whenGathered" );
        List<ArchivaArtifact> artifacts = artifactDAO.queryArtifacts( artifactsByRepo );

        List<RssFeedEntry> entries = processData( artifacts, true );

        return generator.generateFeed( getTitle() + "\'" + repoId + "\'", "New artifacts found in repository " +
View Full Code Here

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

    }

    private void cleanupDatabase( String repoId )
        throws ArchivaDatabaseException
    {
        Constraint constraint = new ArtifactsByRepositoryConstraint( repoId );

        List<ArchivaArtifact> artifacts = archivaDAO.getArtifactDAO().queryArtifacts( constraint );

        for ( ArchivaArtifact artifact : artifacts )
        {
View Full Code Here

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

        // total artifact count
        try
        {
            // note that when gathered is the end of the scan, so we look for all those before that time
            List<ArchivaArtifact> artifacts = dao.getArtifactDAO().queryArtifacts(
                new ArtifactsByRepositoryConstraint( arepo.getId(), stats.getWhenGathered(), "groupId", true ) );
            dbstats.setTotalArtifactCount( artifacts.size() );
        }
        catch ( ObjectNotFoundException oe )
        {
            log.error( "Object not found in the database : " + oe.getMessage() );
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.