Package org.jclouds.openstack.swift.v1.functions

Examples of org.jclouds.openstack.swift.v1.functions.ParseObjectListFromResponse$InternalObject


   
    public void sendAMessage(String msg) throws JMSException, ParseException {
     
        QueueSender send = session.createSender(que);
        ExternalObject external = new ExternalObject();
  InternalObject internal = new InternalObject();
  internal.setNumber(new Integer(1));
  internal.setText(msg);
  external.setInternal(internal);
  String dateString = "2007-03-07T04:27:00";
  Date date = (new SimpleDateFormat(DEFAULT_DATE_FORMAT)).parse(dateString);
  external.setDate(date);       
        ObjectMessage tm = session.createObjectMessage(external);
View Full Code Here


    // Create and populate the request message...
    Message requestMessage = MessageFactory.getInstance().getMessage(
        MessageType.JBOSS_XML);
    ExternalObject external = new ExternalObject();
    InternalObject internal = new InternalObject();
    internal.setNumber(new Integer(1));
    internal.setText(message);
    external.setInternal(internal);
    String dateString = "2007-03-07T04:27:00";
    Date date = (new SimpleDateFormat(DEFAULT_DATE_FORMAT))
        .parse(dateString);
    external.setDate(date);
View Full Code Here

               String path = command.getCurrentRequest().getEndpoint().getPath();
               int startOfDestinationPath = path.lastIndexOf("/", path.lastIndexOf("/") - 1);
               // get the "/destContainer/destObject" portion of the path
               String destinationPath = path.substring(startOfDestinationPath);
              
               exception = new CopyObjectException(sourcePath, destinationPath, message);
               exception.initCause(oldException);
            } else if (!command.getCurrentRequest().getMethod().equals("DELETE")) {
               String path = command.getCurrentRequest().getEndpoint().getPath();
               Matcher matcher = CONTAINER_PATH.matcher(path);
              
View Full Code Here

      MockWebServer server = mockOpenStackServer();
      server.enqueue(addCommonHeaders(new MockResponse().setBody(stringFromResource("/access.json"))));
      server.enqueue(addCommonHeaders(new MockResponse().setResponseCode(201).setBody("{\"Number Files Created\": 10, \"Errors\": []}")));

      try {
         SwiftApi api = api(server.getUrl("/").toString(), "openstack-swift");
         ExtractArchiveResponse response = api.bulkApiInRegion("DFW").extractArchive("myContainer",
               newByteArrayPayload(tarGz), "tar.gz");
         assertEquals(response.created(), 10);
         assertTrue(response.errors().isEmpty());

         assertEquals(server.getRequestCount(), 2);
View Full Code Here

      MockWebServer server = mockOpenStackServer();
      server.enqueue(addCommonHeaders(new MockResponse().setBody(stringFromResource("/access.json"))));
      server.enqueue(addCommonHeaders(new MockResponse().setBody(containerList)));

      try {
         SwiftApi api = api(server.getUrl("/").toString(), "openstack-swift");
         ImmutableList<Container> containers = api.containerApiInRegion("DFW").listFirstPage().toList();
         assertEquals(containers, ImmutableList.of(//
               Container.builder() //
                     .name("test_container_1") //
                     .objectCount(2) //
                     .bytesUsed(78).build(), //
View Full Code Here

      MockWebServer server = mockOpenStackServer();
      server.enqueue(addCommonHeaders(new MockResponse().setBody(stringFromResource("/access.json"))));
      server.enqueue(addCommonHeaders(new MockResponse().setBody(containerList)));

      try {
         SwiftApi api = api(server.getUrl("/").toString(), "openstack-swift");
         ImmutableList<Container> containers = api.containerApiInRegion("DFW").listAt("test").toList();
         assertEquals(containers, ImmutableList.of(//
               Container.builder() //
                     .name("test_container_1") //
                     .objectCount(2) //
                     .bytesUsed(78).build(), //
View Full Code Here

      MockWebServer server = mockOpenStackServer();
      server.enqueue(addCommonHeaders(new MockResponse().setBody(stringFromResource("/access.json"))));
      server.enqueue(addCommonHeaders(new MockResponse().setResponseCode(201)));

      try {
         SwiftApi api = api(server.getUrl("/").toString(), "openstack-swift");
         assertTrue(api.containerApiInRegion("DFW").createIfAbsent("myContainer", CreateContainerOptions.NONE));

         assertEquals(server.getRequestCount(), 2);
         assertEquals(server.takeRequest().getRequestLine(), "POST /tokens HTTP/1.1");
         RecordedRequest createRequest = server.takeRequest();
         assertEquals(createRequest.getRequestLine(),
View Full Code Here

      MockWebServer server = mockOpenStackServer();
      server.enqueue(addCommonHeaders(new MockResponse().setBody(stringFromResource("/access.json"))));
      server.enqueue(addCommonHeaders(new MockResponse().setResponseCode(201)));

      try {
         SwiftApi api = api(server.getUrl("/").toString(), "openstack-swift");
         assertTrue(api.containerApiInRegion("DFW").createIfAbsent("myContainer", anybodyRead().metadata(metadata)));

         assertEquals(server.getRequestCount(), 2);
         assertEquals(server.takeRequest().getRequestLine(), "POST /tokens HTTP/1.1");
         RecordedRequest createRequest = server.takeRequest();
         assertEquals(createRequest.getRequestLine(),
View Full Code Here

            .addHeader("X-Auth-Token", authToken).build();

      HttpResponse listResponse = HttpResponse.builder().statusCode(200)
            .payload(payloadFromResource("/container_list.json")).build();

      SwiftApi apiWhenContainersExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
            responseWithKeystoneAccess, list, listResponse);

      assertEquals(
            apiWhenContainersExist.getContainerApiForRegion("region-a.geo-1").list()
                  .toString(), new ParseContainerListTest().expected().toString());
   }
View Full Code Here

            .addHeader("Accept", "application/json")
            .addHeader("X-Auth-Token", authToken).build();

      HttpResponse listResponse = HttpResponse.builder().statusCode(404).build();

      SwiftApi apiWhenNoContainersExist = requestsSendResponses(keystoneAuthWithUsernameAndPassword,
            responseWithKeystoneAccess, list, listResponse);

      assertEquals(apiWhenNoContainersExist.getContainerApiForRegion("region-a.geo-1").list().toSet(),
               ImmutableSet.of());

   }
View Full Code Here

TOP

Related Classes of org.jclouds.openstack.swift.v1.functions.ParseObjectListFromResponse$InternalObject

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.