Package org.jclouds.openstack.swift.domain

Examples of org.jclouds.openstack.swift.domain.ContainerMetadata


            "key1", "value1",
            "key2", "value2");

      assertTrue(swift.setContainerMetadata(containerName, metadata));

      ContainerMetadata containerMetadata = swift.getContainerMetadata(containerName);
     
      assertEquals(containerMetadata.getMetadata().get("key1"), "value1");
      assertEquals(containerMetadata.getMetadata().get("key2"), "value2");
   }
View Full Code Here


            "key2", "value2",
            "key3", "value3"));

      assertTrue(swift.createContainer(containerName, options));
     
      ContainerMetadata containerMetadata = swift.getContainerMetadata(containerName);
     
      assertEquals(containerMetadata.getMetadata().size(), 3);
      assertEquals(containerMetadata.getMetadata().get("key1"), "value1");
      assertEquals(containerMetadata.getMetadata().get("key2"), "value2");
      assertEquals(containerMetadata.getMetadata().get("key3"), "value3");

      assertTrue(swift.deleteContainerMetadata(containerName, ImmutableList.<String> of("key2","key3")));

      containerMetadata = swift.getContainerMetadata(containerName);
     
      assertEquals(containerMetadata.getMetadata().size(), 1);
      assertEquals(containerMetadata.getMetadata().get("key1"), "value1");
   }
View Full Code Here

        
         // Test static website metadata
         getApi().setCDNStaticWebsiteIndex(containerNameWithCDN, "index.html");
         getApi().setCDNStaticWebsiteError(containerNameWithCDN, "error.html");
        
         ContainerMetadata containerMetadata = getApi().getContainerMetadata(containerNameWithCDN);
        
         assertEquals(containerMetadata.getMetadata().get("web-index"), "index.html");
         assertEquals(containerMetadata.getMetadata().get("web-error"), "error.html");
        
         cdnMetadata = getApi().getCDNMetadata(containerNameWithoutCDN);
         assert cdnMetadata == null || !cdnMetadata.isCDNEnabled() : containerNameWithoutCDN
                  + " should not have metadata";
View Full Code Here

        
         // Test static website metadata
         getApi().setCDNStaticWebsiteIndex(containerNameWithCDN, "index.html");
         getApi().setCDNStaticWebsiteError(containerNameWithCDN, "error.html");
        
         ContainerMetadata containerMetadata = getApi().getContainerMetadata(containerNameWithCDN);
        
         assertEquals(containerMetadata.getMetadata().get("web-index"), "index.html");
         assertEquals(containerMetadata.getMetadata().get("web-error"), "error.html");
        
         cdnMetadata = getApi().getCDNMetadata(containerNameWithoutCDN);
         assert cdnMetadata == null || !cdnMetadata.isCDNEnabled() : containerNameWithoutCDN
                  + " should not have metadata";
View Full Code Here

            "key1", "value1",
            "key2", "value2");

      assertTrue(swift.setContainerMetadata(containerName, metadata));

      ContainerMetadata containerMetadata = swift.getContainerMetadata(containerName);
     
      assertEquals(containerMetadata.getMetadata().get("key1"), "value1");
      assertEquals(containerMetadata.getMetadata().get("key2"), "value2");
   }
View Full Code Here

     
      String containerName = getScratchContainerName();
      assertTrue(swift.createContainer(containerName, options));

      try {
         ContainerMetadata containerMetadata = swift.getContainerMetadata(containerName);

         assertEquals(containerMetadata.getMetadata().size(), 3);
         assertEquals(containerMetadata.getMetadata().get("key1"), "value1");
         assertEquals(containerMetadata.getMetadata().get("key2"), "value2");
         assertEquals(containerMetadata.getMetadata().get("key3"), "value3");

         assertTrue(swift.deleteContainerMetadata(containerName, ImmutableList.<String> of("key2", "key3")));

         containerMetadata = swift.getContainerMetadata(containerName);

         assertEquals(containerMetadata.getMetadata().size(), 1);
         assertEquals(containerMetadata.getMetadata().get("key1"), "value1");
      } finally {
         returnContainer(containerName);
      }
   }
View Full Code Here

      .addHeader(SwiftHeaders.CONTAINER_OBJECT_COUNT, "1")
      .addHeader(SwiftHeaders.CONTAINER_METADATA_PREFIX + "label1", "test1")
      .addHeader(SwiftHeaders.CONTAINER_METADATA_PREFIX + "label2", "test2").build();
   
    response.getPayload().getContentMetadata().setContentType("text/plain");
    ContainerMetadata containerMetadata = parser.apply(response);
   
    assertEquals(containerMetadata.getBytes(), 42);
    assertEquals(containerMetadata.getCount(), 1);
    assertEquals(containerMetadata.getMetadata().get("label1"), "test1");
    assertEquals(containerMetadata.getMetadata().get("label2"), "test2");
  }
View Full Code Here

TOP

Related Classes of org.jclouds.openstack.swift.domain.ContainerMetadata

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.