fixed CDN bug

git-svn-id: http://jclouds.googlecode.com/svn/trunk@2044 3d8758e0-26b5-11de-8745-db77d3ebf521
This commit is contained in:
adrian.f.cole 2009-11-04 22:59:48 +00:00
parent ce5e7017eb
commit 94ce40015c
2 changed files with 7 additions and 8 deletions

View File

@ -164,15 +164,17 @@ public interface CloudFilesClient {
@Endpoint(CloudFilesCDN.class) @Endpoint(CloudFilesCDN.class)
ContainerCDNMetadata getCDNMetadata(@PathParam("container") String container); ContainerCDNMetadata getCDNMetadata(@PathParam("container") String container);
@PUT @POST
@Path("{container}") @Path("{container}")
@Headers(keys = CloudFilesHeaders.CDN_ENABLED, values = "True")
@ResponseParser(ParseCdnUriFromHeaders.class) @ResponseParser(ParseCdnUriFromHeaders.class)
@Endpoint(CloudFilesCDN.class) @Endpoint(CloudFilesCDN.class)
URI enableCDN(@PathParam("container") String container, URI enableCDN(@PathParam("container") String container,
@HeaderParam(CloudFilesHeaders.CDN_TTL) Long ttl); @HeaderParam(CloudFilesHeaders.CDN_TTL) Long ttl);
@PUT @POST
@Path("{container}") @Path("{container}")
@Headers(keys = CloudFilesHeaders.CDN_ENABLED, values = "True")
@ResponseParser(ParseCdnUriFromHeaders.class) @ResponseParser(ParseCdnUriFromHeaders.class)
@Endpoint(CloudFilesCDN.class) @Endpoint(CloudFilesCDN.class)
URI enableCDN(@PathParam("container") String container); URI enableCDN(@PathParam("container") String container);

View File

@ -100,8 +100,7 @@ public class CloudFilesClientLiveTest extends BaseBlobStoreIntegrationTest<Cloud
// Confirm CDN is enabled via HEAD request and has default TTL // Confirm CDN is enabled via HEAD request and has default TTL
cdnMetadata = context.getApi().getCDNMetadata(containerNameWithCDN); cdnMetadata = context.getApi().getCDNMetadata(containerNameWithCDN);
// Ticket #2213 this should be true, but it is false assertTrue(cdnMetadata.isCDNEnabled());
// assertTrue(!cdnMetadata.isCDNEnabled());
assertEquals(cdnMetadata.getCDNUri(), cdnUri); assertEquals(cdnMetadata.getCDNUri(), cdnUri);
final long initialTTL = cdnMetadata.getTTL(); final long initialTTL = cdnMetadata.getTTL();
@ -148,8 +147,7 @@ public class CloudFilesClientLiveTest extends BaseBlobStoreIntegrationTest<Cloud
cdnMetadata = context.getApi().getCDNMetadata(containerNameWithCDN); cdnMetadata = context.getApi().getCDNMetadata(containerNameWithCDN);
// Ticket #2213 this should be true, but it is false assertTrue(cdnMetadata.isCDNEnabled());
// assertTrue(!cdnMetadata.isCDNEnabled());
assertEquals(cdnMetadata.getTTL(), ttl); assertEquals(cdnMetadata.getTTL(), ttl);
@ -158,8 +156,7 @@ public class CloudFilesClientLiveTest extends BaseBlobStoreIntegrationTest<Cloud
context.getApi().updateCDN(containerNameWithCDN, minimumTTL); context.getApi().updateCDN(containerNameWithCDN, minimumTTL);
cdnMetadata = context.getApi().getCDNMetadata(containerNameWithCDN); cdnMetadata = context.getApi().getCDNMetadata(containerNameWithCDN);
// Ticket #2213 this should be true, but it is false assertTrue(cdnMetadata.isCDNEnabled());
// assertTrue(!cdnMetadata.isCDNEnabled());
assertEquals(cdnMetadata.getTTL(), minimumTTL); assertEquals(cdnMetadata.getTTL(), minimumTTL);