use of com.att.aro.core.packetanalysis.pojo.TimeRange in project VideoOptimzer by attdevsupport.
the class RrcStateMachineFactoryImplTest method create_TimeRangeIsNotNull.
@Test
public void create_TimeRangeIsNotNull() {
ProfileWiFi profile01 = mock(ProfileWiFi.class);
when(profile01.getProfileType()).thenReturn(ProfileType.WIFI);
List<PacketInfo> packetlist1 = new ArrayList<PacketInfo>();
TimeRange timeRange = mock(TimeRange.class);
when(timeRange.getBeginTime()).thenReturn((double) date.getTime() - 3000.0);
when(timeRange.getEndTime()).thenReturn((double) date.getTime() + 1000.0);
List<RrcStateRange> staterangelist = new ArrayList<RrcStateRange>();
RrcStateRange rrc01 = mock(RrcStateRange.class);
RrcStateRange rrc02 = mock(RrcStateRange.class);
RrcStateRange rrc03 = mock(RrcStateRange.class);
when(rrc01.getBeginTime()).thenReturn((double) date.getTime() - 3000.0);
when(rrc01.getEndTime()).thenReturn((double) date.getTime() - 2000.0);
when(rrc02.getBeginTime()).thenReturn((double) date.getTime() - 1000.0);
when(rrc02.getEndTime()).thenReturn((double) date.getTime());
when(rrc03.getBeginTime()).thenReturn((double) date.getTime() + 1000.0);
when(rrc03.getEndTime()).thenReturn((double) date.getTime() + 2000.0);
when(profilefactory.energy3G(any(double.class), any(double.class), any(RRCState.class), any(Profile3G.class))).thenReturn(2.0);
when(rrc01.getState()).thenReturn(RRCState.TAIL_FACH);
when(rrc02.getState()).thenReturn(RRCState.TAIL_FACH);
when(rrc03.getState()).thenReturn(RRCState.TAIL_FACH);
staterangelist.add(rrc01);
staterangelist.add(rrc02);
staterangelist.add(rrc03);
when(staterange.create(any(ArrayList.class), any(Profile.class), any(double.class))).thenReturn(staterangelist);
AbstractRrcStateMachine rrcStateMachinewifi = machineFactoryimpl.create(packetlist1, profile01, packetDuration, traceDuration, 0.0, timeRange);
assertEquals(0.0, rrcStateMachinewifi.getJoulesPerKilobyte(), 0.0);
}
Aggregations