Esempio n. 1
0
  @Test
  public void enable() {
    res = host.enable();
    assertTrue(res.getErrorMessage(), !res.isError());

    host.info();
    assertTrue(host.isEnabled());
  }
Esempio n. 2
0
  @Test
  public void update() {
    res = host.info();
    assertTrue(res.getErrorMessage(), !res.isError());

    assertTrue(host.xpath("TEMPLATE/ATT1").equals(""));
    assertTrue(host.xpath("TEMPLATE/ATT2").equals(""));

    String new_template = "ATT2 = NEW_VAL\n" + "ATT3 = VAL3";

    res = host.update(new_template);
    assertTrue(res.getErrorMessage(), !res.isError());

    res = host.info();
    assertTrue(res.getErrorMessage(), !res.isError());
    assertTrue(host.xpath("TEMPLATE/ATT1").equals(""));
    assertTrue(host.xpath("TEMPLATE/ATT2").equals("NEW_VAL"));
    assertTrue(host.xpath("TEMPLATE/ATT3").equals("VAL3"));
  }
Esempio n. 3
0
  @Test
  public void info() {
    res = host.info();
    assertTrue(res.getErrorMessage(), !res.isError());

    //        assertTrue( host.getId().equals("0") );
    assertTrue(host.id() >= 0);

    //        assertTrue( host.shortStateStr().equals("on") );
  }
Esempio n. 4
0
  @Test
  public void delete() {
    String name = host.getName();

    res = host.delete();
    assertTrue(res.getErrorMessage(), !res.isError());

    res = host.info();
    assertTrue(res.isError());

    res = hostPool.info();
    assertTrue(res.getErrorMessage(), !res.isError());

    boolean found = false;
    for (Host h : hostPool) {
      found = found || h.getName().equals(name);
    }

    assertTrue(!found);
  }