Examples of JAXBParser


Examples of org.jclouds.xml.internal.JAXBParser

   }

   public void testBindUnmanagedNetworkIpRef() throws IOException {
      VLANNetworkDto network = NetworkResources.unmanagedNetworkPut();
      RESTLink ipsLink = network.searchLink("ips");
      BindUnmanagedIpRefToPayload binder = new BindUnmanagedIpRefToPayload(new JAXBParser("false"));
      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
      request = binder.bindToRequest(request, network);
      assertPayloadEquals(request.getPayload(), withHeader("<links><link href=\"" + ipsLink.getHref()
            + "\" rel=\"unmanagedip\"/></links>"), LinksDto.class);
   }
View Full Code Here

Examples of org.jclouds.xml.internal.JAXBParser

@Test(groups = "unit", testName = "BindHardDiskRefsToPayloadTest")
public class BindHardDiskRefsToPayloadTest {

   @Test(expectedExceptions = NullPointerException.class)
   public void testInvalidNullInput() {
      BindHardDiskRefsToPayload binder = new BindHardDiskRefsToPayload(new JAXBParser("false"));
      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
      binder.bindToRequest(request, null);
   }
View Full Code Here

Examples of org.jclouds.xml.internal.JAXBParser

      binder.bindToRequest(request, null);
   }

   @Test(expectedExceptions = IllegalArgumentException.class)
   public void testInvalidTypeInput() {
      BindHardDiskRefsToPayload binder = new BindHardDiskRefsToPayload(new JAXBParser("false"));
      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
      binder.bindToRequest(request, new Object());
   }
View Full Code Here

Examples of org.jclouds.xml.internal.JAXBParser

      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
      binder.bindToRequest(request, new Object());
   }

   public void testBindEmptyArray() throws IOException {
      BindHardDiskRefsToPayload binder = new BindHardDiskRefsToPayload(new JAXBParser("false"));
      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
      request = binder.bindToRequest(request, new DiskManagementDto[] {});
      assertPayloadEquals(request.getPayload(), withHeader("<links/>"), LinksDto.class);
   }
View Full Code Here

Examples of org.jclouds.xml.internal.JAXBParser

      assertPayloadEquals(request.getPayload(), withHeader("<links/>"), LinksDto.class);
   }

   public void testBindSingleHardDisk() throws IOException {
      DiskManagementDto hardDisk = CloudResources.hardDiskPut();
      BindHardDiskRefsToPayload binder = new BindHardDiskRefsToPayload(new JAXBParser("false"));
      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
      request = binder.bindToRequest(request, new DiskManagementDto[] { hardDisk });
      assertPayloadEquals(request.getPayload(), withHeader("<links><link href=\"" + hardDisk.getEditLink().getHref()
            + "\" rel=\"" + binder.getRelToUse(hardDisk) + "\"/></links>"), LinksDto.class);
   }
View Full Code Here

Examples of org.jclouds.xml.internal.JAXBParser

            + "\" rel=\"" + binder.getRelToUse(hardDisk) + "\"/></links>"), LinksDto.class);
   }

   public void testBindMultipleHardDisks() throws IOException {
      DiskManagementDto hardDisk = CloudResources.hardDiskPut();
      BindHardDiskRefsToPayload binder = new BindHardDiskRefsToPayload(new JAXBParser("false"));
      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
      request = binder.bindToRequest(request, new DiskManagementDto[] { hardDisk, hardDisk });
      assertPayloadEquals(request.getPayload(), withHeader("<links><link href=\"" + hardDisk.getEditLink().getHref()
            + "\" rel=\"" + binder.getRelToUse(hardDisk) + "\"/></links>"), LinksDto.class);
   }
View Full Code Here

Examples of org.jclouds.xml.internal.JAXBParser

@Test(groups = "unit", testName = "BindVolumeRefsToPayloadTest")
public class BindVolumeRefsToPayloadTest {

   @Test(expectedExceptions = NullPointerException.class)
   public void testInvalidNullInput() {
      BindVolumeRefsToPayload binder = new BindVolumeRefsToPayload(new JAXBParser("false"));
      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
      binder.bindToRequest(request, null);
   }
View Full Code Here

Examples of org.jclouds.xml.internal.JAXBParser

      binder.bindToRequest(request, null);
   }

   @Test(expectedExceptions = IllegalArgumentException.class)
   public void testInvalidTypeInput() {
      BindVolumeRefsToPayload binder = new BindVolumeRefsToPayload(new JAXBParser("false"));
      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
      binder.bindToRequest(request, new Object());
   }
View Full Code Here

Examples of org.jclouds.xml.internal.JAXBParser

      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
      binder.bindToRequest(request, new Object());
   }

   public void testBindEmptyArray() throws IOException {
      BindVolumeRefsToPayload binder = new BindVolumeRefsToPayload(new JAXBParser("false"));
      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
      request = binder.bindToRequest(request, new VolumeManagementDto[] {});
      assertPayloadEquals(request.getPayload(), withHeader("<links/>"), LinksDto.class);
   }
View Full Code Here

Examples of org.jclouds.xml.internal.JAXBParser

      assertPayloadEquals(request.getPayload(), withHeader("<links/>"), LinksDto.class);
   }

   public void testBindSingleVolume() throws IOException {
      VolumeManagementDto volume = CloudResources.volumePut();
      BindVolumeRefsToPayload binder = new BindVolumeRefsToPayload(new JAXBParser("false"));
      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
      request = binder.bindToRequest(request, new VolumeManagementDto[] { volume });
      assertPayloadEquals(request.getPayload(), withHeader("<links><link href=\"" + volume.getEditLink().getHref()
            + "\" rel=\"" + binder.getRelToUse(volume) + "\"/></links>"), LinksDto.class);
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.