Пример #1
0
  @Test
  public void testLifeCycle() {
    // Get the first image, we dont really care what it is in this test.
    NewServerResponse serverResponse =
        connection.createServer("test.ivan.api.com", "lenny", "MIRO4B");
    Server server = serverResponse.getServer();
    // Now we have the server, lets restart it
    assertNotNull(server.getId());
    ServerInfo serverInfo = connection.restartServer(server.getId());

    // Should be running now.
    assertEquals(serverInfo.getState(), RunningState.RUNNING);
    assertEquals(server.getName(), "test.ivan.api.com");
    assertEquals(server.getImageId(), "lenny");
    connection.destroyServer(server.getId());
  }
Пример #2
0
 @Override
 public int compareTo(NewServerResponse server) {
   return this.server.getId().compareTo(server.getServer().getId());
 }