Source:
public void setUp() throws Exception { super.setUp(); Properties properties = new Properties(); InputStream is = null; is = BaseDAOTestCase.class.getResourceAsStream("/test-database.properties"); try { properties.load(is); } catch (Exception e) { e.printStackTrace(); } Map props = new HashMap(); props.put("javax.persistence.jdbc.driver", properties.getProperty("database.driver")); props.put("javax.persistence.jdbc.user", properties.getProperty("database.username")); props.put("javax.persistence.jdbc.password", properties.getProperty("database.password")); props.put("javax.persistence.jdbc.url", properties.getProperty("database.url")); EntityManagerFactory emf = Persistence.createEntityManagerFactory("ovirt", props); HibernateFacade.setEntityManagerFactory(emf); VdsDAO vdsDAO = dbFacade.getVdsDao(); existingVds = vdsDAO.get(FixturesTool.VDS_RHEL6_NFS_SPM); StoragePoolDAO storagePoolDAO = dbFacade.getStoragePoolDao(); storagePool = storagePoolDAO.get(FixturesTool.STORAGE_POOL_RHEL6_ISCSI_OTHER); dao = dbFacade.getVdsGroupDao(); existingVdsGroup = dao.get(existingVds.getVdsGroupId()); groupWithNoRunningVms = dbFacade.getVdsGroupDao().get(FixturesTool.VDS_GROUP_NO_RUNNING_VMS); newGroup = new VDSGroup(); newGroup.setName("New VDS Group"); newGroup.setcompatibility_version(new Version("3.0")); newGroup.setVirtService(true); newGroup.setGlusterService(false); newGroup.setClusterPolicyId(existingVdsGroup.getClusterPolicyId()); clusterPolicyDao = dbFacade.getClusterPolicyDao(); newGroup.setClusterPolicyName(clusterPolicyDao.get(existingVdsGroup.getClusterPolicyId()).getName()); newGroup.setClusterPolicyProperties(new LinkedHashMap<String, String>()); newGroup.setDetectEmulatedMachine(true); newGroup.setEmulatedMachine("rhel6.4.0"); newGroup.setArchitecture(ArchitectureType.x86_64); }

Target:
public void setUp() throws Exception { super.setUp(); Properties properties = new Properties(); InputStream is = null; is = BaseDAOTestCase.class.getResourceAsStream("/test-database.properties"); properties.load(is); Map props = new HashMap(); props.put("javax.persistence.jdbc.driver", properties.getProperty("database.driver")); props.put("javax.persistence.jdbc.user", properties.getProperty("database.username")); props.put("javax.persistence.jdbc.password", properties.getProperty("database.password")); props.put("javax.persistence.jdbc.url", properties.getProperty("database.url")); EntityManagerFactory emf = Persistence.createEntityManagerFactory("ovirt", props); HibernateFacade.setEntityManagerFactory(emf); VdsDAO vdsDAO = dbFacade.getVdsDao(); existingVds = vdsDAO.get(FixturesTool.VDS_RHEL6_NFS_SPM); StoragePoolDAO storagePoolDAO = dbFacade.getStoragePoolDao(); storagePool = storagePoolDAO.get(FixturesTool.STORAGE_POOL_RHEL6_ISCSI_OTHER); dao = dbFacade.getVdsGroupDao(); existingVdsGroup = dao.get(existingVds.getVdsGroupId()); groupWithNoRunningVms = dbFacade.getVdsGroupDao().get(FixturesTool.VDS_GROUP_NO_RUNNING_VMS); newGroup = new VDSGroup(); newGroup.setName("New VDS Group"); newGroup.setcompatibility_version(new Version("3.0")); newGroup.setVirtService(true); newGroup.setGlusterService(false); newGroup.setClusterPolicyId(existingVdsGroup.getClusterPolicyId()); clusterPolicyDao = dbFacade.getClusterPolicyDao(); newGroup.setClusterPolicyName(clusterPolicyDao.get(existingVdsGroup.getClusterPolicyId()).getName()); newGroup.setClusterPolicyProperties(new LinkedHashMap<String, String>()); newGroup.setDetectEmulatedMachine(true); newGroup.setEmulatedMachine("rhel6.4.0"); newGroup.setArchitecture(ArchitectureType.x86_64); }