@Test public void create_LTEStateRrcStateRangeListIsEmpty() { ProfileLTE profile09 = mock(ProfileLTE.class); when(profile09.getProfileType()).thenReturn(ProfileType.LTE); List<PacketInfo> packetlist1 = new ArrayList<PacketInfo>(); List<RrcStateRange> staterangelist = new ArrayList<RrcStateRange>(); when(staterange.create(any(ArrayList.class), any(Profile.class), any(double.class))).thenReturn(staterangelist); RrcStateMachineLTE rrcStateMachineLTE = (RrcStateMachineLTE) machineFactoryimpl.create(packetlist1, profile09, packetDuration, traceDuration, 0 * totalBytes, null); assertEquals(0.0, rrcStateMachineLTE.getJoulesPerKilobyte(), 0.0); assertEquals(1000, rrcStateMachineLTE.getPacketsDuration(), 0.0); assertEquals(2000, rrcStateMachineLTE.getTraceDuration(), 0.0); }
@Override public AbstractRrcStateMachine create(List<PacketInfo> packetlist, Profile profile, double packetDuration, double traceDuration, double totalBytes, TimeRange timerange) { List<RrcStateRange> staterangelist = staterange.create(packetlist, profile, traceDuration); if(timerange != null){ staterangelist = this.getRRCStatesForTheTimeRange(staterangelist, timerange.getBeginTime(), timerange.getEndTime()); } AbstractRrcStateMachine data = null; if(profile.getProfileType() == ProfileType.T3G){ data = run3GRRcStatistics(staterangelist, (Profile3G)profile, totalBytes, packetDuration, traceDuration); }else if(profile.getProfileType() == ProfileType.LTE){ data = runLTERRcStatistics(staterangelist, (ProfileLTE)profile, packetlist, totalBytes, packetDuration, traceDuration); }else if(profile.getProfileType() == ProfileType.WIFI){ data = runWiFiRRcStatistics(staterangelist, (ProfileWiFi)profile, totalBytes, packetDuration, traceDuration); } if(data != null){ data.setStaterangelist(staterangelist); } return data; }
RrcStateMachineFactoryImpl implements IRrcStateMachineFactory { @Override public AbstractRrcStateMachine create(List<PacketInfo> packetlist, Profile profile, double packetDuration, double traceDuration, double totalBytes, TimeRange timerange) { List<RrcStateRange> staterangelist = staterange.create(packetlist, profile, traceDuration); if(timerange != null){ staterangelist = this.getRRCStatesForTheTimeRange(staterangelist, timerange.getBeginTime(), timerange.getEndTime()); } AbstractRrcStateMachine data = null; if(profile.getProfileType() == ProfileType.T3G){ data = run3GRRcStatistics(staterangelist, (Profile3G)profile, totalBytes, packetDuration, traceDuration); }else if(profile.getProfileType() == ProfileType.LTE){ data = runLTERRcStatistics(staterangelist, (ProfileLTE)profile, packetlist, totalBytes, packetDuration, traceDuration); }else if(profile.getProfileType() == ProfileType.WIFI){ data = runWiFiRRcStatistics(staterangelist, (ProfileWiFi)profile, totalBytes, packetDuration, traceDuration); } if(data != null){ data.setStaterangelist(staterangelist); } return data; } }
RrcStateMachineFactoryImpl implements IRrcStateMachineFactory { @Override public AbstractRrcStateMachine create(List<PacketInfo> packetlist, Profile profile, double packetDuration, double traceDuration, double totalBytes, TimeRange timerange) { List<RrcStateRange> staterangelist = staterange.create(packetlist, profile, traceDuration); if(timerange != null){ staterangelist = this.getRRCStatesForTheTimeRange(staterangelist, timerange.getBeginTime(), timerange.getEndTime()); } AbstractRrcStateMachine data = null; if(profile.getProfileType() == ProfileType.T3G){ data = run3GRRcStatistics(staterangelist, (Profile3G)profile, totalBytes, packetDuration, traceDuration); }else if(profile.getProfileType() == ProfileType.LTE){ data = runLTERRcStatistics(staterangelist, (ProfileLTE)profile, packetlist, totalBytes, packetDuration, traceDuration); }else if(profile.getProfileType() == ProfileType.WIFI){ data = runWiFiRRcStatistics(staterangelist, (ProfileWiFi)profile, totalBytes, packetDuration, traceDuration); } if(data != null){ data.setStaterangelist(staterangelist); } return data; }  }
RrcStateMachineFactoryImpl implements IRrcStateMachineFactory { @Override public AbstractRrcStateMachine create(List<PacketInfo> packetlist, Profile profile, double packetDuration, double traceDuration, double totalBytes, TimeRange timerange) { List<RrcStateRange> staterangelist = staterange.create(packetlist, profile, traceDuration); if(timerange != null){ staterangelist = this.getRRCStatesForTheTimeRange(staterangelist, timerange.getBeginTime(), timerange.getEndTime()); } AbstractRrcStateMachine data = null; if(profile.getProfileType() == ProfileType.T3G){ data = run3GRRcStatistics(staterangelist, (Profile3G)profile, totalBytes, packetDuration, traceDuration); }else if(profile.getProfileType() == ProfileType.LTE){ data = runLTERRcStatistics(staterangelist, (ProfileLTE)profile, packetlist, totalBytes, packetDuration, traceDuration); }else if(profile.getProfileType() == ProfileType.WIFI){ data = runWiFiRRcStatistics(staterangelist, (ProfileWiFi)profile, totalBytes, packetDuration, traceDuration); } if(data != null){ data.setStaterangelist(staterangelist); } return data; }  @Override AbstractRrcStateMachine create(List<PacketInfo> packetlist,
			Profile profile, double packetDuration, double traceDuration, double totalBytes,
			TimeRange timerange); }
RrcStateMachineFactoryImpl implements IRrcStateMachineFactory { @Override public AbstractRrcStateMachine create(List<PacketInfo> packetlist, Profile profile, double packetDuration, double traceDuration, double totalBytes, TimeRange timerange) { List<RrcStateRange> staterangelist = staterange.create(packetlist, profile, traceDuration); if(timerange != null){ staterangelist = this.getRRCStatesForTheTimeRange(staterangelist, timerange.getBeginTime(), timerange.getEndTime()); } AbstractRrcStateMachine data = null; if(profile.getProfileType() == ProfileType.T3G){ data = run3GRRcStatistics(staterangelist, (Profile3G)profile, totalBytes, packetDuration, traceDuration); }else if(profile.getProfileType() == ProfileType.LTE){ data = runLTERRcStatistics(staterangelist, (ProfileLTE)profile, packetlist, totalBytes, packetDuration, traceDuration); }else if(profile.getProfileType() == ProfileType.WIFI){ data = runWiFiRRcStatistics(staterangelist, (ProfileWiFi)profile, totalBytes, packetDuration, traceDuration); } if(data != null){ data.setStaterangelist(staterangelist); } return data; }  @Override AbstractRrcStateMachine create(List<PacketInfo> packetlist,
			Profile profile, double packetDuration, double traceDuration, double totalBytes,
			TimeRange timerange);  }