Package com.dyn.client.v3.traffic.filters

Examples of com.dyn.client.v3.traffic.filters.SessionManagerTest


   String zoneFQDN = System.getProperty("user.name").replace('.', '-') + ".record.dynecttest.jclouds.org";
   String contact = JcloudsVersion.get() + ".jclouds.org";

   private void createZone() {
      Job job = zoneApi().scheduleCreateWithContact(zoneFQDN, contact);
      checkNotNull(job, "unable to create zone %s", zoneFQDN);
      getAnonymousLogger().info("created zone: " + job);
      assertEquals(job.getStatus(), Status.SUCCESS);
      assertEquals(api.getJob(job.getId()), job);
      Zone zone = zoneApi().publish(zoneFQDN);
      checkNotNull(zone, "unable to publish zone %s", zoneFQDN);
      getAnonymousLogger().info("published zone: " + zone);
   }
View Full Code Here


                                            .build();

   public void testCreateRecord() {
      createZone();

      Job job = null;
      while (true) {
         try {
            job = api(zoneFQDN).scheduleCreate(record);
            break;
         } catch (JobStillRunningException e) {
            continue;
         }
      }

      checkNotNull(job, "unable to create record %s", record);
      getAnonymousLogger().info("created record: " + job);
      assertEquals(job.getStatus(), Status.SUCCESS);
      assertEquals(api.getJob(job.getId()), job);
      zoneApi().publish(zoneFQDN);
   }
View Full Code Here

      checkRecord(newRecord);
   }

   @Test(dependsOnMethods = { "testListByFQDNAndType", "testListByFQDN" })
   public void testDeleteRecord() {
      Job job = api(zoneFQDN).scheduleDelete(id);
      checkNotNull(job, "unable to delete record %s", id);
      getAnonymousLogger().info("deleted record: " + job);
      assertEquals(job.getStatus(), Status.SUCCESS);
      assertEquals(api.getJob(job.getId()), job);
      zoneApi().publish(zoneFQDN);
   }
View Full Code Here

public class RecordIdBinder implements Binder {
   @SuppressWarnings("unchecked")
   @Override
   public <R extends HttpRequest> R bindToRequest(R request, Object recordId) {
      RecordId valueToAppend = RecordId.class.cast(checkNotNull(recordId, "recordId"));
      URI path = uriBuilder(request.getEndpoint()).appendPath("/{type}Record/{zone}/{fqdn}/{id}").build(
            ImmutableMap.<String, Object> builder()
                        .put("type", valueToAppend.getType())
                        .put("zone", valueToAppend.getZone())
                        .put("fqdn", valueToAppend.getFQDN())
                        .put("id", valueToAppend.getId()).build());
      return (R) request.toBuilder().endpoint(path).build();
   }
View Full Code Here

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

            this.rdata = rdata;
            return this;
         }

         public Value build() {
            return new Value(label, weight, rdata);
         }
View Full Code Here

            if (weights == null)
               weights = ImmutableList.of();

            List<String> labels = creepyGeoRegionGroup.label.get(type.toLowerCase() + "_label");
            for (int i = 0; i < entry.getValue().size(); i++) {
               Builder elementBuilder = Value.builder().rdata(entry.getValue().get(i));
               // chance of index out of bounds
               if (i < labels.size())
                  elementBuilder.label(labels.get(i));
               if (i < weights.size())
                  elementBuilder.weight(weights.get(i));
               rset.add(elementBuilder.build());
            }
            rsets.add(rset.build());
         }
         builder.recordSets(rsets.build());
         return builder.build();
View Full Code Here

            .userName(key.identity.substring(key.identity.indexOf(':') + 1)).password(key.credential).build();
   }

   @Override
   public HttpRequest filter(HttpRequest request) throws HttpException {
      Session session = sessionCache.getUnchecked(creds.get());
      Builder<?> builder = request.toBuilder();
      builder.replaceHeader("Auth-Token", session.getToken());
      return builder.build();
   }
View Full Code Here

      checkNotNull(zone.getVersion()"Version cannot be null for a Session.");
   }

   @Test
   protected void testCreateSession() {
      SessionCredentials credentials = SessionCredentials.builder()
                                                         .customerName(identity.substring(0, identity.indexOf(':')))
                                                         .userName(identity.substring(identity.indexOf(':') + 1))
                                                         .password(credential).build();
      session = api().login(credentials);
      checkSession(session);
View Full Code Here

   protected void testListAndGetZones() {
      ImmutableList<String> zones = api().list().toList();
      getAnonymousLogger().info("zones: " + zones.size());

      for (String fqdn : zones) {
         Zone zone = api().get(fqdn);
         checkNotNull(zone, "zone was null for Zone: %s", fqdn);
         checkZone(zone);
      }
   }
View Full Code Here

TOP

Related Classes of com.dyn.client.v3.traffic.filters.SessionManagerTest

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.