示例#1
0
 @Test
 public void updateStorageQos() {
   StorageQos storageQos = dao.get(FixturesTool.QOS_ID_2);
   assertNotNull(storageQos);
   storageQos.setName("newB");
   storageQos.setDescription(
       "If I owned a company, my employees would love me. They’d have huge pictures of me up the walls and in their home, like Lenin.");
   storageQos.setMaxThroughput(30);
   storageQos.setMaxReadThroughput(30);
   storageQos.setMaxWriteThroughput(30);
   storageQos.setMaxIops(30);
   storageQos.setMaxReadIops(30);
   storageQos.setMaxWriteIops(30);
   assertFalse(storageQos.equals(dao.get(FixturesTool.QOS_ID_2)));
   dao.update(storageQos);
   StorageQos fetched = dao.get(FixturesTool.QOS_ID_2);
   assertNotNull(fetched);
   assertEquals(storageQos, fetched);
 }
示例#2
0
 @Test
 public void saveStorageQos() {
   StorageQos storageQos = new StorageQos();
   storageQos.setId(Guid.newGuid());
   assertNull(dao.get(storageQos.getId()));
   storageQos.setName("qos_d");
   storageQos.setDescription("bla bla");
   storageQos.setStoragePoolId(FixturesTool.STORAGE_POOL_MIXED_TYPES);
   storageQos.setMaxThroughput(200);
   storageQos.setMaxReadThroughput(200);
   storageQos.setMaxWriteThroughput(200);
   storageQos.setMaxIops(200);
   storageQos.setMaxReadIops(200);
   storageQos.setMaxWriteIops(200);
   dao.save(storageQos);
   StorageQos fetched = dao.get(storageQos.getId());
   assertNotNull(fetched);
   assertEquals(storageQos, fetched);
 }
示例#3
0
  @Test
  public void getStorageQos() {
    StorageQos storageQos = new StorageQos();
    storageQos.setId(FixturesTool.QOS_ID_1);
    storageQos.setName("qos_a");
    storageQos.setDescription(
        "You don't understand. There's relationship George, and then there's the George you know. Baudy George, Funny George");
    storageQos.setStoragePoolId(FixturesTool.STORAGE_POOL_MIXED_TYPES);
    storageQos.setMaxThroughput(1000);
    storageQos.setMaxReadThroughput(2000);
    storageQos.setMaxWriteThroughput(500);
    storageQos.setMaxIops(1000);
    storageQos.setMaxReadIops(2000);
    storageQos.setMaxWriteIops(500);

    StorageQos fetched = dao.get(FixturesTool.QOS_ID_1);
    assertNotNull(fetched);
    assertEquals(storageQos, fetched);
  }