Package org.jclouds.cloudservers.domain

Examples of org.jclouds.cloudservers.domain.Server


   @Test(timeOut = 5 * 60 * 1000, dependsOnMethods = "testCreateSharedIpGroup")
   public void testCreateServerIp() throws Exception {
      int imageId = 14362;
      int flavorId = 1;
      Server server = null;
      while (server == null) {
         String serverName = serverPrefix + "createserver" + new SecureRandom().nextInt();
         try {
            server = client
                     .createServer(serverName, imageId, flavorId, withFile("/etc/jclouds.txt", "rackspace".getBytes())
                              .withMetadata(metadata).withSharedIpGroup(sharedIpGroupId).withSharedIp(ip));
         } catch (UndeclaredThrowableException e) {
            HttpResponseException htpe = (HttpResponseException) e.getCause().getCause();
            if (htpe.getResponse().getStatusCode() == 400)
               continue;
            throw e;
         }
      }
      assertNotNull(server.getAdminPass());
      serverId2 = server.getId();
      adminPass2 = server.getAdminPass();
      blockUntilServerActive(serverId2);
      assertIpConfigured(server, adminPass2);
      assert server.getAddresses().getPublicAddresses().contains(ip) : server.getAddresses() + " doesn't contain " + ip;
      assertEquals(server.getSharedIpGroupId(), Integer.valueOf(sharedIpGroupId));
   }
View Full Code Here


   @Test(timeOut = 10 * 60 * 1000, dependsOnMethods = "testCreateServerIp")
   public void testUnshare() throws Exception {
      client.unshareIp(ip, serverId2);
      blockUntilServerActive(serverId2);
      Server server = client.getServer(serverId2);
      assert !server.getAddresses().getPublicAddresses().contains(ip) : server.getAddresses();
      assertIpNotConfigured(server, adminPass2);
   }
View Full Code Here

TOP

Related Classes of org.jclouds.cloudservers.domain.Server

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.