Package org.apache.maven.archiva.configuration

Examples of org.apache.maven.archiva.configuration.NetworkProxyConfiguration


                int count = 0;
                for ( Iterator iter = value.getNetworkProxies().iterator(); iter.hasNext(); count++ )
                {
                    String name = "networkProxies.networkProxy(" + count + ")";
                    NetworkProxyConfiguration o = ( NetworkProxyConfiguration ) iter.next();
                    writeNetworkProxyConfiguration( prefix + name + ".", o, registry );
                }
            }
            if ( value.getLegacyArtifactPaths() != null && value.getLegacyArtifactPaths().size() > 0
)
View Full Code Here


        value.setProxyConnectors( proxyConnectors );
        java.util.List networkProxies = new java.util.ArrayList/*<NetworkProxyConfiguration>*/();
        List networkProxiesSubsets = registry.getSubsetList( prefix + "networkProxies.networkProxy" );
        for ( Iterator i = networkProxiesSubsets.iterator(); i.hasNext(); )
        {
            NetworkProxyConfiguration v = readNetworkProxyConfiguration( "", (Registry) i.next() );
            networkProxies.add( v );
        }
        value.setNetworkProxies( networkProxies );
        java.util.List legacyArtifactPaths = new java.util.ArrayList/*<LegacyArtifactPath>*/();
        List legacyArtifactPathsSubsets = registry.getSubsetList( prefix + "legacyArtifactPaths.legacyArtifactPath" );
View Full Code Here

        return value;
    }
   
    private NetworkProxyConfiguration readNetworkProxyConfiguration( String prefix, Registry registry )
    {
        NetworkProxyConfiguration value = new NetworkProxyConfiguration();

        String id = registry.getString( prefix + "id", value.getId() );
        value.setId( id );
        String protocol = registry.getString( prefix + "protocol", value.getProtocol() );
        value.setProtocol( protocol );
        String host = registry.getString( prefix + "host", value.getHost() );
        value.setHost( host );
        int port = registry.getInt( prefix + "port", value.getPort() );
        value.setPort( port );
        String username = registry.getString( prefix + "username", value.getUsername() );
        value.setUsername( username );
        String password = registry.getString( prefix + "password", value.getPassword() );
        value.setPassword( password );

        return value;
    }
View Full Code Here

        value.setProxyConnectors( proxyConnectors );
        java.util.List networkProxies = new java.util.ArrayList();
        List networkProxiesSubsets = registry.getSubsetList( prefix + "networkProxies.networkProxy" );
        for ( Iterator i = networkProxiesSubsets.iterator(); i.hasNext(); )
        {
            NetworkProxyConfiguration v = readNetworkProxyConfiguration( "", (Registry) i.next() );
            networkProxies.add( v );
        }
        value.setNetworkProxies( networkProxies );
        java.util.List legacyArtifactPaths = new java.util.ArrayList();
        List legacyArtifactPathsSubsets = registry.getSubsetList( prefix + "legacyArtifactPaths.legacyArtifactPath" );
View Full Code Here

        return value;
    }
   
    private NetworkProxyConfiguration readNetworkProxyConfiguration( String prefix, Registry registry )
    {
        NetworkProxyConfiguration value = new NetworkProxyConfiguration();

        String id = registry.getString( prefix + "id", value.getId() );
        value.setId( id );
        String protocol = registry.getString( prefix + "protocol", value.getProtocol() );
        value.setProtocol( protocol );
        String host = registry.getString( prefix + "host", value.getHost() );
        value.setHost( host );
        int port = registry.getInt( prefix + "port", value.getPort() );
        value.setPort( port );
        String username = registry.getString( prefix + "username", value.getUsername() );
        value.setUsername( username );
        String password = registry.getString( prefix + "password", value.getPassword() );
        value.setPassword( password );

        return value;
    }
View Full Code Here

    }

    public void testStruts2ValidationFrameworkWithNullInputs() throws Exception
    {
        // prep
        NetworkProxyConfiguration networkProxyConfiguration = createNetworkProxyConfiguration(null, null, null, null);
        configureNetworkProxyAction.setProxy(networkProxyConfiguration);

        // test
        actionValidatorManager.validate(configureNetworkProxyAction, VALIDATION_CONTEXT);
View Full Code Here

    }

    public void testStruts2ValidationFrameworkWithBlankInputs() throws Exception
    {
        // prep
        NetworkProxyConfiguration networkProxyConfiguration = createNetworkProxyConfiguration(EMPTY_STRING, EMPTY_STRING, EMPTY_STRING, EMPTY_STRING);
        configureNetworkProxyAction.setProxy(networkProxyConfiguration);

        // test
        actionValidatorManager.validate(configureNetworkProxyAction, VALIDATION_CONTEXT);
View Full Code Here

    }

    public void testStruts2ValidationFrameworkWithInvalidInputs() throws Exception
    {
        // prep
        NetworkProxyConfiguration networkProxyConfiguration = createNetworkProxyConfiguration(PROXY_ID_INVALID_INPUT, PROXY_HOST_INVALID_INPUT, PROXY_PORT_INVALID_INPUT, PROXY_PROTOCOL_INVALID_INPUT, PROXY_USERNAME_INVALID_INPUT);
        configureNetworkProxyAction.setProxy(networkProxyConfiguration);

        // test
        actionValidatorManager.validate(configureNetworkProxyAction, VALIDATION_CONTEXT);
View Full Code Here

    }

    public void testStruts2ValidationFrameworkWithValidInputs() throws Exception
    {
        // prep
        NetworkProxyConfiguration networkProxyConfiguration = createNetworkProxyConfiguration(PROXY_ID_VALID_INPUT, PROXY_HOST_VALID_INPUT, PROXY_PORT_VALID_INPUT, PROXY_PROTOCOL_VALID_INPUT, PROXY_USERNAME_VALID_INPUT);
        configureNetworkProxyAction.setProxy(networkProxyConfiguration);

        // test
        actionValidatorManager.validate(configureNetworkProxyAction, VALIDATION_CONTEXT);
View Full Code Here

        assertFalse(configureNetworkProxyAction.hasFieldErrors());
    }

    private NetworkProxyConfiguration createNetworkProxyConfiguration(String id, String host, int port, String protocol, String username)
    {
        NetworkProxyConfiguration networkProxyConfiguration = new NetworkProxyConfiguration();
        networkProxyConfiguration.setId(id);
        networkProxyConfiguration.setHost(host);
        networkProxyConfiguration.setPort(port);
        networkProxyConfiguration.setProtocol(protocol);
        networkProxyConfiguration.setUsername(username);
        return networkProxyConfiguration;
    }
View Full Code Here

TOP

Related Classes of org.apache.maven.archiva.configuration.NetworkProxyConfiguration

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.