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

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


      mxRecordId = records.get(0).getId();
   }

   @Test(dependsOnMethods = "testListRecordsByCriteriaMethods")
   public void testGetRecordByNameAndTypeAndData() throws Exception {
      RecordDetail record = api.getRecordApiForDomain(domainId).getByNameAndTypeAndData(JCLOUDS_EXAMPLE, "A", "10.0.0.1");
      Date now = new Date();
     
      assertNotNull(record.getId());
      assertEquals(record.getName(), JCLOUDS_EXAMPLE);
      assertEquals(record.getType(), "A");
      assertEquals(record.getData(), "10.0.0.1");
      assertEquals(record.getTTL(), 60000);
      assertTrue(record.getCreated().before(now));
      assertTrue(record.getUpdated().before(now));
   }
View Full Code Here


      assertTrue(record.getUpdated().before(now));
   }

   @Test(dependsOnMethods = "testGetRecordByNameAndTypeAndData")
   public void testGetRecord() throws Exception {
      RecordDetail record = api.getRecordApiForDomain(domainId).get(aRecordId);
      Date now = new Date();
     
      assertNotNull(record.getId());
      assertEquals(record.getName(), JCLOUDS_EXAMPLE);
      assertEquals(record.getType(), "A");
      assertEquals(record.getData(), "10.0.0.1");
      assertEquals(record.getTTL(), 60000);
      assertTrue(record.getCreated().before(now));
      assertTrue(record.getUpdated().before(now));
   }
View Full Code Here

            .comment("Updated Protocol to UDP")
            .build();

      awaitComplete(api, api.getRecordApiForDomain(domainId).update(srvRecordId, record));

      RecordDetail srvRecord = api.getRecordApiForDomain(domainId).get(srvRecordId);
      Date now = new Date();
     
      assertNotNull(srvRecord.getId());
      assertEquals(srvRecord.getType(), "SRV");
      assertEquals(srvRecord.getName(), "_sip._udp." + JCLOUDS_EXAMPLE);
      assertEquals(srvRecord.getData(), "1 3444 sip." + JCLOUDS_EXAMPLE);
      assertEquals(srvRecord.getPriority().intValue(), 12358);
      assertEquals(srvRecord.getTTL(), 86401);
      assertEquals(srvRecord.getComment(), "Updated Protocol to UDP");
      assertTrue(srvRecord.getCreated().before(now));
      assertTrue(srvRecord.getUpdated().before(now));     
   }
View Full Code Here

      Map<String, Record> idsToRecords = RecordFunctions.toRecordMap(recordDetails);
      Map<String, Record> updateRecords = Maps.transformValues(idsToRecords, updateTTLAndComment(35813, "New TTL"));
           
      awaitComplete(api, api.getRecordApiForDomain(domainId).update(updateRecords));

      RecordDetail record = api.getRecordApiForDomain(domainId).get(aRecordId);
      Date now = new Date();
     
      assertNotNull(record.getId());
      assertEquals(record.getName(), JCLOUDS_EXAMPLE);
      assertEquals(record.getType(), "A");
      assertEquals(record.getData(), "10.0.0.1");
      assertEquals(record.getTTL(), 35813);
      assertEquals(record.getComment(), "New TTL");
      assertTrue(record.getCreated().before(now));
      assertTrue(record.getUpdated().before(now));
     
      recordDetails = api.getRecordApiForDomain(domainId).list().concat().toSet();
     
      for (RecordDetail recordDetail : recordDetails) {
         assertEquals(recordDetail.getTTL(), 35813);
View Full Code Here

      assertTrue(jclouds.getCreated().before(now));
      assertTrue(jclouds.getUpdated().before(now));
     
      assertEquals(jclouds.getSubdomains().size(), 2);
     
      Subdomain devjclouds = null;
      Subdomain testjclouds = null;
     
      for (Subdomain subdomain: jclouds.getSubdomains()) {
         if (subdomain.getName().equals("dev." + JCLOUDS_EXAMPLE)) {
            devjclouds = subdomain;
         } else if (subdomain.getName().equals("test." + JCLOUDS_EXAMPLE)) {
            testjclouds = subdomain;
         }
      }
     
      assertTrue(devjclouds.getId() > 0);
      assertEquals(devjclouds.getName(), "dev." + JCLOUDS_EXAMPLE);
      assertEquals(devjclouds.getEmail(), "jclouds@" + JCLOUDS_EXAMPLE);
      assertEquals(devjclouds.getComment().get(), "Hello dev subdomain");
      assertTrue(devjclouds.getCreated().before(now));
      assertTrue(devjclouds.getUpdated().before(now));
     
      assertTrue(testjclouds.getId() > 0);
      assertEquals(testjclouds.getName(), "test." + JCLOUDS_EXAMPLE);
      assertEquals(testjclouds.getEmail(), "jclouds@" + JCLOUDS_EXAMPLE);
      assertEquals(testjclouds.getComment().get(), "Hello test subdomain");
      assertTrue(testjclouds.getCreated().before(now));
      assertTrue(testjclouds.getUpdated().before(now));
     
      assertEquals(jclouds.getRecords().size(), 2);
     
      RecordDetail mxRecord = null;
      RecordDetail aRecord = null;
View Full Code Here

      assertTrue(jclouds.getCreated().before(now));
      assertTrue(jclouds.getUpdated().before(now));
     
      assertEquals(jclouds.getSubdomains().size(), 2);
     
      Subdomain devjclouds = null;
      Subdomain testjclouds = null;
     
      for (Subdomain subdomain: jclouds.getSubdomains()) {
         if (subdomain.getName().equals("dev." + JCLOUDS_EXAMPLE)) {
            devjclouds = subdomain;
         } else if (subdomain.getName().equals("test." + JCLOUDS_EXAMPLE)) {
            testjclouds = subdomain;
         }
      }
     
      assertTrue(devjclouds.getId() > 0);
      assertEquals(devjclouds.getName(), "dev." + JCLOUDS_EXAMPLE);
      assertEquals(devjclouds.getEmail(), "jclouds@" + JCLOUDS_EXAMPLE);
      assertEquals(devjclouds.getComment().get(), "Hello dev subdomain");
      assertTrue(devjclouds.getCreated().before(now));
      assertTrue(devjclouds.getUpdated().before(now));
     
      assertTrue(testjclouds.getId() > 0);
      assertEquals(testjclouds.getName(), "test." + JCLOUDS_EXAMPLE);
      assertEquals(testjclouds.getEmail(), "jclouds@" + JCLOUDS_EXAMPLE);
      assertEquals(testjclouds.getComment().get(), "Hello test subdomain");
      assertTrue(testjclouds.getCreated().before(now));
      assertTrue(testjclouds.getUpdated().before(now));
     
      assertEquals(jclouds.getRecords().size(), 4); // 2 created above + 2 nameserver (NS) records
     
      RecordDetail mxRecord = null;
      RecordDetail aRecord = null;
View Full Code Here

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

      UpdateDomain updateDomain = UpdateDomain.builder()
            .email("everett@" + JCLOUDS_EXAMPLE)
            .ttl(600001)
            .comment("Hello Domain Update")
            .build();
View Full Code Here

      assertTrue(nsRecord.getUpdated().before(now));
   }
  
   @Test(dependsOnMethods = "testGetDomain")
   public void testUpdateDomain() throws Exception {
      UpdateDomain updateDomain = UpdateDomain.builder()
            .email("jclouds3@" + JCLOUDS_EXAMPLE)
            .ttl(600003)
            .comment("Hello Domain Update 3")
            .build();
View Full Code Here

         if (domain.getName().equals(ALT_NAME)) {
            domainId = domain.getId();
         }
      }
     
      UpdateDomain updateDomain = UpdateDomain.builder()
            .email("jcloudie@" + ALT_NAME)
            .ttl(600001)
            .comment("Hello Domain Update")
            .build();
View Full Code Here

      Map<String, List<RawRecord>> records = json.apply(response);

      if (records == null)
         return null;
     
      RawRecord rawRecord = Iterables.getOnlyElement(records.get("records"));

      return toRecordDetails.apply(rawRecord);
   }
View Full Code Here

TOP

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

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.