Package org.jclouds.rackspace.clouddns.v1.features

Examples of org.jclouds.rackspace.clouddns.v1.features.DomainApiExpectTest


   public void testImportDomain() throws Exception {
      List<String> contents = ImmutableList.<String> of(
            "imp-" + JCLOUDS_EXAMPLE + ".      3600  IN SOA   ns.rackspace.com. jclouds.imp-" + JCLOUDS_EXAMPLE + ". 1363882703 3600 3600 3600 3600",
            "imp-" + JCLOUDS_EXAMPLE + ".      600   IN A  50.56.174.152");

      Domain domain = awaitComplete(api, api.getDomainApi().importFormat(contents, Domain.Format.BIND_9));
      RecordDetail record = domain.getRecords().iterator().next();
     
      assertEquals(domain.getName(), "imp-" + JCLOUDS_EXAMPLE);
      assertEquals(domain.getEmail(), "jclouds@imp-" + JCLOUDS_EXAMPLE);
      assertEquals(record.getType(), "A");
      assertEquals(record.getData(), "50.56.174.152");
      assertEquals(record.getTTL(), 600);
     
      testDomains = Maps.newHashMap(testDomains);
      testDomains.put(domain.getName(), domain);
   }
View Full Code Here


   public void testCreateDomain() throws Exception {
      CreateDomain createDomain = CreateDomain.builder().name(JCLOUDS_EXAMPLE).email("jclouds@" + JCLOUDS_EXAMPLE)
            .ttl(60000).build();

      Iterable<CreateDomain> createDomains = ImmutableList.of(createDomain);
      Domain domain = awaitComplete(api, api.getDomainApi().create(createDomains)).iterator().next();

      assertEquals(domain.getName(), JCLOUDS_EXAMPLE);
      assertEquals(domain.getEmail(), "jclouds@" + JCLOUDS_EXAMPLE);
      assertTrue(domain.getRecords().isEmpty());

      domainId = domain.getId();
   }
View Full Code Here

            .email("jclouds@" + JCLOUDS_EXAMPLE)
            .ttl(60000)
            .build();

      Iterable<CreateDomain> createDomains = ImmutableList.of(createDomain);     
      Domain domain = awaitComplete(api, api.getDomainApi().create(createDomains)).iterator().next();
     
      assertEquals(domain.getName(), JCLOUDS_EXAMPLE);
      assertEquals(domain.getEmail(), "jclouds@" + JCLOUDS_EXAMPLE);
      assertTrue(domain.getRecords().isEmpty());
     
      domainId = domain.getId();
   }  
View Full Code Here

   public static void main(String[] args) {
      ListRecords listRecords = new ListRecords();

      try {
         listRecords.init(args);
         Domain domain = listRecords.getDomain();
         listRecords.listRecords(domain);
         listRecords.listRecordsByNameAndType(domain);
         listRecords.listRecordsByType(domain);
      }
      catch (Exception e) {
View Full Code Here

   public static void main(String[] args) {
      UpdateRecords updateRecords = new UpdateRecords();

      try {
         updateRecords.init(args);
         Domain domain = updateRecords.getDomain();
         updateRecords.updateRecord(domain);
         updateRecords.updateRecords(domain);
      }
      catch (Exception e) {
         e.printStackTrace();
View Full Code Here

            HttpResponse.builder().statusCode(OK.getStatusCode()).payload(payloadFromResource("/domain-list-changes.json")).build())
            .getDomainApi();

      Calendar cal = Calendar.getInstance(new SimpleTimeZone(0, "GMT"));
      cal.set(2013, 2, 22, 3, 39, 31);
      DomainChange domainChange = api.listChanges(3650908, cal.getTime());
     
      assertEquals(domainChange.getChanges().size(), 25);
   }
View Full Code Here

            .email("everett@" + JCLOUDS_EXAMPLE)
            .ttl(600001)
            .comment("Hello Domain Update")
            .build();

      Job job = api.update(3650908, updateDomain);
     
      assertEquals(job.getStatus(), Job.Status.COMPLETED);
   }
View Full Code Here

               .build(),
            HttpResponse.builder().statusCode(OK.getStatusCode()).payload(payloadFromResource("/domain-update-response.json")).build())
            .getDomainApi();

      List<Integer> ids = ImmutableList.of(3650906, 3650908);
      Job job = api.updateTTL(ids, 1234567);
     
      assertEquals(job.getStatus(), Job.Status.COMPLETED);
   }
View Full Code Here

               .build(),
            HttpResponse.builder().statusCode(OK.getStatusCode()).payload(payloadFromResource("/domain-update-response.json")).build())
            .getDomainApi();

      List<Integer> ids = ImmutableList.of(3650906, 3650908);
      Job job = api.updateEmail(ids, "everett@" + JCLOUDS_EXAMPLE);
     
      assertEquals(job.getStatus(), Job.Status.COMPLETED);
   }
View Full Code Here

            authenticatedGET().method("DELETE").replaceHeader("Accept", MediaType.WILDCARD).endpoint(endpoint).build(),
            HttpResponse.builder().statusCode(OK.getStatusCode()).payload(payloadFromResource("/domain-delete.json")).build())
            .getDomainApi();

      List<Integer> domainIds = ImmutableList.<Integer> of(3650907, 3650906, 3650908, 3650909);     
      Job job = api.delete(domainIds, true);

      assertEquals(job.getStatus(), Job.Status.COMPLETED);
   }
View Full Code Here

TOP

Related Classes of org.jclouds.rackspace.clouddns.v1.features.DomainApiExpectTest

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.