本文整理匯總了Java中org.jclouds.aws.AWSResponseException類的典型用法代碼示例。如果您正苦於以下問題:Java AWSResponseException類的具體用法?Java AWSResponseException怎麽用?Java AWSResponseException使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
AWSResponseException類屬於org.jclouds.aws包,在下文中一共展示了AWSResponseException類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createPlacementGroupInRegion
import org.jclouds.aws.AWSResponseException; //導入依賴的package包/類
private void createPlacementGroupInRegion(String region, String name) {
checkNotNull(region, "region");
checkNotNull(name, "name");
logger.debug(">> creating placementGroup region(%s) name(%s)", region, name);
try {
ec2Api.getPlacementGroupApi().get().createPlacementGroupInRegion(region, name);
logger.debug("<< created placementGroup(%s)", name);
checkState(placementGroupAvailable.apply(new PlacementGroup(region, name, "cluster", State.PENDING)), String
.format("placementGroup region(%s) name(%s) failed to become available", region, name));
} catch (AWSResponseException e) {
if (e.getError().getCode().equals("InvalidPlacementGroup.Duplicate")) {
logger.debug("<< reused placementGroup(%s)", name);
} else {
throw e;
}
}
}
示例2: testDescribeSpotRequestsInRegionFilterInvalid
import org.jclouds.aws.AWSResponseException; //導入依賴的package包/類
@Test(expectedExceptions = AWSResponseException.class)
public void testDescribeSpotRequestsInRegionFilterInvalid() {
for (String region : Region.DEFAULT_REGIONS) {
SortedSet<SpotInstanceRequest> allResults = ImmutableSortedSet.copyOf(client.getSpotInstanceApi().get()
.describeSpotInstanceRequestsInRegion(region));
assertNotNull(allResults);
if (allResults.size() >= 1) {
SpotInstanceRequest request = allResults.last();
SortedSet<SpotInstanceRequest> result = ImmutableSortedSet.copyOf(client.getSpotInstanceApi().get()
.describeSpotInstanceRequestsInRegionWithFilter(region,
ImmutableMultimap.<String, String>builder()
.put("invalid-filter", request.getId()).build()));
}
}
}
示例3: testPublicWriteOnObject
import org.jclouds.aws.AWSResponseException; //導入依賴的package包/類
@Override
@Test
public void testPublicWriteOnObject() throws InterruptedException,
ExecutionException, TimeoutException, IOException {
try {
super.testPublicWriteOnObject();
Fail.failBecauseExceptionWasNotThrown(AWSResponseException.class);
} catch (AWSResponseException are) {
assertThat(are.getError().getCode()).isEqualTo("NotImplemented");
throw new SkipException("public-read-write-acl not supported", are);
}
}
示例4: testUpdateObjectACL
import org.jclouds.aws.AWSResponseException; //導入依賴的package包/類
@Override
@Test
public void testUpdateObjectACL() throws InterruptedException,
ExecutionException, TimeoutException, IOException {
try {
super.testUpdateObjectACL();
Fail.failBecauseExceptionWasNotThrown(AWSResponseException.class);
} catch (AWSResponseException are) {
assertThat(are.getError().getCode()).isEqualTo("NotImplemented");
throw new SkipException("XML ACLs not supported", are);
}
}
示例5: testUpdateBucketACL
import org.jclouds.aws.AWSResponseException; //導入依賴的package包/類
@Override
@Test
public void testUpdateBucketACL() throws Exception {
try {
super.testUpdateBucketACL();
Fail.failBecauseExceptionWasNotThrown(AWSResponseException.class);
} catch (AWSResponseException are) {
assertThat(are.getError().getCode()).isEqualTo("NotImplemented");
throw new SkipException("XML ACLs not supported", are);
}
}
示例6: testBucketPayer
import org.jclouds.aws.AWSResponseException; //導入依賴的package包/類
@Override
@Test
public void testBucketPayer() throws Exception {
try {
super.testBucketPayer();
Fail.failBecauseExceptionWasNotThrown(AWSResponseException.class);
} catch (AWSResponseException are) {
assertThat(are.getError().getCode()).isEqualTo("NotImplemented");
throw new SkipException("bucket payer not supported", are);
}
}
示例7: testBucketLogging
import org.jclouds.aws.AWSResponseException; //導入依賴的package包/類
@Override
@Test
public void testBucketLogging() throws Exception {
try {
super.testBucketLogging();
Fail.failBecauseExceptionWasNotThrown(AWSResponseException.class);
} catch (AWSResponseException are) {
assertThat(are.getError().getCode()).isEqualTo("NotImplemented");
throw new SkipException("bucket logging not supported", are);
}
}
示例8: testFilterInvalid
import org.jclouds.aws.AWSResponseException; //導入依賴的package包/類
@Test(expectedExceptions = AWSResponseException.class)
public void testFilterInvalid() {
for (String region : supportedRegions) {
SortedSet<PlacementGroup> allResults = newTreeSet(client.getPlacementGroupApi().get()
.describePlacementGroupsInRegion(region));
assertNotNull(allResults);
if (allResults.size() >= 1) {
PlacementGroup group = allResults.last();
client.getPlacementGroupApi().get()
.describePlacementGroupsInRegionWithFilter(region,
ImmutableMultimap.<String, String>builder()
.put("invalid-filter", group.getName()).build());
}
}
}