Ejemplo n.º 1
0
  @Test(enabled = true, dependsOnMethods = "testReboot")
  public void testSuspendResume() throws Exception {
    client.suspendNodesMatching(withTag(tag));

    Set<? extends NodeMetadata> stoppedNodes = refreshNodes();

    assert Iterables.all(
            stoppedNodes,
            new Predicate<NodeMetadata>() {

              @Override
              public boolean apply(NodeMetadata input) {
                boolean returnVal = input.getState() == NodeState.SUSPENDED;
                if (!returnVal)
                  System.err.printf(
                      "warning: node %s in state %s%n", input.getId(), input.getState());
                return returnVal;
              }
            })
        : stoppedNodes;

    client.resumeNodesMatching(withTag(tag));
    testGet();
  }
 @Test(enabled = true, dependsOnMethods = "testGet")
 public void testReboot() throws Exception {
   client.rebootNodesMatching(NodePredicates.withTag(tag)); // TODO test
   // validation
   testGet();
 }