Package org.jclouds.ultradns.ws

Examples of org.jclouds.ultradns.ws.UltraDNSWSApi


   HttpResponse listRecordsResponse = HttpResponse.builder().statusCode(OK.getStatusCode())
         .payload(payloadFromResourceWithContentType("/tcrecords.xml", "application/xml")).build();

   public void testListRecordsWhenResponseIs2xx() {
      UltraDNSWSApi success = requestSendsResponse(listRecords, listRecordsResponse);

      assertEquals(
            success.getTrafficControllerPoolApiForZone("jclouds.org.").listRecords("04053D8E57C7931F").toString(),
            new GetTCPoolRecordsResponseTest().expected().toString());
   }
View Full Code Here


   HttpResponse getNameByDNameResponse = HttpResponse.builder().statusCode(OK.getStatusCode())
         .payload(payloadFromResourceWithContentType("/tcpool_name.xml", "application/xml")).build();

   public void testGetNameByDNameWhenResponseIs2xx() {
      UltraDNSWSApi success = requestSendsResponse(getNameByDName, getNameByDNameResponse);
      assertEquals(success.getTrafficControllerPoolApiForZone("jclouds.org.").getNameByDName("www.foo.com."), "foo");
   }
View Full Code Here

   HttpResponse poolDoesntExist = HttpResponse.builder().message("Server Epoolor").statusCode(INTERNAL_SERVER_ERROR.getStatusCode())
         .payload(payloadFromResource("/lbpool_doesnt_exist.xml")).build();
  
   public void testGetNameByDNameWhenResponseNotFound() {
      UltraDNSWSApi notFound = requestSendsResponse(getNameByDName, poolDoesntExist);
      assertNull(notFound.getTrafficControllerPoolApiForZone("jclouds.org.").getNameByDName("www.foo.com."));
   }
View Full Code Here

   HttpResponse deleteResponse = HttpResponse.builder().statusCode(404)
         .payload(payloadFromResourceWithContentType("/lbpool_deleted.xml", "application/xml")).build();

   public void testDeleteWhenResponseIs2xx() {
      UltraDNSWSApi success = requestSendsResponse(delete, deleteResponse);
      success.getTrafficControllerPoolApiForZone("jclouds.org.").delete("04053D8E57C7931F");
   }
View Full Code Here

      UltraDNSWSApi success = requestSendsResponse(delete, deleteResponse);
      success.getTrafficControllerPoolApiForZone("jclouds.org.").delete("04053D8E57C7931F");
   }

   public void testDeleteWhenResponseNotFound() {
      UltraDNSWSApi notFound = requestSendsResponse(delete, poolDoesntExist);
      notFound.getTrafficControllerPoolApiForZone("jclouds.org.").delete("04053D8E57C7931F");
   }
View Full Code Here

   HttpResponse createRecordResponse = HttpResponse.builder().statusCode(OK.getStatusCode())
         .payload(payloadFromResourceWithContentType("/tcrecord_created.xml", "application/xml")).build();

   public void testCreateRecordWhenResponseIs2xx() {
      UltraDNSWSApi success = requestSendsResponse(createRecord, createRecordResponse);
      assertEquals(success.getTrafficControllerPoolApiForZone("jclouds.org.").addRecordToPoolWithTTL("1.2.3.4", "04053D8E57C7931F", 300), "06063DAC54F8D3D9");
   }
View Full Code Here

   HttpResponse recordAlreadyCreated = HttpResponse.builder().statusCode(INTERNAL_SERVER_ERROR.getStatusCode())
         .payload(payloadFromResourceWithContentType("/tcrecord_already_exists.xml", "application/xml")).build();

   @Test(expectedExceptions = ResourceAlreadyExistsException.class, expectedExceptionsMessageRegExp = "Resource Record of type 1 with these attributes already exists in the system.")
   public void testCreateWhenResponseError1802() {
      UltraDNSWSApi already = requestSendsResponse(createRecord, recordAlreadyCreated);
      already.getTrafficControllerPoolApiForZone("jclouds.org.").addRecordToPoolWithTTL("1.2.3.4", "04053D8E57C7931F", 300);
   }
View Full Code Here

         .endpoint("https://ultra-api.ultradns.com:8443/UltraDNS_WS/v01")
         .addHeader(HOST, "ultra-api.ultradns.com:8443")
         .payload(payloadFromResourceWithContentType("/create_tcrecord_weight.xml", "application/xml")).build();

   public void testCreateRecordWithWeightWhenResponseIs2xx() {
      UltraDNSWSApi success = requestSendsResponse(createRecordWithWeight, createRecordResponse);
      assertEquals(
            success.getTrafficControllerPoolApiForZone("jclouds.org.").addRecordToPoolWithTTLAndWeight("1.2.3.4",
                  "04053D8E57C7931F", 300, 0), "06063DAC54F8D3D9");
   }
View Full Code Here

   HttpResponse getRecordSpecResponse = HttpResponse.builder().statusCode(OK.getStatusCode())
         .payload(payloadFromResourceWithContentType("/poolrecordspec.xml", "application/xml")).build();

   public void testGetRecordSpecWhenResponseIs2xx() {
      UltraDNSWSApi success = requestSendsResponse(getRecordSpec, getRecordSpecResponse);
      assertEquals(success.getTrafficControllerPoolApiForZone("jclouds.org.").getRecordSpec("04053D8E57C7931F"),
            new GetPoolRecordSpecResponseTest().expected());
   }
View Full Code Here

   HttpResponse recordDoesntExist = HttpResponse.builder().message("Server Error").statusCode(INTERNAL_SERVER_ERROR.getStatusCode())
         .payload(payloadFromResource("/tcrecord_doesnt_exist.xml")).build();

   public void testGetRecordSpecWhenResponseNotFound() {
      UltraDNSWSApi notFound = requestSendsResponse(getRecordSpec, recordDoesntExist);
      assertNull(notFound.getTrafficControllerPoolApiForZone("jclouds.org.").getRecordSpec("04053D8E57C7931F"));
   }
View Full Code Here

TOP

Related Classes of org.jclouds.ultradns.ws.UltraDNSWSApi

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.