@Test public void convertSampleTest() { ApplicationSample nullApplicationSample = null; eu.ascetic.paas.applicationmanager.model.ApplicationSample newApplicationSample = EnergyModellerConverter.convert(nullApplicationSample); assertEquals(null, newApplicationSample); ApplicationSample applicationSample = new ApplicationSample(); applicationSample.setAppid("appid"); applicationSample.setC_value(1.0); applicationSample.setE_value(2.0); applicationSample.setOrderID(5); applicationSample.setP_value(3.0); applicationSample.setTime(2l); applicationSample.setVmid("vmid"); newApplicationSample = EnergyModellerConverter.convert(applicationSample); assertEquals("appid", newApplicationSample.getAppid()); assertEquals(1.0, newApplicationSample.getcValue(), 0.0001); assertEquals(2.0, newApplicationSample.geteValue(), 0.0001); assertEquals(5, newApplicationSample.getOrderID()); assertEquals(3.0, newApplicationSample.getpValue(), 0.0001); assertEquals(2l, newApplicationSample.getTime()); assertEquals("vmid", newApplicationSample.getVmid()); }
public static eu.ascetic.paas.applicationmanager.model.EventSample convert(EventSample eventSample) { if(eventSample == null) { return null; } eu.ascetic.paas.applicationmanager.model.EventSample newEventSample = new eu.ascetic.paas.applicationmanager.model.EventSample(); newEventSample.setAppid(eventSample.getAppid()); newEventSample.setCvalue(eventSample.getCvalue()); newEventSample.setEvalue(eventSample.getEvalue()); newEventSample.setPvalue(eventSample.getPvalue()); newEventSample.setTimestampBeging(eventSample.getTimestampBeging()); newEventSample.setTimestampEnd(eventSample.getTimestampEnd()); newEventSample.setVmid(eventSample.getVmid()); return newEventSample; }
EnergyModellerConverter { public static eu.ascetic.paas.applicationmanager.model.EventSample convert(EventSample eventSample) { if(eventSample == null) { return null; } eu.ascetic.paas.applicationmanager.model.EventSample newEventSample = new eu.ascetic.paas.applicationmanager.model.EventSample(); newEventSample.setAppid(eventSample.getAppid()); newEventSample.setCvalue(eventSample.getCvalue()); newEventSample.setEvalue(eventSample.getEvalue()); newEventSample.setPvalue(eventSample.getPvalue()); newEventSample.setTimestampBeging(eventSample.getTimestampBeging()); newEventSample.setTimestampEnd(eventSample.getTimestampEnd()); newEventSample.setVmid(eventSample.getVmid()); return newEventSample; } }
EnergyModellerConverter { public static eu.ascetic.paas.applicationmanager.model.EventSample convert(EventSample eventSample) { if(eventSample == null) { return null; } eu.ascetic.paas.applicationmanager.model.EventSample newEventSample = new eu.ascetic.paas.applicationmanager.model.EventSample(); newEventSample.setAppid(eventSample.getAppid()); newEventSample.setCvalue(eventSample.getCvalue()); newEventSample.setEvalue(eventSample.getEvalue()); newEventSample.setPvalue(eventSample.getPvalue()); newEventSample.setTimestampBeging(eventSample.getTimestampBeging()); newEventSample.setTimestampEnd(eventSample.getTimestampEnd()); newEventSample.setVmid(eventSample.getVmid()); return newEventSample; }  }
EnergyModellerConverter { public static eu.ascetic.paas.applicationmanager.model.EventSample convert(EventSample eventSample) { if(eventSample == null) { return null; } eu.ascetic.paas.applicationmanager.model.EventSample newEventSample = new eu.ascetic.paas.applicationmanager.model.EventSample(); newEventSample.setAppid(eventSample.getAppid()); newEventSample.setCvalue(eventSample.getCvalue()); newEventSample.setEvalue(eventSample.getEvalue()); newEventSample.setPvalue(eventSample.getPvalue()); newEventSample.setTimestampBeging(eventSample.getTimestampBeging()); newEventSample.setTimestampEnd(eventSample.getTimestampEnd()); newEventSample.setVmid(eventSample.getVmid()); return newEventSample; }  static eu.ascetic.paas.applicationmanager.model.EventSample convert(EventSample eventSample); static eu.ascetic.paas.applicationmanager.model.ApplicationSample convert(ApplicationSample applicationSample); static List<eu.ascetic.paas.applicationmanager.model.EventSample> convertList(List<EventSample> eventSamples); static List<eu.ascetic.paas.applicationmanager.model.ApplicationSample> convertSampleList(List<ApplicationSample> applicationSamples); }
EnergyModellerConverter { public static eu.ascetic.paas.applicationmanager.model.EventSample convert(EventSample eventSample) { if(eventSample == null) { return null; } eu.ascetic.paas.applicationmanager.model.EventSample newEventSample = new eu.ascetic.paas.applicationmanager.model.EventSample(); newEventSample.setAppid(eventSample.getAppid()); newEventSample.setCvalue(eventSample.getCvalue()); newEventSample.setEvalue(eventSample.getEvalue()); newEventSample.setPvalue(eventSample.getPvalue()); newEventSample.setTimestampBeging(eventSample.getTimestampBeging()); newEventSample.setTimestampEnd(eventSample.getTimestampEnd()); newEventSample.setVmid(eventSample.getVmid()); return newEventSample; }  static eu.ascetic.paas.applicationmanager.model.EventSample convert(EventSample eventSample); static eu.ascetic.paas.applicationmanager.model.ApplicationSample convert(ApplicationSample applicationSample); static List<eu.ascetic.paas.applicationmanager.model.EventSample> convertList(List<EventSample> eventSamples); static List<eu.ascetic.paas.applicationmanager.model.ApplicationSample> convertSampleList(List<ApplicationSample> applicationSamples);  }