test_class.declarator: dao
test_class.modifier: private
test_class.original_string: private RedisDao dao;
test_class.type: RedisDao
test_class.var_name: dao
test_class.file: vsm/src/test/java/com/abiquo/vsm/redis/dao/RedisDaoTest.java
test_class.identifier: RedisDaoTest
test_class.superclass: extends TestBase
test_case.body: @Test
      public void test_saveAndGetPhysicalMachineWithCache()
      {
          VirtualMachinesCache cache = new VirtualMachinesCache();
          dao.save(cache);
  
          PhysicalMachine pm = new PhysicalMachine();
          pm.setAddress("10.60.1.79");
          pm.setType("vmx-04");
          pm.setUsername("thomas.sullivan");
          pm.setPassword("magnum");
          pm.setVirtualMachines(cache);
  
          pm = dao.save(pm);
  
          PhysicalMachine saved = JOhm.get(PhysicalMachine.class, pm.getId());
  
          assertNotNull(saved);
          assertNotNull(saved.getVirtualMachines());
          assertEquals(saved.getVirtualMachines().getCache().size(), 0);
  
          String uuid1 = UUID.randomUUID().toString();
          saved.getVirtualMachines().getCache().add(uuid1);
  
          saved = JOhm.get(PhysicalMachine.class, pm.getId());
  
          assertNotNull(saved);
          assertNotNull(saved.getVirtualMachines());
          assertEquals(saved.getVirtualMachines().getCache().size(), 1);
          assertTrue(saved.getVirtualMachines().getCache().contains(uuid1));
  
          String uuid2 = UUID.randomUUID().toString();
          saved.getVirtualMachines().getCache().add(uuid2);
  
          saved = JOhm.get(PhysicalMachine.class, pm.getId());
  
          assertNotNull(saved);
          assertNotNull(saved.getVirtualMachines());
          assertEquals(saved.getVirtualMachines().getCache().size(), 2);
          assertTrue(saved.getVirtualMachines().getCache().contains(uuid1));
          assertTrue(saved.getVirtualMachines().getCache().contains(uuid2));
  
          List<String> items = new ArrayList<String>();
          items.add(UUID.randomUUID().toString());
  
          VirtualMachinesCache cache2 = saved.getVirtualMachines();
          cache2.getCache().clear();
          cache2.getCache().addAll(items);
  
          saved = JOhm.get(PhysicalMachine.class, pm.getId());
  
          assertNotNull(saved);
          assertNotNull(saved.getVirtualMachines());
          assertEquals(saved.getVirtualMachines().getCache().size(), 1);
      }
test_case.class_method_signature: RedisDaoTest.test_saveAndGetPhysicalMachineWithCache()
test_case.full_signature: @Test public void test_saveAndGetPhysicalMachineWithCache()
test_case.identifier: test_saveAndGetPhysicalMachineWithCache
test_case.invocations: save setAddress setType setUsername setPassword setVirtualMachines save get getId assertNotNull assertNotNull getVirtualMachines assertEquals size getCache getVirtualMachines toString randomUUID add getCache getVirtualMachines get getId assertNotNull assertNotNull getVirtualMachines assertEquals size getCache getVirtualMachines assertTrue contains getCache getVirtualMachines toString randomUUID add getCache getVirtualMachines get getId assertNotNull assertNotNull getVirtualMachines assertEquals size getCache getVirtualMachines assertTrue contains getCache getVirtualMachines assertTrue contains getCache getVirtualMachines add toString randomUUID getVirtualMachines clear getCache addAll getCache get getId assertNotNull assertNotNull getVirtualMachines assertEquals size getCache getVirtualMachines
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void test_saveAndGetPhysicalMachineWithCache()
focal_class.file: vsm/src/main/java/com/abiquo/vsm/redis/dao/RedisDao.java
focal_class.identifier: RedisDao
focal_class.class_method_signature: RedisDao.getPhysicalMachine(final Integer id)
focal_class.full_signature: public PhysicalMachine getPhysicalMachine(final Integer id)
focal_class.identifier: getPhysicalMachine
focal_class.modifiers: public
focal_class.parameters: (final Integer id)
focal_class.return: PhysicalMachine
focal_class.signature: PhysicalMachine getPhysicalMachine(final Integer id)
focal_class.class_method_signature: RedisDao.getVirtualMachine(final Integer id)
focal_class.full_signature: public VirtualMachine getVirtualMachine(final Integer id)
focal_class.identifier: getVirtualMachine
focal_class.modifiers: public
focal_class.parameters: (final Integer id)
focal_class.return: VirtualMachine
focal_class.signature: VirtualMachine getVirtualMachine(final Integer id)
focal_class.class_method_signature: RedisDao.findVirtualMachineByName(final String name)
focal_class.full_signature: public VirtualMachine findVirtualMachineByName(final String name)
focal_class.identifier: findVirtualMachineByName
focal_class.modifiers: public
focal_class.parameters: (final String name)
focal_class.return: VirtualMachine
focal_class.signature: VirtualMachine findVirtualMachineByName(final String name)
focal_class.class_method_signature: RedisDao.findPhysicalMachineByAddress(final String address)
focal_class.full_signature: public PhysicalMachine findPhysicalMachineByAddress(final String address)
focal_class.identifier: findPhysicalMachineByAddress
focal_class.modifiers: public
focal_class.parameters: (final String address)
focal_class.return: PhysicalMachine
focal_class.signature: PhysicalMachine findPhysicalMachineByAddress(final String address)
focal_class.class_method_signature: RedisDao.findAllVirtualMachines()
focal_class.full_signature: public Set<VirtualMachine> findAllVirtualMachines()
focal_class.identifier: findAllVirtualMachines
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Set<VirtualMachine>
focal_class.signature: Set<VirtualMachine> findAllVirtualMachines()
focal_class.class_method_signature: RedisDao.findAllPhysicalMachines()
focal_class.full_signature: public Set<PhysicalMachine> findAllPhysicalMachines()
focal_class.identifier: findAllPhysicalMachines
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Set<PhysicalMachine>
focal_class.signature: Set<PhysicalMachine> findAllPhysicalMachines()
focal_class.class_method_signature: RedisDao.save(VirtualMachine virtualMachine)
focal_class.full_signature: public VirtualMachine save(VirtualMachine virtualMachine)
focal_class.identifier: save
focal_class.modifiers: public
focal_class.parameters: (VirtualMachine virtualMachine)
focal_class.return: VirtualMachine
focal_class.signature: VirtualMachine save(VirtualMachine virtualMachine)
focal_class.class_method_signature: RedisDao.save(PhysicalMachine physicalMachine)
focal_class.full_signature: public PhysicalMachine save(PhysicalMachine physicalMachine)
focal_class.identifier: save
focal_class.modifiers: public
focal_class.parameters: (PhysicalMachine physicalMachine)
focal_class.return: PhysicalMachine
focal_class.signature: PhysicalMachine save(PhysicalMachine physicalMachine)
focal_class.class_method_signature: RedisDao.save(VirtualMachinesCache cache)
focal_class.full_signature: public VirtualMachinesCache save(VirtualMachinesCache cache)
focal_class.identifier: save
focal_class.modifiers: public
focal_class.parameters: (VirtualMachinesCache cache)
focal_class.return: VirtualMachinesCache
focal_class.signature: VirtualMachinesCache save(VirtualMachinesCache cache)
focal_class.class_method_signature: RedisDao.delete(VirtualMachine virtualMachine)
focal_class.full_signature: public void delete(VirtualMachine virtualMachine)
focal_class.identifier: delete
focal_class.modifiers: public
focal_class.parameters: (VirtualMachine virtualMachine)
focal_class.return: void
focal_class.signature: void delete(VirtualMachine virtualMachine)
focal_class.class_method_signature: RedisDao.delete(PhysicalMachine physicalMachine)
focal_class.full_signature: public void delete(PhysicalMachine physicalMachine)
focal_class.identifier: delete
focal_class.modifiers: public
focal_class.parameters: (PhysicalMachine physicalMachine)
focal_class.return: void
focal_class.signature: void delete(PhysicalMachine physicalMachine)
focal_class.class_method_signature: RedisDao.saveUnique(Class<T> clazz, T entity, final String fieldName,
          final Object fieldValue)
focal_class.full_signature: private T saveUnique(Class<T> clazz, T entity, final String fieldName,
          final Object fieldValue)
focal_class.identifier: saveUnique
focal_class.modifiers: private
focal_class.parameters: (Class<T> clazz, T entity, final String fieldName,
          final Object fieldValue)
focal_class.return: T
focal_class.signature: T saveUnique(Class<T> clazz, T entity, final String fieldName,
          final Object fieldValue)
focal_class.class_method_signature: RedisDao.findUnique(Class<T> clazz, final String fieldName, final Object fieldValue)
focal_class.full_signature: private T findUnique(Class<T> clazz, final String fieldName, final Object fieldValue)
focal_class.identifier: findUnique
focal_class.modifiers: private
focal_class.parameters: (Class<T> clazz, final String fieldName, final Object fieldValue)
focal_class.return: T
focal_class.signature: T findUnique(Class<T> clazz, final String fieldName, final Object fieldValue)
focal_method.body: public VirtualMachine save(VirtualMachine virtualMachine)
      {
          return saveUnique(VirtualMachine.class, virtualMachine, "name", virtualMachine.getName());
      }
focal_method.class_method_signature: RedisDao.save(VirtualMachine virtualMachine)
focal_method.full_signature: public VirtualMachine save(VirtualMachine virtualMachine)
focal_method.identifier: save
focal_method.invocations: saveUnique getName
focal_method.modifiers: public
focal_method.parameters: (VirtualMachine virtualMachine)
focal_method.return: VirtualMachine
focal_method.signature: VirtualMachine save(VirtualMachine virtualMachine)