use of com.hazelcast.config.AwsConfig in project hazelcast by hazelcast.
the class TestClientNetworkConfig method smokeAwsConfig.
@Test
public void smokeAwsConfig() {
AwsConfig aws = client.getClientConfig().getNetworkConfig().getAwsConfig();
assertFalse(aws.isEnabled());
assertEquals("sample-access-key", aws.getProperty("access-key"));
assertEquals("sample-secret-key", aws.getProperty("secret-key"));
assertEquals("sample-region", aws.getProperty("region"));
assertEquals("sample-header", aws.getProperty("host-header"));
assertEquals("sample-group", aws.getProperty("security-group-name"));
assertEquals("sample-tag-key", aws.getProperty("tag-key"));
assertEquals("sample-tag-value", aws.getProperty("tag-value"));
assertEquals("sample-role", aws.getProperty("iam-role"));
}
use of com.hazelcast.config.AwsConfig in project hazelcast by hazelcast.
the class AliasedDiscoveryConfigDTOTest method testDefault.
@Test
public void testDefault() {
testDefault(new GcpConfig());
testDefault(new AzureConfig());
testDefault(new AwsConfig());
testDefault(new EurekaConfig());
testDefault(new KubernetesConfig());
}
use of com.hazelcast.config.AwsConfig in project hazelcast by hazelcast.
the class WanBatchPublisherConfigDTOTest method testSerialization.
@Test
public void testSerialization() {
Map<String, Comparable> properties = new HashMap<>();
properties.put("key1", "value1");
properties.put("key2", "value2");
WanBatchPublisherConfig expected = new WanBatchPublisherConfig().setClusterName("myClusterName").setPublisherId("myPublisherId").setSnapshotEnabled(true).setInitialPublisherState(WanPublisherState.STOPPED).setQueueCapacity(23).setBatchSize(500).setBatchMaxDelayMillis(1000).setResponseTimeoutMillis(60000).setQueueFullBehavior(WanQueueFullBehavior.THROW_EXCEPTION).setAcknowledgeType(WanAcknowledgeType.ACK_ON_OPERATION_COMPLETE).setDiscoveryPeriodSeconds(20).setMaxTargetEndpoints(100).setMaxConcurrentInvocations(500).setUseEndpointPrivateAddress(true).setIdleMinParkNs(100).setIdleMaxParkNs(1000).setTargetEndpoints("a,b,c,d").setDiscoveryConfig(new DiscoveryConfig()).setSyncConfig(new WanSyncConfig()).setAwsConfig(new AwsConfig().setEnabled(true).setProperty("connection-timeout-seconds", "20")).setGcpConfig(new GcpConfig().setEnabled(true).setProperty("gcp", "gcp-val")).setAzureConfig(new AzureConfig().setEnabled(true).setProperty("azure", "azure-val")).setKubernetesConfig(new KubernetesConfig().setEnabled(true).setProperty("kubernetes", "kubernetes-val")).setEurekaConfig(new EurekaConfig().setEnabled(true).setProperty("eureka", "eureka-val")).setEndpoint("WAN").setProperties(properties);
WanBatchPublisherConfig actual = cloneThroughJson(expected);
assertTrue("Expected: " + expected + ", got:" + actual, WAN_PUBLISHER_CONFIG_CHECKER.check(expected, actual));
}
use of com.hazelcast.config.AwsConfig in project hazelcast by hazelcast.
the class DefaultAddressPicker method preferIPv4Stack.
private boolean preferIPv4Stack() {
boolean preferIPv4Stack = Boolean.getBoolean("java.net.preferIPv4Stack") || hazelcastProperties.getBoolean(GroupProperty.PREFER_IPv4_STACK);
// AWS does not support IPv6
JoinConfig join = config.getNetworkConfig().getJoin();
AwsConfig awsConfig = join.getAwsConfig();
boolean awsEnabled = awsConfig != null && awsConfig.isEnabled();
return preferIPv4Stack || awsEnabled;
}
use of com.hazelcast.config.AwsConfig in project hazelcast by hazelcast.
the class ClientDiscoverySpiTest method testParsing.
@Test
public void testParsing() throws Exception {
String xmlFileName = "hazelcast-client-discovery-spi-test.xml";
InputStream xmlResource = ClientDiscoverySpiTest.class.getClassLoader().getResourceAsStream(xmlFileName);
ClientConfig clientConfig = new XmlClientConfigBuilder(xmlResource).build();
ClientNetworkConfig networkConfig = clientConfig.getNetworkConfig();
AwsConfig awsConfig = networkConfig.getAwsConfig();
assertNull(awsConfig);
DiscoveryConfig discoveryConfig = networkConfig.getDiscoveryConfig();
assertTrue(discoveryConfig.isEnabled());
assertEquals(1, discoveryConfig.getDiscoveryStrategyConfigs().size());
DiscoveryStrategyConfig providerConfig = discoveryConfig.getDiscoveryStrategyConfigs().iterator().next();
assertEquals(3, providerConfig.getProperties().size());
assertEquals("foo", providerConfig.getProperties().get("key-string"));
assertEquals("123", providerConfig.getProperties().get("key-int"));
assertEquals("true", providerConfig.getProperties().get("key-boolean"));
}
Aggregations