Package org.jclouds.glesys.domain

Examples of org.jclouds.glesys.domain.IpDetails$Builder


      checkOpenVZDefailsInFalkenberg(reservedIp);
   }

   @Test(dependsOnMethods = "reserveIp")
   public void reserveAndReleaseIp() throws Exception {
      IpDetails details = ipApi.release(reservedIp.getAddress());
      assertEquals(details.getAddress(), reservedIp.getAddress());
      assertFalse(details.isReserved());

      // reserve an address again!
      reserveIp();
   }
View Full Code Here


   @Test
   public void testGetOpenVZDetails() throws Exception {
      FluentIterable<String> openVzIps = ipApi.listFree(4, "Falkenberg", "OpenVZ");
      assertFalse(openVzIps.isEmpty());
      String openVzIp = openVzIps.iterator().next();
      IpDetails ipDetails = ipApi.get(openVzIp);
      checkOpenVZDefailsInFalkenberg(ipDetails);
      assertEquals(ipDetails.getAddress(), openVzIp);
   }
View Full Code Here

   @Test
   public void testGetXenDetails() throws Exception {
      FluentIterable<String> xenVzIps = ipApi.listFree(4, "Falkenberg", "Xen");
      assertFalse(xenVzIps.isEmpty());
      String xenIp = xenVzIps.iterator().next();
      IpDetails ipDetails = ipApi.get(xenIp);
      assertEquals(ipDetails.getDatacenter(), "Falkenberg");
      assertEquals(ipDetails.getPlatform(), "Xen");
      assertEquals(ipDetails.getVersion(), 4);
      assertEquals(ipDetails.getAddress(), xenIp);
      assertFalse(ipDetails.getPtr().isEmpty());
      assertNotNull(ipDetails.getBroadcast());
      assertNotNull(ipDetails.getGateway());
      assertNotNull(ipDetails.getNetmask());
      assertFalse(ipDetails.getNameServers().isEmpty());
   }
View Full Code Here

      assertFalse(ipDetails.getNameServers().isEmpty());
   }

   @Test(dependsOnMethods = "reserveIp")
   public void testPtrSetReset() throws Exception {
      IpDetails original = reservedIp;

      IpDetails modified = ipApi.setPtr(reservedIp.getAddress(), "wibble.");
      IpDetails modified2 = ipApi.get(reservedIp.getAddress());

      assertEquals(modified.getPtr(), "wibble.");
      assertEquals(modified2, modified);

      reservedIp = ipApi.resetPtr(reservedIp.getAddress());
View Full Code Here

      assertEquals(reservedIp, original);
   }

   @Test(dependsOnMethods = "reserveIp")
   public void testAddRemove() throws Exception {
      IpDetails added = ipApi.addToServer(reservedIp.getAddress(), serverId);

      assertEquals(added.getAddress(), reservedIp.getAddress());
      assertEquals(added.getPtr(), reservedIp.getPtr());
      assertEquals(added.getServerId(), serverId);

      IpDetails again = ipApi.get(reservedIp.getAddress());
      assertEquals(again, added);

      IpDetails removed = ipApi.removeFromServer(reservedIp.getAddress(), serverId);
      assertEquals(removed, added.toBuilder().serverId(null).build());

      assertEquals(removed, reservedIp);

      Set<String> openVzIps = Sets.newHashSet(ipApi.listFree(4, "Falkenberg", "OpenVZ"));
      openVzIps.remove(reservedIp.getAddress());
      assertFalse(openVzIps.isEmpty());

      added = ipApi.addToServer(reservedIp.getAddress(), serverId);

      assertEquals(added.getServerId(), serverId);

      removed = ipApi.removeFromServerAndRelease(reservedIp.getAddress(), serverId);

      assertNull(removed.getServerId());
      assertFalse(removed.isReserved());

      // reserve an address again!
      reserveIp();
   }
View Full Code Here

      checkOpenVZDefailsInFalkenberg(reservedIp);
   }

   @Test(dependsOnMethods = "reserveIp")
   public void reserveAndReleaseIp() throws Exception {
      IpDetails details = ipApi.release(reservedIp.getAddress());
      assertEquals(details.getAddress(), reservedIp.getAddress());
      assertFalse(details.isReserved());

      // reserve an address again!
      reserveIp();
   }
View Full Code Here

   @Test
   public void testGetOpenVZDetails() throws Exception {
      FluentIterable<String> openVzIps = ipApi.listFree(4, "Falkenberg", "OpenVZ");
      assertFalse(openVzIps.isEmpty());
      String openVzIp = openVzIps.iterator().next();
      IpDetails ipDetails = ipApi.get(openVzIp);
      checkOpenVZDefailsInFalkenberg(ipDetails);
      assertEquals(ipDetails.getAddress(), openVzIp);
   }
View Full Code Here

   @Test
   public void testGetXenDetails() throws Exception {
      FluentIterable<String> xenVzIps = ipApi.listFree(4, "Falkenberg", "Xen");
      assertFalse(xenVzIps.isEmpty());
      String xenIp = xenVzIps.iterator().next();
      IpDetails ipDetails = ipApi.get(xenIp);
      assertEquals(ipDetails.getDatacenter(), "Falkenberg");
      assertEquals(ipDetails.getPlatform(), "Xen");
      assertEquals(ipDetails.getVersion(), 4);
      assertEquals(ipDetails.getAddress(), xenIp);
      assertFalse(ipDetails.getPtr().isEmpty());
      assertNotNull(ipDetails.getBroadcast());
      assertNotNull(ipDetails.getGateway());
      assertNotNull(ipDetails.getNetmask());
      assertFalse(ipDetails.getNameServers().isEmpty());
   }
View Full Code Here

      assertFalse(ipDetails.getNameServers().isEmpty());
   }

   @Test(dependsOnMethods = "reserveIp")
   public void testPtrSetReset() throws Exception {
      IpDetails original = reservedIp;

      IpDetails modified = ipApi.setPtr(reservedIp.getAddress(), "wibble.");
      IpDetails modified2 = ipApi.get(reservedIp.getAddress());

      assertEquals(modified.getPtr(), "wibble.");
      assertEquals(modified2, modified);

      reservedIp = ipApi.resetPtr(reservedIp.getAddress());
View Full Code Here

      assertEquals(reservedIp, original);
   }

   @Test(dependsOnMethods = "reserveIp")
   public void testAddRemove() throws Exception {
      IpDetails added = ipApi.addToServer(reservedIp.getAddress(), serverId);

      assertEquals(added.getAddress(), reservedIp.getAddress());
      assertEquals(added.getPtr(), reservedIp.getPtr());
      assertEquals(added.getServerId(), serverId);

      IpDetails again = ipApi.get(reservedIp.getAddress());
      assertEquals(again, added);

      IpDetails removed = ipApi.removeFromServer(reservedIp.getAddress(), serverId);
      assertEquals(removed, added.toBuilder().serverId(null).build());

      assertEquals(removed, reservedIp);

      Set<String> openVzIps = Sets.newHashSet(ipApi.listFree(4, "Falkenberg", "OpenVZ"));
      openVzIps.remove(reservedIp.getAddress());
      assertFalse(openVzIps.isEmpty());

      added = ipApi.addToServer(reservedIp.getAddress(), serverId);

      assertEquals(added.getServerId(), serverId);

      removed = ipApi.removeFromServerAndRelease(reservedIp.getAddress(), serverId);

      assertNull(removed.getServerId());
      assertFalse(removed.isReserved());

      // reserve an address again!
      reserveIp();
   }
View Full Code Here

TOP

Related Classes of org.jclouds.glesys.domain.IpDetails$Builder

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.