/** * Gets HTTP proxy port. * * @return HTTP proxy port. */ public int getProxyPort() { return cfg.getProxyPort(); }
public int getProxyPort() { return config.getProxyPort(); }
int proxyPort = config.getProxyPort();
public int getProxyPort() { return config.getProxyPort(); }
this.proxyHost = other.getProxyHost(); this.proxyPassword = other.getProxyPassword(); this.proxyPort = other.getProxyPort(); this.proxyUsername = other.getProxyUsername(); this.proxyWorkstation = other.getProxyWorkstation();
int proxyPort = config.getProxyPort();
/** * Gets HTTP proxy port. * * @return HTTP proxy port. */ public int getProxyPort() { return cfg.getProxyPort(); }
final int proxyPort = config.getProxyPort(); if (proxyHost != null && proxyPort > 0) { AmazonHttpClient.log.info("Configuring Proxy. Proxy Host: " + proxyHost + " "
public int getProxyPort() { return config.getProxyPort(); }
this.proxyHost = other.getProxyHost(); this.proxyPassword = other.getProxyPassword(); this.proxyPort = other.getProxyPort(); this.proxyUsername = other.getProxyUsername(); this.proxyWorkstation = other.getProxyWorkstation();
int proxyPort = config.getProxyPort();
assertEquals(c.getProxyHost(), n.getProxyHost()); assertEquals(c.getProxyPassword(), n.getProxyPassword()); assertEquals(c.getProxyPort(), n.getProxyPort()); assertEquals(c.getProxyUsername(), n.getProxyUsername()); assertEquals(c.useReaper(), n.useReaper());
logger.debug("Using proxy server {}:{} as user {} on " + "domain {} as workstation {}", awsConf.getProxyHost(), awsConf.getProxyPort(), String.valueOf(awsConf.getProxyUsername()), awsConf.getProxyDomain(),
LOG.debug("Using proxy server {}:{} as user {} with password {} on " + "domain {} as workstation {}", awsConf.getProxyHost(), awsConf.getProxyPort(), String.valueOf(awsConf.getProxyUsername()), awsConf.getProxyPassword(), awsConf.getProxyDomain(),
@Override public PutObjectResult answer(InvocationOnMock invocation) throws Throwable { AmazonS3Client amazonS3Client = invocation.getArgument(1); ClientConfiguration clientConfiguration = (ClientConfiguration) ReflectionTestUtils.getField(amazonS3Client, "clientConfiguration"); assertEquals(httpProxyHost, clientConfiguration.getProxyHost()); assertEquals(httpProxyPort.intValue(), clientConfiguration.getProxyPort()); return new PutObjectResult(); } });
@Test public void testAwsClientConfigs() { Map<String, String> kv = new HashMap<>(); String system = "kinesis"; String systemConfigPrefix = String.format("systems.%s.", system); // Aws Client Configs kv.put(systemConfigPrefix + "aws.clientConfig.ProxyHost", "hostName"); kv.put(systemConfigPrefix + "aws.clientConfig.ProxyPort", "8080"); Config config = new MapConfig(kv); KinesisConfig kConfig = new KinesisConfig(config); assertEquals("hostName", kConfig.getAWSClientConfig(system).getProxyHost()); assertEquals(8080, kConfig.getAWSClientConfig(system).getProxyPort()); }
assertEquals(c.getProxyPort(), 1); c.setProxyPort(2); assertEquals(c.getProxyPort(), 2);
@Test public void testGetClientConfiguration() throws Exception { // Try to get AWS parameters using all possible permutations of HTTP proxy settings. for (String testHttpProxyHost : Arrays.asList(STRING_VALUE, BLANK_TEXT, null)) { for (Integer testHttpProxyPort : Arrays.asList(INTEGER_VALUE, null)) { // Create AWS parameters DTO. AwsParamsDto testAwsParamsDto = awsHelper.getAwsParamsDto(); testAwsParamsDto.setHttpProxyHost(testHttpProxyHost); testAwsParamsDto.setHttpProxyPort(testHttpProxyPort); // Get client configuration. ClientConfiguration resultClientConfiguration = awsHelper.getClientConfiguration(testAwsParamsDto); // Validate the results. assertNotNull(resultClientConfiguration); // The proxy settings are set only when both host and port are specified in the AWS parameters DTO. if (STRING_VALUE.equals(testHttpProxyHost) && INTEGER_VALUE.equals(testHttpProxyPort)) { assertEquals(testHttpProxyHost, resultClientConfiguration.getProxyHost()); assertEquals(testHttpProxyPort, Integer.valueOf(resultClientConfiguration.getProxyPort())); } else { assertNull(resultClientConfiguration.getProxyHost()); assertEquals(-1, resultClientConfiguration.getProxyPort()); } } } }
@Test public void setsClientConfigurationProxyHostAndPortWhenBothAreSupplied() { setTestProxyHostAndPort(conf); client.applyProxyConfiguration(clientConf, conf); Assert.assertEquals(TEST_PROXY_HOST, clientConf.getProxyHost()); Assert.assertEquals(TEST_PROXY_PORT, clientConf.getProxyPort()); }
@Test public void getEmrClientAssertClientConfigurationSet() throws Exception { String httpProxyHost = "httpProxyHost"; Integer httpProxyPort = 1234; AwsParamsDto awsParamsDto = getAwsParamsDto(); awsParamsDto.setHttpProxyHost(httpProxyHost); awsParamsDto.setHttpProxyPort(httpProxyPort); AmazonElasticMapReduceClient amazonElasticMapReduceClient = emrDao.getEmrClient(awsParamsDto); ClientConfiguration clientConfiguration = (ClientConfiguration) ReflectionTestUtils.getField(amazonElasticMapReduceClient, "clientConfiguration"); assertNotNull(clientConfiguration); assertEquals(httpProxyHost, clientConfiguration.getProxyHost()); assertEquals(httpProxyPort.intValue(), clientConfiguration.getProxyPort()); }