Package org.apache.archiva.rest.api.services

Examples of org.apache.archiva.rest.api.services.ProxyConnectorRuleService


    {
        ProxyConnector proxyConnector = new ProxyConnector();
        proxyConnector.setSourceRepoId( "snapshots" );
        proxyConnector.setTargetRepoId( "central" );

        ProxyConnectorRuleService service = getProxyConnectorRuleService( authorizationHeader );

        ProxyConnectorRule rule = null;
        try
        {

            int size = service.getProxyConnectorRules().size();
            assertEquals( 0, size );

            getProxyConnectorService().addProxyConnector( proxyConnector );

            rule = new ProxyConnectorRule( "org/apache/maven", ProxyConnectorRuleType.BLACK_LIST,
                                           Arrays.asList( proxyConnector ) );

            service.addProxyConnectorRule( rule );
            assertEquals( size + 1, service.getProxyConnectorRules().size() );

            rule = service.getProxyConnectorRules().get( 0 );

            assertEquals( "org/apache/maven", rule.getPattern() );
            assertEquals( 1, rule.getProxyConnectors().size() );
            assertEquals( "snapshots", rule.getProxyConnectors().get( 0 ).getSourceRepoId() );
            assertEquals( "central", rule.getProxyConnectors().get( 0 ).getTargetRepoId() );
            assertEquals( ProxyConnectorRuleType.BLACK_LIST, rule.getProxyConnectorRuleType() );
        }
        finally
        {
            service.deleteProxyConnectorRule( rule );
            getProxyConnectorService().deleteProxyConnector( proxyConnector );
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.archiva.rest.api.services.ProxyConnectorRuleService

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.