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

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


        managedDefaultRepository =
            createRepository( ID_DEFAULT_MANAGED, "Default Managed Repository", repoPath, "default" );

        managedDefaultDir = new File( managedDefaultRepository.getRepoRoot() );

        ManagedRepository repoConfig = managedDefaultRepository.getRepository();

        ( (DefaultManagedRepositoryAdmin) applicationContext.getBean(
            ManagedRepositoryAdmin.class ) ).setArchivaConfiguration( config );

        applicationContext.getBean( ManagedRepositoryAdmin.class ).addManagedRepository( repoConfig, false, null );
View Full Code Here


    }

    protected ManagedRepositoryContent createRepository( String id, String name, String path, String layout )
        throws Exception
    {
        ManagedRepository repo = new ManagedRepository();
        repo.setId( id );
        repo.setName( name );
        repo.setLocation( path );
        repo.setLayout( layout );

        ManagedRepositoryContent repoContent =
            applicationContext.getBean( "managedRepositoryContent#" + layout, ManagedRepositoryContent.class );
        repoContent.setRepository( repo );
        return repoContent;
View Full Code Here

    {
        KnownRepositoryContentConsumer repoPurgeConsumer =
            applicationContext.getBean( "knownRepositoryContentConsumer#repo-purge-consumer-by-retention-count",
                                        KnownRepositoryContentConsumer.class );

        ManagedRepository repoConfiguration = getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME );
        repoConfiguration.setDaysOlder( 0 ); // force days older off to allow retention count purge to execute.
        repoConfiguration.setRetentionCount( TEST_RETENTION_COUNT );
        addRepoToConfiguration( "retention-count", repoConfiguration );

        repoPurgeConsumer.beginScan( repoConfiguration, null );

        String repoRoot = prepareTestRepos();
View Full Code Here

    {
        KnownRepositoryContentConsumer repoPurgeConsumer =
            applicationContext.getBean( "knownRepositoryContentConsumer#repo-purge-consumer-by-days-old",
                                        KnownRepositoryContentConsumer.class );

        ManagedRepository repoConfiguration = getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME );
        repoConfiguration.setDaysOlder( TEST_DAYS_OLDER );
        addRepoToConfiguration( "days-old", repoConfiguration );

        repoPurgeConsumer.beginScan( repoConfiguration, null );

        String repoRoot = prepareTestRepos();
View Full Code Here

    {
        KnownRepositoryContentConsumer repoPurgeConsumer =
            applicationContext.getBean( "knownRepositoryContentConsumer#repo-purge-consumer-by-retention-count",
                                        KnownRepositoryContentConsumer.class );

        ManagedRepository repoConfiguration = getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME );
        repoConfiguration.setDeleteReleasedSnapshots( false ); // Set to NOT delete released snapshots.
        addRepoToConfiguration( "retention-count", repoConfiguration );

        repoPurgeConsumer.beginScan( repoConfiguration, null );

        String repoRoot = prepareTestRepos();
View Full Code Here

    {
        KnownRepositoryContentConsumer repoPurgeConsumer =
            applicationContext.getBean( "knownRepositoryContentConsumer#repo-purge-consumer-by-days-old",
                                        KnownRepositoryContentConsumer.class );

        ManagedRepository repoConfiguration = getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME );
        repoConfiguration.setDeleteReleasedSnapshots( true );
        addRepoToConfiguration( "days-old", repoConfiguration );

        repoPurgeConsumer.beginScan( repoConfiguration, null );

        String repoRoot = prepareTestRepos();
View Full Code Here

        action.setRepoid( REPO_ID );

        action.prepare();
        assertEquals( REPO_ID, action.getRepoid() );
        ManagedRepository repository = action.getRepository();
        assertNotNull( repository );

        ManagedRepository newRepository = createRepository();
        assertRepositoryEquals( repository, newRepository );
        assertEquals( repository.getLocation(), newRepository.getLocation() );

        String status = action.input();
        assertEquals( Action.INPUT, status );
        repository = action.getRepository();
        assertRepositoryEquals( repository, createRepository() );
View Full Code Here

        archivaConfigurationControl.replay();

        action.setRepoid( REPO_ID );
        action.prepare();
        assertEquals( REPO_ID, action.getRepoid() );
        ManagedRepository repository = action.getRepository();
        populateRepository( repository );
        repository.setName( "new repo name" );

        MockControl repositoryStatisticsManagerControl = MockControl.createControl( RepositoryStatisticsManager.class );
        RepositoryStatisticsManager repositoryStatisticsManager =
            (RepositoryStatisticsManager) repositoryStatisticsManagerControl.getMock();
        ( (DefaultManagedRepositoryAdmin) getManagedRepositoryAdmin() ).setRepositoryStatisticsManager(
            repositoryStatisticsManager );
        // no deletion
        repositoryStatisticsManagerControl.replay();

        new File( "target/test/" + REPO_ID + "-stage" ).mkdirs();

        action.setRepository( repository );
        action.setStageNeeded( true );
        String status = action.commit();
        assertEquals( Action.SUCCESS, status );

        ManagedRepository newRepository = createRepository();
        newRepository.setName( "new repo name" );
        assertRepositoryEquals( repository, newRepository );
        //assertEquals( Collections.singletonList( repository ), configuration.getManagedRepositories() );
        //assertEquals( location.getCanonicalPath(), new File( repository.getLocation() ).getCanonicalPath() );

        roleManagerControl.verify();
View Full Code Here

        action.setStageNeeded( true );
        action.setRepoid( REPO_ID );
        action.prepare();
        assertEquals( REPO_ID, action.getRepoid() );

        ManagedRepository repository = new ManagedRepository();
        populateRepository( repository );
        File testFile = new File( "target/test/location/new" );
        FileUtils.deleteDirectory( testFile );
        repository.setLocation( "${appserver.base}/location/new" );
        action.setRepository( repository );
        String status = action.commit();
        assertEquals( Action.SUCCESS, status );
        //assertEquals( Collections.singletonList( repository ), configuration.getManagedRepositories() );
        //assertEquals( testFile.getCanonicalPath(), new File( repository.getLocation() ).getCanonicalPath() );
View Full Code Here

    public void testStruts2ValidationFrameworkWithNullInputs()
        throws Exception
    {
        // prep
        // 0 is the default value for primitive int; null for objects
        ManagedRepository managedRepositoryConfiguration = createManagedRepository( null, null, null, null, 1, 1 );
        action.setRepository( managedRepositoryConfiguration );

        // test
        actionValidatorManager.validate( action, EMPTY_STRING );
View Full Code Here

TOP

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

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.