@Test public void energyWifi_RRCStateIsWIFI_IDLE(){ ProfileWiFi profileWifi02 = Mockito.mock(ProfileWiFi.class); when(profileWifi02.getWifiActivePower()).thenReturn(3.0); double testResult = profilefactory.energyWiFi(date.getTime()+0.0, date.getTime()+1000.0, RRCState.WIFI_IDLE, profileWifi02); assertEquals(0.0,testResult,0.0); }
@Override public double energyWiFi(double time1, double time2, RRCState state , ProfileWiFi prof) { double deltaTime = time2 - time1; if(state == RRCState.WIFI_ACTIVE || state == RRCState.WIFI_TAIL){ return deltaTime * prof.getWifiActivePower(); }else if(state == RRCState.WIFI_IDLE){ return deltaTime * prof.getWifiIdlePower(); } return 0; }
ProfileFactoryImpl implements IProfileFactory { @Override public double energyWiFi(double time1, double time2, RRCState state , ProfileWiFi prof) { double deltaTime = time2 - time1; if(state == RRCState.WIFI_ACTIVE || state == RRCState.WIFI_TAIL){ return deltaTime * prof.getWifiActivePower(); }else if(state == RRCState.WIFI_IDLE){ return deltaTime * prof.getWifiIdlePower(); } return 0; } }
ProfileFactoryImpl implements IProfileFactory { @Override public double energyWiFi(double time1, double time2, RRCState state , ProfileWiFi prof) { double deltaTime = time2 - time1; if(state == RRCState.WIFI_ACTIVE || state == RRCState.WIFI_TAIL){ return deltaTime * prof.getWifiActivePower(); }else if(state == RRCState.WIFI_IDLE){ return deltaTime * prof.getWifiIdlePower(); } return 0; }  }
ProfileFactoryImpl implements IProfileFactory { @Override public double energyWiFi(double time1, double time2, RRCState state , ProfileWiFi prof) { double deltaTime = time2 - time1; if(state == RRCState.WIFI_ACTIVE || state == RRCState.WIFI_TAIL){ return deltaTime * prof.getWifiActivePower(); }else if(state == RRCState.WIFI_IDLE){ return deltaTime * prof.getWifiIdlePower(); } return 0; }  @Override Profile create(ProfileType typeParm, Properties prop); @Override double energy3G(double time1, double time2, RRCState state, Profile3G prof); @Override Profile create3Gdefault(); @Override Profile create3GFromDefaultResourceFile(); @Override Profile create3GFromFilePath(String filepath); @Override Profile create3G(InputStream input); @Override Profile create3G(Properties properties); @Override void save3G(String filepath, Profile3G prof); @Override void save3G(OutputStream output, Profile3G prof); @Override double energyLTE(double time1, double time2, RRCState state, ProfileLTE prof, List<PacketInfo> packets); @Override Profile createLTEdefault(); @Override Profile createLTEFromDefaultResourceFile(); @Override Profile createLTEFromFilePath(String filepath); @Override Profile createLTE(InputStream input); @Override Profile createLTE(Properties properties); @Override void saveLTE(String filepath, ProfileLTE prof); @Override void saveLTE(OutputStream output, ProfileLTE prof); @Override double energyWiFi(double time1, double time2, RRCState state , ProfileWiFi prof); @Override Profile createWiFidefault(); @Override Profile createWiFiFromFilePath(String filepath); @Override Profile createWiFiFromDefaultResourceFile(); @Override Profile createWiFi(InputStream input); @Override Profile createWiFi(Properties properties); @Override void saveWiFi(String filepath, ProfileWiFi prof); @Override void saveWiFi(OutputStream output, ProfileWiFi prof); }
ProfileFactoryImpl implements IProfileFactory { @Override public double energyWiFi(double time1, double time2, RRCState state , ProfileWiFi prof) { double deltaTime = time2 - time1; if(state == RRCState.WIFI_ACTIVE || state == RRCState.WIFI_TAIL){ return deltaTime * prof.getWifiActivePower(); }else if(state == RRCState.WIFI_IDLE){ return deltaTime * prof.getWifiIdlePower(); } return 0; }  @Override Profile create(ProfileType typeParm, Properties prop); @Override double energy3G(double time1, double time2, RRCState state, Profile3G prof); @Override Profile create3Gdefault(); @Override Profile create3GFromDefaultResourceFile(); @Override Profile create3GFromFilePath(String filepath); @Override Profile create3G(InputStream input); @Override Profile create3G(Properties properties); @Override void save3G(String filepath, Profile3G prof); @Override void save3G(OutputStream output, Profile3G prof); @Override double energyLTE(double time1, double time2, RRCState state, ProfileLTE prof, List<PacketInfo> packets); @Override Profile createLTEdefault(); @Override Profile createLTEFromDefaultResourceFile(); @Override Profile createLTEFromFilePath(String filepath); @Override Profile createLTE(InputStream input); @Override Profile createLTE(Properties properties); @Override void saveLTE(String filepath, ProfileLTE prof); @Override void saveLTE(OutputStream output, ProfileLTE prof); @Override double energyWiFi(double time1, double time2, RRCState state , ProfileWiFi prof); @Override Profile createWiFidefault(); @Override Profile createWiFiFromFilePath(String filepath); @Override Profile createWiFiFromDefaultResourceFile(); @Override Profile createWiFi(InputStream input); @Override Profile createWiFi(Properties properties); @Override void saveWiFi(String filepath, ProfileWiFi prof); @Override void saveWiFi(OutputStream output, ProfileWiFi prof);  }