Package org.apache.archiva.reports

Examples of org.apache.archiva.reports.RepositoryProblemFacet


    @Test
    public void testHealthReportSingleRepoByCorrectGroupIdAllRepositories()
        throws Exception
    {
        RepositoryProblemFacet problem1 = createProblem( GROUP_ID, "artifactId", INTERNAL );
        RepositoryProblemFacet problem2 = createProblem( GROUP_ID, "artifactId-2", SNAPSHOTS );
        metadataRepositoryControl.expectAndReturn(
            metadataRepository.getMetadataFacets( INTERNAL, RepositoryProblemFacet.FACET_ID ),
            Arrays.asList( problem1.getName() ) );
        metadataRepositoryControl.expectAndReturn(
            metadataRepository.getMetadataFacets( SNAPSHOTS, RepositoryProblemFacet.FACET_ID ),
            Arrays.asList( problem2.getName() ) );
        metadataRepositoryControl.expectAndReturn(
            metadataRepository.getMetadataFacet( INTERNAL, RepositoryProblemFacet.FACET_ID, problem1.getName() ),
            problem1 );
        metadataRepositoryControl.expectAndReturn(
            metadataRepository.getMetadataFacet( SNAPSHOTS, RepositoryProblemFacet.FACET_ID, problem2.getName() ),
            problem2 );
        metadataRepositoryControl.replay();

        action.setGroupId( GROUP_ID );
        action.setRepositoryId( GenerateReportAction.ALL_REPOSITORIES );
View Full Code Here


            IOUtils.toString( action.getInputStream() ) );
    }

    private RepositoryProblemFacet createProblem( String groupId, String artifactId, String repoId )
    {
        RepositoryProblemFacet problem = new RepositoryProblemFacet();
        problem.setRepositoryId( repoId );
        problem.setNamespace( groupId );
        problem.setProject( artifactId );
        problem.setProblem( PROBLEM );
        return problem;
    }
View Full Code Here

            for ( String repoId : repoIds )
            {
                // TODO: improve performance by navigating into a group subtree. Currently group is property, not part of name of item
                for ( String name : metadataRepository.getMetadataFacets( repoId, RepositoryProblemFacet.FACET_ID ) )
                {
                    RepositoryProblemFacet metadataFacet =
                        (RepositoryProblemFacet) metadataRepository.getMetadataFacet( repoId,
                                                                                      RepositoryProblemFacet.FACET_ID,
                                                                                      name );

                    if ( StringUtils.isEmpty( groupId ) || groupId.equals( metadataFacet.getNamespace() ) )
                    {
                        problemArtifacts.add( metadataFacet );
                    }
                }
            }
View Full Code Here

            MetadataRepository metadataRepository = repositorySession.getRepository();
            for ( String repoId : observableRepositories )
            {
                for ( String name : metadataRepository.getMetadataFacets( repoId, RepositoryProblemFacet.FACET_ID ) )
                {
                    RepositoryProblemFacet metadataFacet =
                        (RepositoryProblemFacet) metadataRepository.getMetadataFacet( repoId,
                                                                                      RepositoryProblemFacet.FACET_ID,
                                                                                      name );
                    if ( StringUtils.isEmpty( groupId ) || groupId.equals( metadataFacet.getNamespace() ) )
                    {
                        problemArtifacts.add( metadataFacet );
                    }
                }
            }
View Full Code Here

TOP

Related Classes of org.apache.archiva.reports.RepositoryProblemFacet

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.