Package org.jclouds.ultradns.ws.domain

Examples of org.jclouds.ultradns.ws.domain.PoolRecordSpec


   private TrafficControllerPoolRecordDetail checkPoolRecordConsistent(String zoneName, TrafficControllerPoolRecordDetail record) {
      Optional<TrafficControllerPool> pool = getPoolByZoneAndId(zoneName, record.getPoolId());
      assertTrue(pool.isPresent(), "could not get pool for " + record);
      assertEquals(record.getDescription(), pool.get().getName());
      PoolRecordSpec spec = checkPoolRecordSpec(api(zoneName).getRecordSpec(record.getId()));
      assertEquals(record.getDescription(), spec.getDescription());
      assertEquals(record.getWeight(), spec.getWeight());
      assertEquals(record.isProbingEnabled(), spec.isProbingEnabled());
      return checkTrafficControllerPoolRecord(record);
   }
View Full Code Here


      } else {
         recordId = api(zoneName).addRecordToPoolWithTTL(rdata, poolId, ttl);
      }
      getAnonymousLogger().info("created " + type + " record: " + recordId);
      TrafficControllerPoolRecordDetail record = checkPoolRecordConsistent(zoneName, getRecordById(recordId).get());
      PoolRecordSpec recordSpec = checkPoolRecordSpec(api(zoneName).getRecordSpec(recordId));
      assertEquals(record.getRecord(), TrafficControllerPoolRecord.create(type, rdata));
      assertEquals(record.getWeight(), weight.or(2).intValue());
      assertEquals(recordSpec.getTTL(), ttl);
      return record;
   }
View Full Code Here

      cname2 = addRecordToPool("www.bar.com.", "CNAME", 30, Optional.<Integer> absent()).getId();
   }

   @Test(dependsOnMethods = "addCNAMERecordsToPool")
   public void testUpdateRecord() {
      PoolRecordSpec spec = api(zoneName).getRecordSpec(cname2);
      UpdatePoolRecord update = UpdatePoolRecord.builder().from(spec)
                                                .rdata("www.baz.com.")
                                                .weight(98)
                                                .ttl(200).build();

      api(zoneName).updateRecord(cname2, update);

      TrafficControllerPoolRecordDetail record = getRecordById(cname2).get();
      assertEquals(record.getRecord().getRData(), "www.baz.com.");

      spec = api(zoneName).getRecordSpec(cname2);
      assertEquals(spec.getWeight(), 98);
      assertEquals(spec.getTTL(), 200);
   }
View Full Code Here

public class GetPoolRecordSpecResponseTest extends BaseHandlerTest {

   public void test() {
      InputStream is = getClass().getResourceAsStream("/poolrecordspec.xml");

      PoolRecordSpec expected = expected();

      PoolRecordSpecHandler handler = injector.getInstance(PoolRecordSpecHandler.class);
      PoolRecordSpec result = factory.create(handler).parse(is);

      assertEquals(result, expected);
      assertEquals(result.hashCode(), expected.hashCode());
      assertEquals(result.toString(), expected.toString());
   }
View Full Code Here

   private TrafficControllerPoolRecordDetail checkPoolRecordConsistent(String zoneName, TrafficControllerPoolRecordDetail record) {
      Optional<TrafficControllerPool> pool = getPoolByZoneAndId(zoneName, record.getPoolId());
      assertTrue(pool.isPresent(), "could not get pool for " + record);
      assertEquals(record.getDescription(), pool.get().getName());
      PoolRecordSpec spec = checkPoolRecordSpec(api(zoneName).getRecordSpec(record.getId()));
      assertEquals(record.getDescription(), spec.getDescription());
      assertEquals(record.getWeight(), spec.getWeight());
      assertEquals(record.isProbingEnabled(), spec.isProbingEnabled());
      return checkTrafficControllerPoolRecord(record);
   }
View Full Code Here

      } else {
         recordId = api(zoneName).addRecordToPoolWithTTL(rdata, poolId, ttl);
      }
      getAnonymousLogger().info("created " + type + " record: " + recordId);
      TrafficControllerPoolRecordDetail record = checkPoolRecordConsistent(zoneName, getRecordById(recordId).get());
      PoolRecordSpec recordSpec = checkPoolRecordSpec(api(zoneName).getRecordSpec(recordId));
      assertEquals(record.getRecord(), TrafficControllerPoolRecord.create(type, rdata));
      assertEquals(record.getWeight(), weight.or(2).intValue());
      assertEquals(recordSpec.getTTL(), ttl);
      return record;
   }
View Full Code Here

      cname2 = addRecordToPool("www.bar.com.", "CNAME", 30, Optional.<Integer> absent()).getId();
   }

   @Test(dependsOnMethods = "addCNAMERecordsToPool")
   public void testUpdateRecord() {
      PoolRecordSpec spec = api(zoneName).getRecordSpec(cname2);
      UpdatePoolRecord update = UpdatePoolRecord.builder().from(spec)
                                                .rdata("www.baz.com.")
                                                .weight(98)
                                                .ttl(200).build();

      api(zoneName).updateRecord(cname2, update);

      TrafficControllerPoolRecordDetail record = getRecordById(cname2).get();
      assertEquals(record.getRecord().getRData(), "www.baz.com.");

      spec = api(zoneName).getRecordSpec(cname2);
      assertEquals(spec.getWeight(), 98);
      assertEquals(spec.getTTL(), 200);
   }
View Full Code Here

public class GetPoolRecordSpecResponseTest extends BaseHandlerTest {

   public void test() {
      InputStream is = getClass().getResourceAsStream("/poolrecordspec.xml");

      PoolRecordSpec expected = expected();

      PoolRecordSpecHandler handler = injector.getInstance(PoolRecordSpecHandler.class);
      PoolRecordSpec result = factory.create(handler).parse(is);

      assertEquals(result, expected);
      assertEquals(result.hashCode(), expected.hashCode());
      assertEquals(result.toString(), expected.toString());
   }
View Full Code Here

public class GetPoolRecordSpecResponseTest extends BaseHandlerTest {

   public void test() {
      InputStream is = getClass().getResourceAsStream("/poolrecordspec.xml");

      PoolRecordSpec expected = expected();

      PoolRecordSpecHandler handler = injector.getInstance(PoolRecordSpecHandler.class);
      PoolRecordSpec result = factory.create(handler).parse(is);

      assertEquals(result, expected);
      assertEquals(result.hashCode(), expected.hashCode());
      assertEquals(result.toString(), expected.toString());
   }
View Full Code Here

   private TrafficControllerPoolRecordDetail checkPoolRecordConsistent(String zoneName, TrafficControllerPoolRecordDetail record) {
      Optional<TrafficControllerPool> pool = getPoolByZoneAndId(zoneName, record.getPoolId());
      assertTrue(pool.isPresent(), "could not get pool for " + record);
      assertEquals(record.getDescription(), pool.get().getName());
      PoolRecordSpec spec = checkPoolRecordSpec(api(zoneName).getRecordSpec(record.getId()));
      assertEquals(record.getDescription(), spec.getDescription());
      assertEquals(record.getWeight(), spec.getWeight());
      assertEquals(record.isProbingEnabled(), spec.isProbingEnabled());
      return checkTrafficControllerPoolRecord(record);
   }
View Full Code Here

TOP

Related Classes of org.jclouds.ultradns.ws.domain.PoolRecordSpec

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.