本文整理汇总了Java中com.hazelcast.config.AwsConfig.setSecurityGroupName方法的典型用法代码示例。如果您正苦于以下问题:Java AwsConfig.setSecurityGroupName方法的具体用法?Java AwsConfig.setSecurityGroupName怎么用?Java AwsConfig.setSecurityGroupName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.hazelcast.config.AwsConfig
的用法示例。
在下文中一共展示了AwsConfig.setSecurityGroupName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testIamRole
import com.hazelcast.config.AwsConfig; //导入方法依赖的package包/类
@Test
public void testIamRole() throws IOException {
String s = "{\n"
+ " \"Code\" : \"Success\",\n"
+ " \"LastUpdated\" : \"2015-09-06T21:17:26Z\",\n"
+ " \"Type\" : \"AWS-HMAC\",\n"
+ " \"AccessKeyId\" : \"ASIAIEXAMPLEOXYDA\",\n"
+ " \"SecretAccessKey\" : \"hOCVge3EXAMPLExSJ+B\",\n"
+ " \"Token\" : \"AQoDYXdzEE4EXAMPLE2UGAFshkTsyw7gojLdiEXAMPLE+1SfSRTfLR\",\n"
+ " \"Expiration\" : \"2015-09-07T03:19:56Z\"\n}";
StringReader sr = new StringReader(s);
BufferedReader br = new BufferedReader(sr);
AwsConfig awsConfig1 = new AwsConfig();
awsConfig1.setAccessKey("some-access-key");
awsConfig1.setSecretKey("some-secret-key");
awsConfig1.setSecurityGroupName("hazelcast");
DescribeInstances describeInstances = new DescribeInstances(awsConfig, "");
Map map = describeInstances.parseIamRole(br);
assertEquals("Success", map.get("Code"));
assertEquals("2015-09-06T21:17:26Z", map.get("LastUpdated"));
assertEquals("AWS-HMAC", map.get("Type"));
assertEquals("ASIAIEXAMPLEOXYDA", map.get("AccessKeyId"));
assertEquals("hOCVge3EXAMPLExSJ+B", map.get("SecretAccessKey"));
assertEquals("AQoDYXdzEE4EXAMPLE2UGAFshkTsyw7gojLdiEXAMPLE+1SfSRTfLR", map.get("Token"));
}
示例2: setup
import com.hazelcast.config.AwsConfig; //导入方法依赖的package包/类
@Before
public void setup() {
awsConfig = new AwsConfig();
awsConfig.setAccessKey("some-access-key");
awsConfig.setSecretKey("some-secret-key");
awsConfig.setSecurityGroupName("hazelcast");
}
示例3: testNoTags
import com.hazelcast.config.AwsConfig; //导入方法依赖的package包/类
@Test
public void testNoTags() throws IOException {
InputStream is = new ByteArrayInputStream(xml.getBytes());
AwsConfig awsConfig = new AwsConfig();
awsConfig.setAccessKey("");
awsConfig.setSecretKey("");
awsConfig.setSecurityGroupName("hazelcast");
List<String> result = (List<String>) CloudyUtility.unmarshalTheResponse(is, awsConfig);
assertEquals(2, result.size());
}
示例4: testTagsBothNodeHave
import com.hazelcast.config.AwsConfig; //导入方法依赖的package包/类
@Test
public void testTagsBothNodeHave() throws IOException {
InputStream is = new ByteArrayInputStream(xml.getBytes());
AwsConfig awsConfig = new AwsConfig();
awsConfig.setAccessKey("");
awsConfig.setSecretKey("");
awsConfig.setSecurityGroupName("hazelcast");
awsConfig.setTagKey("Name1");
awsConfig.setTagValue("value1");
List<String> result = (List<String>) CloudyUtility.unmarshalTheResponse(is, awsConfig);
assertEquals(2, result.size());
}
示例5: testTagOnlyOneNodeHave
import com.hazelcast.config.AwsConfig; //导入方法依赖的package包/类
@Test
public void testTagOnlyOneNodeHave() throws IOException {
InputStream is = new ByteArrayInputStream(xml.getBytes());
AwsConfig awsConfig = new AwsConfig();
awsConfig.setAccessKey("");
awsConfig.setSecretKey("");
awsConfig.setSecurityGroupName("hazelcast");
awsConfig.setTagKey("name");
awsConfig.setTagValue("");
List<String> result = (List<String>) CloudyUtility.unmarshalTheResponse(is, awsConfig);
assertEquals(1, result.size());
}