@Test public void insertVm() { db.insertVm("vmId1", "appId1", "", ""); assertTrue(db.getAllVmIds().contains("vmId1")); }
@Override public void insertVm(String vmId, String appId, String ovfId, String slaId) { try { update("INSERT INTO virtual_machines (id, appId, ovfId, slaId) " + "VALUES ('" + vmId + "', '" + appId + "', '" + ovfId + "', '" + slaId + "')"); } catch (SQLException e) { log.error(ERROR_INSERT_VM, e); } }
VmManagerDbHsql implements VmManagerDb { @Override public void insertVm(String vmId, String appId, String ovfId, String slaId) { try { update("INSERT INTO virtual_machines (id, appId, ovfId, slaId) " + "VALUES ('" + vmId + "', '" + appId + "', '" + ovfId + "', '" + slaId + "')"); } catch (SQLException e) { log.error(ERROR_INSERT_VM, e); } } }
VmManagerDbHsql implements VmManagerDb { @Override public void insertVm(String vmId, String appId, String ovfId, String slaId) { try { update("INSERT INTO virtual_machines (id, appId, ovfId, slaId) " + "VALUES ('" + vmId + "', '" + appId + "', '" + ovfId + "', '" + slaId + "')"); } catch (SQLException e) { log.error(ERROR_INSERT_VM, e); } } VmManagerDbHsql(String dbFileNamePrefix); }
VmManagerDbHsql implements VmManagerDb { @Override public void insertVm(String vmId, String appId, String ovfId, String slaId) { try { update("INSERT INTO virtual_machines (id, appId, ovfId, slaId) " + "VALUES ('" + vmId + "', '" + appId + "', '" + ovfId + "', '" + slaId + "')"); } catch (SQLException e) { log.error(ERROR_INSERT_VM, e); } } 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 void insertVm(String vmId, String appId, String ovfId, String slaId) { try { update("INSERT INTO virtual_machines (id, appId, ovfId, slaId) " + "VALUES ('" + vmId + "', '" + appId + "', '" + ovfId + "', '" + slaId + "')"); } catch (SQLException e) { log.error(ERROR_INSERT_VM, e); } } 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();  }