예제 #1
0
  /** @throws java.lang.Exception */
  @Before
  public void setUp() throws Exception {
    res = VirtualRouter.allocate(client, template_str);

    int oid = res.isError() ? -1 : Integer.parseInt(res.getMessage());
    vrouter = new VirtualRouter(oid, client);
  }
예제 #2
0
  @Test
  public void allocate() {
    vrouter.delete();

    res = VirtualRouter.allocate(client, template_str);
    assertTrue(res.getErrorMessage(), !res.isError());

    int oid = res.isError() ? -1 : Integer.parseInt(res.getMessage());
    vrouter = new VirtualRouter(oid, client);

    vrouterPool.info();

    boolean found = false;
    for (VirtualRouter temp : vrouterPool) {
      found = found || temp.getName().equals(name);
    }

    assertTrue(found);
  }