예제 #1
0
  /** Ensures that getting a VM pool works as expected. */
  @Test
  public void testGetVmPool() {
    vm_pools result = dao.get(existingVmPool.getvm_pool_id());

    assertNotNull(result);
    assertEquals(existingVmPool, result);
  }
예제 #2
0
  /** Ensures removing a VM pool works as expected. */
  @Test
  public void testRemoveVmPool() {
    dao.remove(deletableVmPool.getvm_pool_id());

    vm_pools result = dao.get(deletableVmPool.getvm_pool_id());

    assertNull(result);
  }
예제 #3
0
  /** Ensures that updating a VM pool works as expected. */
  @Test
  public void testUpdateVmPool() {
    existingVmPool.setvm_pool_description("This is an updated VM pool.");

    dao.update(existingVmPool);

    vm_pools result = dao.get(existingVmPool.getvm_pool_id());

    assertEquals(existingVmPool, result);
  }
예제 #4
0
  @Override
  public void setUp() throws Exception {
    super.setUp();

    dao = prepareDAO(dbFacade.getVmPoolDAO());

    existingVmPool = dao.get(EXISTING_VM_POOL_ID);
    deletableVmPool = dao.get(DELETABLE_VM_POOL_ID);

    newVmPool = new vm_pools();
    newVmPool.setvm_pool_name("New VM Pool");
    newVmPool.setvm_pool_description("This is a new VM pool.");
    newVmPool.setvds_group_id(VDS_GROUP_ID);

    existingVmPoolMap = dao.getVmPoolMapByVmGuid(new Guid("77296e00-0cad-4e5a-9299-008a7b6f4355"));
    newVmPoolMap = new vm_pool_map(FREE_VM_ID, existingVmPool.getvm_pool_id());

    existingTimeLeaseVmPoolMap =
        dao.getTimeLeasedVmPoolMapByIdForVmPool(EXISTING_LEASE_ID, EXISTING_VM_POOL_ID);
    newTimeLeaseVmPoolMap =
        new time_lease_vm_pool_map(new Date(), Guid.NewGuid(), new Date(), 1, FREE_VM_POOL_ID);
  }
예제 #5
0
  /** Ensures that null is returned when the id is invalid. */
  @Test
  public void testGetVmPoolWithInvalidId() {
    vm_pools result = dao.get(NGuid.NewGuid());

    assertNull(result);
  }