@Test public void getAllVmsIdsWhenThereAreNoVms() { assertTrue(db.getAllVmIds().isEmpty()); }
@Override public List<String> getAllVmIds() { List<String> vmIds = new ArrayList<>(); try { vmIds = query("SELECT id FROM virtual_machines"); } catch (SQLException e) { System.out.println(ERROR_GET_VMS_OF_APP); } return vmIds; }
VmManagerDbHsql implements VmManagerDb { @Override public List<String> getAllVmIds() { List<String> vmIds = new ArrayList<>(); try { vmIds = query("SELECT id FROM virtual_machines"); } catch (SQLException e) { System.out.println(ERROR_GET_VMS_OF_APP); } return vmIds; } }
VmManagerDbHsql implements VmManagerDb { @Override public List<String> getAllVmIds() { List<String> vmIds = new ArrayList<>(); try { vmIds = query("SELECT id FROM virtual_machines"); } catch (SQLException e) { System.out.println(ERROR_GET_VMS_OF_APP); } return vmIds; } VmManagerDbHsql(String dbFileNamePrefix); }
VmManagerDbHsql implements VmManagerDb { @Override public List<String> getAllVmIds() { List<String> vmIds = new ArrayList<>(); try { vmIds = query("SELECT id FROM virtual_machines"); } catch (SQLException e) { System.out.println(ERROR_GET_VMS_OF_APP); } return vmIds; } VmManagerDbHsql(String dbFileNamePrefix); @Override void closeConnection(); void cleanDb(); @Override void insertVm(String vmId, String appId, String ovfId, String slaId); @Override void deleteVm(String vmId); @Override void deleteAllVms(); @Override String getAppIdOfVm(String vmId); @Override String getOvfIdOfVm(String vmId); @Override String getSlaIdOfVm(String vmId); @Override List<String> getAllVmIds(); @Override List<String> getVmsOfApp(String appId); @Override SchedAlgorithmNameEnum getCurrentSchedulingAlg(); @Override void setCurrentSchedulingAlg(SchedAlgorithmNameEnum alg); @Override void saveSelfAdaptationOptions(SelfAdaptationOptions options); @Override SelfAdaptationOptions getSelfAdaptationOptions(); }
VmManagerDbHsql implements VmManagerDb { @Override public List<String> getAllVmIds() { List<String> vmIds = new ArrayList<>(); try { vmIds = query("SELECT id FROM virtual_machines"); } catch (SQLException e) { System.out.println(ERROR_GET_VMS_OF_APP); } return vmIds; } VmManagerDbHsql(String dbFileNamePrefix); @Override void closeConnection(); void cleanDb(); @Override void insertVm(String vmId, String appId, String ovfId, String slaId); @Override void deleteVm(String vmId); @Override void deleteAllVms(); @Override String getAppIdOfVm(String vmId); @Override String getOvfIdOfVm(String vmId); @Override String getSlaIdOfVm(String vmId); @Override List<String> getAllVmIds(); @Override List<String> getVmsOfApp(String appId); @Override SchedAlgorithmNameEnum getCurrentSchedulingAlg(); @Override void setCurrentSchedulingAlg(SchedAlgorithmNameEnum alg); @Override void saveSelfAdaptationOptions(SelfAdaptationOptions options); @Override SelfAdaptationOptions getSelfAdaptationOptions();  }