@Test public void convertEnergySampleTest() { EventSample nullEventSample = null; eu.ascetic.paas.applicationmanager.model.EventSample newEventSample = EnergyModellerConverter.convert(nullEventSample); assertEquals(null, newEventSample); EventSample eventSample = new EventSample(); eventSample.setCvalue(1.0); eventSample.setEvalue(2.0); eventSample.setPvalue(3.0); eventSample.setTimestampBeging(1l); eventSample.setTimestampEnd(2l); eventSample.setVmid("vmid"); eventSample.setAppid("appid"); newEventSample = EnergyModellerConverter.convert(eventSample); assertEquals("vmid", newEventSample.getVmid()); assertEquals(1.0, newEventSample.getCvalue(), 0.00001); assertEquals(2.0, newEventSample.getEvalue(), 0.00001); assertEquals(3.0, newEventSample.getPvalue(), 0.00001); assertEquals(1l, newEventSample.getTimestampBeging()); assertEquals(2l, newEventSample.getTimestampEnd()); assertEquals("appid", newEventSample.getAppid()); }
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);  }