@Test public void getAppPredictedChargesTest() throws Exception { when(ppm.getAppPredictedCharges(111, 2, 3.1)).thenReturn(3.1); double charges = pmc.getAppPredictedCharges(111, 2, 3.1); assertEquals(3.1, charges, 0.000001); }
public double getAppPredictedCharges(int deploymentId, int schemeID, double iaaSCharges) { try { return priceModeller.getAppPredictedCharges(deploymentId, schemeID, iaaSCharges); } catch(Exception ex) { logger.warn("Error getting the reploy from the PaaS PM"); logger.warn(ex.getMessage()); logger.warn(ex.getStackTrace()); return -1.0; } }
PriceModellerClient { public double getAppPredictedCharges(int deploymentId, int schemeID, double iaaSCharges) { try { return priceModeller.getAppPredictedCharges(deploymentId, schemeID, iaaSCharges); } catch(Exception ex) { logger.warn("Error getting the reploy from the PaaS PM"); logger.warn(ex.getMessage()); logger.warn(ex.getStackTrace()); return -1.0; } } }
PriceModellerClient { public double getAppPredictedCharges(int deploymentId, int schemeID, double iaaSCharges) { try { return priceModeller.getAppPredictedCharges(deploymentId, schemeID, iaaSCharges); } catch(Exception ex) { logger.warn("Error getting the reploy from the PaaS PM"); logger.warn(ex.getMessage()); logger.warn(ex.getStackTrace()); return -1.0; } } private  PriceModellerClient(); }
PriceModellerClient { public double getAppPredictedCharges(int deploymentId, int schemeID, double iaaSCharges) { try { return priceModeller.getAppPredictedCharges(deploymentId, schemeID, iaaSCharges); } catch(Exception ex) { logger.warn("Error getting the reploy from the PaaS PM"); logger.warn(ex.getMessage()); logger.warn(ex.getStackTrace()); return -1.0; } } private  PriceModellerClient(); static PriceModellerClient getInstance(); void initializeApplication(String applicationId, int deploymentId, int schemeId); void initializeApplication(String applicationName, int deploymentId, LinkedList<VMinfo> vms); double getAppPredictedCharges(int deploymentId, int schemeID, double iaaSCharges); double getAppPredictedPrice(int deploymentId, int schemeID, double iaaSCharges, long duration); double getAppTotalCharges(int deploymentId, int schemeID, double iaaSCharges); double getEventPredictedCharges(int deploymentId, 
			                               int cpu, 
			                               int ram, 
			                               double storage, 
			                               double energy, 
			                               int schemeId, 
			                               long duration, 
			                               int numberOfevents); double getEventPredictedChargesOfApp(int deplID, LinkedList<VMinfo> vms, double energy,int schemeId); double predictPriceForNextPeriod(int deplID, double duration); double predictPriceForNextHour(int depId, LinkedList<VMinfo> vms); }
PriceModellerClient { public double getAppPredictedCharges(int deploymentId, int schemeID, double iaaSCharges) { try { return priceModeller.getAppPredictedCharges(deploymentId, schemeID, iaaSCharges); } catch(Exception ex) { logger.warn("Error getting the reploy from the PaaS PM"); logger.warn(ex.getMessage()); logger.warn(ex.getStackTrace()); return -1.0; } } private  PriceModellerClient(); static PriceModellerClient getInstance(); void initializeApplication(String applicationId, int deploymentId, int schemeId); void initializeApplication(String applicationName, int deploymentId, LinkedList<VMinfo> vms); double getAppPredictedCharges(int deploymentId, int schemeID, double iaaSCharges); double getAppPredictedPrice(int deploymentId, int schemeID, double iaaSCharges, long duration); double getAppTotalCharges(int deploymentId, int schemeID, double iaaSCharges); double getEventPredictedCharges(int deploymentId, 
			                               int cpu, 
			                               int ram, 
			                               double storage, 
			                               double energy, 
			                               int schemeId, 
			                               long duration, 
			                               int numberOfevents); double getEventPredictedChargesOfApp(int deplID, LinkedList<VMinfo> vms, double energy,int schemeId); double predictPriceForNextPeriod(int deplID, double duration); double predictPriceForNextHour(int depId, LinkedList<VMinfo> vms);  }