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

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


    {
        boolean satisfies = false;

        if ( object instanceof ProxyConnector )
        {
            ProxyConnector connector = (ProxyConnector) object;
            return ( StringUtils.equals( sourceId, connector.getSourceRepoId() ) && StringUtils.equals( targetId,
                                                                                                        connector.getTargetRepoId() ) );
        }

        return satisfies;
    }
View Full Code Here


    }

    protected void removeConnector( String sourceId, String targetId )
        throws RepositoryAdminException
    {
        ProxyConnector proxyConnector = findProxyConnector( sourceId, targetId );
        if ( proxyConnector != null )
        {
            getProxyConnectorAdmin().deleteProxyConnector( proxyConnector, getAuditInformation() );
        }
    }
View Full Code Here

    @Override
    public void prepare()
        throws RepositoryAdminException
    {
        super.prepare();
        connector = new ProxyConnector();
    }
View Full Code Here

         * This validation is ultimately only useful on this one request method.
         */
        String sourceId = connector.getSourceRepoId();
        String targetId = connector.getTargetRepoId();

        ProxyConnector otherConnector = findProxyConnector( sourceId, targetId );
        if ( otherConnector != null )
        {
            addActionError(
                "Unable to add proxy connector, as one already exists with source repository id [" + sourceId
                    + "] and target repository id [" + targetId + "]." );
View Full Code Here

        }

        String sourceId = connector.getSourceRepoId();
        String targetId = connector.getTargetRepoId();

        ProxyConnector otherConnector = findProxyConnector( sourceId, targetId );
        if ( otherConnector != null )
        {
            // Remove the previous connector.
            removeProxyConnector( otherConnector );
        }
View Full Code Here

        remoteRepository.setPassword( FakeCreateAdminService.ADMIN_TEST_PWD );

        getRemoteRepositoriesService().addRemoteRepository( remoteRepository );

        ProxyConnectorService proxyConnectorService = getProxyConnectorService();
        ProxyConnector proxyConnector = new ProxyConnector();
        proxyConnector.setProxyId( "foo-bar" );
        proxyConnector.setSourceRepoId( id );
        proxyConnector.setTargetRepoId( "all-merged" );
        proxyConnectorService.addProxyConnector( proxyConnector );

        repositoriesService.scheduleDownloadRemoteIndex( "all-merged", true, true );

        // wait a bit
View Full Code Here

        expectConfigurationRequests( 7 );
        archivaConfigurationControl.replay();

        // Prepare Test.
        action.prepare();
        ProxyConnector connector = action.getConnector();
        populateProxyConnector( connector );

        // Perform Test w/no values.
        preRequest( action );
        String status = action.addBlackListPattern();
        assertEquals( Action.INPUT, status );

        // Should have returned an error, with no blacklist pattern added.
        assertHasErrors( action );
        assertEquals( 0, connector.getBlackListPatterns().size() );

        // Try again, but now with a pattern to add.
        action.setBlackListPattern( "**/*-javadoc.jar" );
        preRequest( action );
        status = action.addBlackListPattern();
        assertEquals( Action.INPUT, status );

        // Should have no error, and 1 blacklist pattern added.
        assertNoErrors( action );
        assertEquals( 1, connector.getBlackListPatterns().size() );
    }
View Full Code Here

        expectConfigurationRequests( 7 );
        archivaConfigurationControl.replay();

        // Prepare Test.
        action.prepare();
        ProxyConnector connector = action.getConnector();
        populateProxyConnector( connector );

        // Perform Test w/no values.
        preRequest( action );
        String status = action.addProperty();
        assertEquals( Action.INPUT, status );

        // Should have returned an error, with no property pattern added.
        assertHasErrors( action );
        assertEquals( 0, connector.getProperties().size() );

        // Try again, but now with a property key/value to add.
        action.setPropertyKey( "eat-a" );
        action.setPropertyValue( "gramov-a-bits" );
        preRequest( action );
        status = action.addProperty();
        assertEquals( Action.INPUT, status );

        // Should have no error, and 1 property added.
        assertNoErrors( action );
        assertEquals( 1, connector.getProperties().size() );
    }
View Full Code Here

        expectConfigurationRequests( 9 );
        archivaConfigurationControl.replay();

        // Prepare Test.
        action.prepare();
        ProxyConnector connector = action.getConnector();
        populateProxyConnector( connector );
        // forms will use an array
        //connector.getProperties().put( "eat-a", new String[] { "gramov-a-bits" } );
        // FIXME olamy check the array mode !!!
        connector.getProperties().put( "eat-a", "gramov-a-bits" );

        // Create the input screen.
        assertRequestStatus( action, Action.SUCCESS, "commit" );
        assertNoErrors( action );
View Full Code Here

    {
        expectConfigurationRequests( 3 );
        archivaConfigurationControl.replay();

        action.prepare();
        ProxyConnector configuration = action.getConnector();
        assertNotNull( configuration );
        assertNull( configuration.getProxyId() );
        assertNull( configuration.getSourceRepoId() );
        assertNull( configuration.getTargetRepoId() );
        assertTrue( configuration.getPolicies().isEmpty() );
        assertTrue( configuration.getProperties().isEmpty() );
        assertTrue( configuration.getBlackListPatterns().isEmpty() );
        assertTrue( configuration.getWhiteListPatterns().isEmpty() );

        String status = action.input();
        assertEquals( Action.INPUT, status );
    }
View Full Code Here

TOP

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

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.