Package org.apache.maven.archiva.web.action.admin.repositories

Examples of org.apache.maven.archiva.web.action.admin.repositories.RepositoryContentStatisticsDAOStub


        assertSuccessResult( result );
    }

    public void testGenerateStatisticsSingleRepoNoStats()
    {
        RepositoryContentStatisticsDAOStub dao =
            (RepositoryContentStatisticsDAOStub) lookup( RepositoryContentStatisticsDAO.class, "jdo" );
        dao.setStats( Collections.<RepositoryContentStatistics>emptyList() );
        prepareAction( Collections.singletonList( INTERNAL ), Collections.singletonList( SNAPSHOTS ) );

        String result = action.generateStatistics();
        assertEquals( Action.ERROR, result );
        assertTrue( action.hasActionErrors() );
View Full Code Here


        assertTrue( action.hasActionErrors() );
    }

    public void testGenerateStatisticsMultipleRepoNoResults()
    {
        RepositoryContentStatisticsDAOStub dao =
            (RepositoryContentStatisticsDAOStub) lookup( RepositoryContentStatisticsDAO.class, "jdo" );
        dao.setStats( Collections.<RepositoryContentStatistics>emptyList() );
        prepareAction( Arrays.asList( SNAPSHOTS, INTERNAL ), Collections.<String>emptyList() );

        String result = action.generateStatistics();
        assertEquals( GenerateReportAction.BLANK, result );
        assertFalse( action.hasActionErrors() );
View Full Code Here

        String result = action.downloadStatisticsReport();
        assertEquals( GenerateReportAction.SEND_FILE, result );
        assertFalse( action.hasActionErrors() );
        assertFalse( action.hasFieldErrors() );

        RepositoryContentStatisticsDAOStub dao =
            (RepositoryContentStatisticsDAOStub) lookup( RepositoryContentStatisticsDAO.class, "jdo" );
        RepositoryContentStatistics stats = dao.queryRepositoryContentStatistics(
            new RepositoryContentStatisticsByRepositoryConstraint( SNAPSHOTS ) ).get( 0 );

        assertEquals(
            "Date of Scan,Total File Count,Total Size,Artifact Count,Group Count,Project Count,Plugins,Archetypes,Jars,Wars,Deployments,Downloads\n" +
                stats.getWhenGathered() + ",0,0,0,0,0,1,0,1,1,0,0\n", IOUtils.toString( action.getInputStream() ) );
View Full Code Here

        assertTrue( action.hasFieldErrors() );
    }

    public void testDownloadStatisticsSingleRepoNoStats()
    {
        RepositoryContentStatisticsDAOStub dao =
            (RepositoryContentStatisticsDAOStub) lookup( RepositoryContentStatisticsDAO.class, "jdo" );
        dao.setStats( Collections.<RepositoryContentStatistics>emptyList() );
        prepareAction( Collections.singletonList( INTERNAL ), Collections.singletonList( SNAPSHOTS ) );

        String result = action.downloadStatisticsReport();
        assertEquals( Action.ERROR, result );
        assertTrue( action.hasActionErrors() );
View Full Code Here

        assertTrue( action.hasFieldErrors() );
    }

    public void testDownloadStatisticsMultipleRepoNoResults()
    {
        RepositoryContentStatisticsDAOStub dao =
            (RepositoryContentStatisticsDAOStub) lookup( RepositoryContentStatisticsDAO.class, "jdo" );
        dao.setStats( Collections.<RepositoryContentStatistics>emptyList() );
        prepareAction( Arrays.asList( SNAPSHOTS, INTERNAL ), Collections.<String>emptyList() );

        String result = action.downloadStatisticsReport();
        assertEquals( GenerateReportAction.BLANK, result );
        assertFalse( action.hasActionErrors() );
View Full Code Here

TOP

Related Classes of org.apache.maven.archiva.web.action.admin.repositories.RepositoryContentStatisticsDAOStub

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.