Package org.jclouds.route53

Examples of org.jclouds.route53.Route53Api


*/
@Test(groups = "unit", testName = "AWSRoute53ProviderTest")
public class AWSRoute53ProviderTest extends BaseProviderMetadataTest {

   public AWSRoute53ProviderTest() {
      super(new AWSRoute53ProviderMetadata(), new Route53ApiMetadata());
   }
View Full Code Here


   @Override
   public void setup() {
      super.setup();
      inSync = retry(new Predicate<Change>() {
         public boolean apply(Change input) {
            Change change = api.getChange(input.getId());
            return change != null && change.getStatus() == INSYNC;
         }
      }, 600, 1, 5, SECONDS);
   }
View Full Code Here

         assertEquals(newHostedZone.getZone().getCallerReference(), nonce);
         assertEquals(newHostedZone.getZone().getComment().get(), comment);
        
         assertTrue(inSync.apply(newHostedZone.getChange()), "zone didn't sync " + newHostedZone);
      } finally {
         Change delete = api().delete(newHostedZone.getZone().getId());
         assertTrue(inSync.apply(delete), "delete didn't sync " + delete);
      }
   }
View Full Code Here

public class GetChangeResponseTest extends BaseHandlerTest {

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

      Change expected = expected();

      ChangeHandler handler = injector.getInstance(ChangeHandler.class);
      Change result = factory.create(handler).parse(is);

      assertEquals(result, expected);
      assertEquals(result.getStatus(), expected.getStatus());
      assertEquals(result.getSubmittedAt(), expected.getSubmittedAt());
   }
View Full Code Here

   private static final SerializeRRS xml = new SerializeRRS();

   @SuppressWarnings("unchecked")
   @Override
   public <R extends HttpRequest> R bindToRequest(R request, Object payload) {
      ChangeBatch from = ChangeBatch.class.cast(payload);
      StringBuilder b = new StringBuilder();
      b.append("<ChangeResourceRecordSetsRequest xmlns=\"https://route53.amazonaws.com/doc/2012-02-29/\"><ChangeBatch>");
      if (from.getComment().isPresent())
         b.append("<Comment>").append(from.getComment().get()).append("</Comment>");
      b.append("<Changes>");
      for (ActionOnResourceRecordSet change : from)
         b.append("<Change>").append("<Action>").append(change.getAction()).append("</Action>")
               .append(xml.apply(change.getRRS())).append("</Change>");
      b.append("</Changes>");
View Full Code Here

      public boolean equals(Object obj) {
         if (this == obj)
            return true;
         if (obj == null || getClass() != obj.getClass())
            return false;
         ActionOnResourceRecordSet that = ActionOnResourceRecordSet.class.cast(obj);
         return equal(this.action, that.action) && equal(this.rrs, that.rrs);
      }
View Full Code Here

         checkAllRRs(zone.getId());
      }
   }

   private void checkAllRRs(String zoneId) {
      HostedZone zone = api.getHostedZoneApi().get(zoneId).getZone();
      List<ResourceRecordSet> records = api(zone.getId()).list().concat().toList();
      assertEquals(zone.getResourceRecordSetCount(), records.size());

      for (ResourceRecordSet rrs : records) {
         recordTypeCounts.getUnchecked(rrs.getType()).addAndGet(
               rrs.getAliasTarget().isPresent() ? 1 : rrs.getValues().size());
         checkRRS(rrs);
View Full Code Here

public class GetHostedZoneResponseTest extends BaseHandlerTest {

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

      HostedZoneAndNameServers expected = expected();

      GetHostedZoneResponseHandler handler = injector.getInstance(GetHostedZoneResponseHandler.class);
      HostedZoneAndNameServers result = factory.create(handler).parse(is);

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

      this.changeHandler = changeHandler;
   }

   @Override
   public NewHostedZone getResult() {
      HostedZoneAndNameServers zone = zoneHandler.getResult();
      return NewHostedZone.create(zone, changeHandler.getResult());
   }
View Full Code Here

   @Test
   public void testCreateAndDeleteHostedZone() {
      String name = System.getProperty("user.name").replace('.', '-') + ".zone.route53test.jclouds.org.";
      String nonce = name + " @ " + new Date();
      String comment = name + " for " + JcloudsVersion.get();
      NewHostedZone newHostedZone = api().createWithReferenceAndComment(name, nonce, comment);
      getAnonymousLogger().info("created zone: " + newHostedZone);
      try {
         checkHostedZone(newHostedZone.getZone());
         assertEquals(newHostedZone.getChange().getStatus(), PENDING, "invalid status on zone " + newHostedZone);
         assertTrue(newHostedZone.getNameServers().size() > 0, "no name servers for zone " + newHostedZone);
         assertEquals(newHostedZone.getZone().getName(), name);
         assertEquals(newHostedZone.getZone().getCallerReference(), nonce);
         assertEquals(newHostedZone.getZone().getComment().get(), comment);
        
         assertTrue(inSync.apply(newHostedZone.getChange()), "zone didn't sync " + newHostedZone);
      } finally {
         Change delete = api().delete(newHostedZone.getZone().getId());
         assertTrue(inSync.apply(delete), "delete didn't sync " + delete);
      }
   }
View Full Code Here

TOP

Related Classes of org.jclouds.route53.Route53Api

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.