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

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


      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

      assertEquals(job.getStatus(), Job.Status.COMPLETED);
      assertTrue(job.getResource().isPresent());
     
      Set<RecordDetail> records = job.getResource().get();
      Date now = new Date();
      RecordDetail mxRecord = null;
      RecordDetail aRecord = null;
     
      for (RecordDetail record: records) {
         if (record.getType().equals("MX")) {
            mxRecord = record;
         } else if (record.getType().equals("A")) {
            aRecord = record;
         }
      }
     
      assertNotNull(mxRecord.getId());
      assertEquals(mxRecord.getType(), "MX");
      assertEquals(mxRecord.getName(), JCLOUDS_EXAMPLE);
      assertEquals(mxRecord.getPriority().intValue(), 11235);
      assertEquals(mxRecord.getComment(), "MX Record");
      assertEquals(mxRecord.getTTL(), 60000);
      assertTrue(mxRecord.getCreated().before(now));
      assertTrue(mxRecord.getUpdated().before(now));
     
      assertNotNull(aRecord.getId());
      assertEquals(aRecord.getType(), "A");
      assertEquals(aRecord.getName(), JCLOUDS_EXAMPLE);
      assertNull(aRecord.getPriority());
      assertEquals(aRecord.getTTL(), 60000);
      assertTrue(aRecord.getCreated().before(now));
      assertTrue(aRecord.getUpdated().before(now));
   }
View Full Code Here

            responseWithAccess,
            authenticatedGET().endpoint(endpoint).build(),
            HttpResponse.builder().statusCode(OK.getStatusCode()).payload(payloadFromResource("/record-list-with-filter.json")).build())
            .getRecordApiForDomain(3650908);

      RecordDetail record = api.getByNameAndTypeAndData(JCLOUDS_EXAMPLE, "A", "10.0.1.0");
      Date now = new Date();
     
      assertEquals(record.getId(), "A-9846146");
      assertEquals(record.getName(), JCLOUDS_EXAMPLE);
      assertEquals(record.getType(), "A");
      assertEquals(record.getData(), "10.0.1.0");
      assertEquals(record.getTTL(), 60000);
      assertTrue(record.getCreated().before(now));
      assertTrue(record.getUpdated().before(now));
   }
View Full Code Here

            responseWithAccess,
            authenticatedGET().endpoint(endpoint).build(),
            HttpResponse.builder().statusCode(OK.getStatusCode()).payload(payloadFromResource("/record-get.json")).build())
            .getRecordApiForDomain(3650908);

      RecordDetail record = api.get("A-9846146");
      Date now = new Date();

      assertEquals(record.getId(), "A-9846146");
      assertEquals(record.getName(), JCLOUDS_EXAMPLE);
      assertEquals(record.getType(), "A");
      assertEquals(record.getData(), "10.0.1.0");
      assertEquals(record.getTTL(), 60000);
      assertTrue(record.getCreated().before(now));
      assertTrue(record.getUpdated().before(now));
   }
View Full Code Here

      assertTrue(testjclouds.getCreated().before(now));
      assertTrue(testjclouds.getUpdated().before(now));
     
      assertEquals(jclouds.getRecords().size(), 2);
     
      RecordDetail mxRecord = null;
      RecordDetail aRecord = null;
     
      for (RecordDetail record: jclouds.getRecords()) {
         if (record.getType().equals("MX")) {
            mxRecord = record;
         } else if (record.getType().equals("A")) {
            aRecord = record;
         }
      }
     
      assertNotNull(mxRecord.getId());
      assertEquals(mxRecord.getType(), "MX");
      assertEquals(mxRecord.getName(), JCLOUDS_EXAMPLE);
      assertEquals(mxRecord.getPriority().intValue(), 11235);
      assertEquals(mxRecord.getComment(), "MX Record");
      assertEquals(mxRecord.getTTL(), 60000);
      assertTrue(mxRecord.getCreated().before(now));
      assertTrue(mxRecord.getUpdated().before(now));
     
      assertNotNull(aRecord.getId());
      assertEquals(aRecord.getType(), "A");
      assertEquals(aRecord.getName(), JCLOUDS_EXAMPLE);
      assertNull(aRecord.getPriority());
      assertEquals(aRecord.getComment(), "A Record");
      assertEquals(aRecord.getTTL(), 60000);
      assertTrue(aRecord.getCreated().before(now));
      assertTrue(aRecord.getUpdated().before(now));
     
      assertTrue(altjclouds.getId() > 0);
      assertTrue(altjclouds.getAccountId() > 0);
      assertEquals(altjclouds.getName(), "alt-" + JCLOUDS_EXAMPLE);
      assertEquals(altjclouds.getEmail(), "jclouds2@" + JCLOUDS_EXAMPLE);
View Full Code Here

      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;
      RecordDetail nsRecord = null;
     
      for (RecordDetail record: jclouds.getRecords()) {
         if (record.getType().equals("MX")) {
            mxRecord = record;
         } else if (record.getType().equals("A")) {
            aRecord = record;
         } else if (record.getType().equals("NS")) {
            nsRecord = record; // don't care which one we get
         }
      }
     
      assertNotNull(mxRecord.getId());
      assertEquals(mxRecord.getType(), "MX");
      assertEquals(mxRecord.getName(), JCLOUDS_EXAMPLE);
      assertEquals(mxRecord.getPriority().intValue(), 11235);
      assertEquals(mxRecord.getComment(), "MX Record");
      assertEquals(mxRecord.getTTL(), 60000);
      assertTrue(mxRecord.getCreated().before(now));
      assertTrue(mxRecord.getUpdated().before(now));
     
      assertNotNull(aRecord.getId());
      assertEquals(aRecord.getType(), "A");
      assertEquals(aRecord.getName(), JCLOUDS_EXAMPLE);
      assertNull(aRecord.getPriority());
      assertEquals(aRecord.getComment(), "A Record");
      assertEquals(aRecord.getTTL(), 60000);
      assertTrue(aRecord.getCreated().before(now));
      assertTrue(aRecord.getUpdated().before(now));

      assertNotNull(nsRecord.getId());
      assertEquals(nsRecord.getType(), "NS");
      assertEquals(nsRecord.getName(), JCLOUDS_EXAMPLE);
      assertEquals(nsRecord.getTTL(), 600001);
      assertTrue(nsRecord.getCreated().before(now));
      assertTrue(nsRecord.getUpdated().before(now));
   }
View Full Code Here

      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

TOP

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

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.