Package org.apache.archiva.admin.model.beans

Examples of org.apache.archiva.admin.model.beans.RepositoryGroup


        {
            defaultManagedRepositoryAdmin.addManagedRepository(
                createManagedRepository( INTERNAL_REPO, new File( "target/test-classes/" + INTERNAL_REPO ).getPath(),
                                         "default" ), false, null );
        }
        RepositoryGroup repoGroupConfig = new RepositoryGroup();
        repoGroupConfig.setId( LOCAL_REPO_GROUP );
        repoGroupConfig.addRepository( RELEASES_REPO );
        repoGroupConfig.addRepository( INTERNAL_REPO );

        defaultRepositoryGroupAdmin.setArchivaConfiguration( archivaConfiguration );
        if ( defaultManagedRepositoryAdmin.getManagedRepository( LOCAL_REPO_GROUP ) == null )
        {
            defaultRepositoryGroupAdmin.addRepositoryGroup( repoGroupConfig, null );
View Full Code Here


        {
            List<RepositoryGroup> repositoriesGroups = new ArrayList<RepositoryGroup>();
            for ( org.apache.archiva.admin.model.beans.RepositoryGroup repoGroup : repositoryGroupAdmin.getRepositoriesGroups() )
            {
                repositoriesGroups.add(
                    new RepositoryGroup( repoGroup.getId(), new ArrayList<String>( repoGroup.getRepositories() ) ) );
            }
            return repositoriesGroups;
        }
        catch ( RepositoryAdminException e )
        {
View Full Code Here

    public void prepare()
        throws RepositoryAdminException
    {

        repositoryGroup = new RepositoryGroup();
        repositoryGroups = getRepositoryGroupAdmin().getRepositoryGroupsAsMap();
        managedRepositories = getManagedRepositoryAdmin().getManagedRepositoriesAsMap();
        groupToRepositoryMap = getRepositoryGroupAdmin().getGroupToRepositoryMap();
    }
View Full Code Here

        archivaConfiguration.save( configuration );
        archivaConfigurationControl.replay();

        action.prepare();
        RepositoryGroup repositoryGroup = action.getRepositoryGroup();
        repositoryGroup.setId( REPO_GROUP_ID );

        String status = action.addRepositoryGroup();
        assertEquals( Action.SUCCESS, status );

        assertEquals( Collections.singletonList( repositoryGroup ),
View Full Code Here

        archivaConfiguration.save( configuration );

        archivaConfigurationControl.replay();

        action.prepare();
        RepositoryGroup repositoryGroup = action.getRepositoryGroup();
        repositoryGroup.setId( REPO_GROUP_ID );

        String status = action.addRepositoryGroup();
        assertEquals( Action.SUCCESS, status );

        assertEquals( Collections.singletonList( repositoryGroup ),
                      action.getRepositoryGroupAdmin().getRepositoriesGroups() );

        repositoryGroup.setId( REPO_GROUP_ID );
        status = action.addRepositoryGroup();

        assertEquals( Action.ERROR, status );
        assertEquals( Collections.singletonList( repositoryGroup ),
                      action.getRepositoryGroupAdmin().getRepositoriesGroups() );
View Full Code Here

        assertNotNull( action.getRepositoryGroups() );
        assertEquals( 1, action.getRepositoryGroups().size() );
        assertEquals( 2, action.getManagedRepositories().size() );

        RepositoryGroup repoGroup = action.getRepositoryGroups().get( REPO_GROUP_ID );

        assertEquals( 1, repoGroup.getRepositories().size() );
        assertEquals( REPO1_ID, repoGroup.getRepositories().get( 0 ) );
        assertNotNull( action.getGroupToRepositoryMap() );
        assertEquals( 1, action.getGroupToRepositoryMap().size() );

        List<String> repos = action.getGroupToRepositoryMap().get( repoGroup.getId() );
        assertEquals( 1, repos.size() );
        assertEquals( REPO2_ID, repos.get( 0 ) );
    }
View Full Code Here

        assertNotNull( action.getRepositoryGroups() );
        assertEquals( 1, action.getRepositoryGroups().size() );
        assertEquals( 2, action.getManagedRepositories().size() );

        RepositoryGroup repoGroup = action.getRepositoryGroups().get( REPO_GROUP_ID );
        assertEquals( 1, repoGroup.getRepositories().size() );
        assertEquals( REPO1_ID, repoGroup.getRepositories().get( 0 ) );

        assertNotNull( action.getGroupToRepositoryMap() );
        assertEquals( 1, action.getGroupToRepositoryMap().size() );

        List<String> repos = action.getGroupToRepositoryMap().get( repoGroup.getId() );
        assertEquals( 1, repos.size() );
        assertEquals( REPO2_ID, repos.get( 0 ) );

        action.setRepoGroupId( REPO_GROUP_ID );
        action.setRepoId( REPO2_ID );

        result = action.addRepositoryToGroup();
        assertEquals( Action.SUCCESS, result );

        action.prepare();
        result = action.execute();
        assertEquals( Action.SUCCESS, result );

        assertEquals( 1, action.getRepositoryGroups().size() );
        repoGroup = action.getRepositoryGroups().get( REPO_GROUP_ID );
        assertEquals( 2, repoGroup.getRepositories().size() );
        assertEquals( REPO1_ID, repoGroup.getRepositories().get( 0 ) );
        assertEquals( REPO2_ID, repoGroup.getRepositories().get( 1 ) );

        assertEquals( 0, action.getGroupToRepositoryMap().size() );
        assertNull( action.getGroupToRepositoryMap().get( repoGroup.getId() ) );
    }
View Full Code Here

        assertNotNull( action.getRepositoryGroups() );
        assertEquals( 1, action.getRepositoryGroups().size() );
        assertEquals( 2, action.getManagedRepositories().size() );

        RepositoryGroup repoGroup = action.getRepositoryGroups().get( REPO_GROUP_ID );
        assertEquals( 1, repoGroup.getRepositories().size() );
        assertEquals( REPO1_ID, repoGroup.getRepositories().get( 0 ) );

        assertNotNull( action.getGroupToRepositoryMap() );
        assertEquals( 1, action.getGroupToRepositoryMap().size() );

        List<String> repos = action.getGroupToRepositoryMap().get( repoGroup.getId() );
        assertEquals( 1, repos.size() );
        assertEquals( REPO2_ID, repos.get( 0 ) );

        action.setRepoGroupId( REPO_GROUP_ID );
        action.setRepoId( REPO1_ID );

        result = action.removeRepositoryFromGroup();
        assertEquals( Action.SUCCESS, result );

        action.prepare();
        result = action.execute();
        assertEquals( Action.SUCCESS, result );

        repoGroup = action.getRepositoryGroups().get( REPO_GROUP_ID );
        assertEquals( 0, repoGroup.getRepositories().size() );

        assertNotNull( action.getGroupToRepositoryMap() );
        assertEquals( 1, action.getGroupToRepositoryMap().size() );

        repos = action.getGroupToRepositoryMap().get( repoGroup.getId() );
        assertEquals( 2, repos.size() );
        assertEquals( REPO1_ID, repos.get( 0 ) );
        assertEquals( REPO2_ID, repos.get( 1 ) );
    }
View Full Code Here

        assertNotNull( action.getRepositoryGroups() );
        assertEquals( 1, action.getRepositoryGroups().size() );
        assertEquals( 2, action.getManagedRepositories().size() );

        RepositoryGroup repoGroup = action.getRepositoryGroups().get( REPO_GROUP_ID );
        assertEquals( 1, repoGroup.getRepositories().size() );
        assertEquals( REPO1_ID, repoGroup.getRepositories().get( 0 ) );

        assertNotNull( action.getGroupToRepositoryMap() );
        assertEquals( 1, action.getGroupToRepositoryMap().size() );

        List<String> repos = action.getGroupToRepositoryMap().get( repoGroup.getId() );
        assertEquals( 1, repos.size() );
        assertEquals( REPO2_ID, repos.get( 0 ) );

        action.setRepoGroupId( REPO_GROUP_ID );
        action.setRepoId( REPO1_ID );
View Full Code Here

        assertNotNull( action.getRepositoryGroups() );
        assertEquals( 1, action.getRepositoryGroups().size() );
        assertEquals( 2, action.getManagedRepositories().size() );

        RepositoryGroup repoGroup = action.getRepositoryGroups().get( REPO_GROUP_ID );
        assertEquals( 1, repoGroup.getRepositories().size() );
        assertEquals( REPO1_ID, repoGroup.getRepositories().get( 0 ) );

        assertNotNull( action.getGroupToRepositoryMap() );
        assertEquals( 1, action.getGroupToRepositoryMap().size() );

        List<String> repos = action.getGroupToRepositoryMap().get( repoGroup.getId() );
        assertEquals( 1, repos.size() );
        assertEquals( REPO2_ID, repos.get( 0 ) );

        action.setRepoGroupId( REPO_GROUP_ID );
        action.setRepoId( REPO2_ID );
View Full Code Here

TOP

Related Classes of org.apache.archiva.admin.model.beans.RepositoryGroup

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.