Search in sources :

Example 21 with TimeRange

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);
}
Also used : TimeRange(com.att.aro.core.packetanalysis.pojo.TimeRange) RRCState(com.att.aro.core.packetanalysis.pojo.RRCState) ArrayList(java.util.ArrayList) PacketInfo(com.att.aro.core.packetanalysis.pojo.PacketInfo) RrcStateRange(com.att.aro.core.packetanalysis.pojo.RrcStateRange) Profile3G(com.att.aro.core.configuration.pojo.Profile3G) AbstractRrcStateMachine(com.att.aro.core.packetanalysis.pojo.AbstractRrcStateMachine) ProfileWiFi(com.att.aro.core.configuration.pojo.ProfileWiFi) Profile(com.att.aro.core.configuration.pojo.Profile) BaseTest(com.att.aro.core.BaseTest) Test(org.junit.Test)

Aggregations

TimeRange (com.att.aro.core.packetanalysis.pojo.TimeRange)21 TraceTimeRange (com.att.aro.core.peripheral.pojo.TraceTimeRange)8 AnalysisFilter (com.att.aro.core.packetanalysis.pojo.AnalysisFilter)7 ArrayList (java.util.ArrayList)5 PacketInfo (com.att.aro.core.packetanalysis.pojo.PacketInfo)4 TraceDirectoryResult (com.att.aro.core.packetanalysis.pojo.TraceDirectoryResult)4 Profile (com.att.aro.core.configuration.pojo.Profile)3 AbstractRrcStateMachine (com.att.aro.core.packetanalysis.pojo.AbstractRrcStateMachine)3 ApplicationSelection (com.att.aro.core.packetanalysis.pojo.ApplicationSelection)3 PacketAnalyzerResult (com.att.aro.core.packetanalysis.pojo.PacketAnalyzerResult)3 Session (com.att.aro.core.packetanalysis.pojo.Session)3 ActionEvent (java.awt.event.ActionEvent)3 ActionListener (java.awt.event.ActionListener)3 IOException (java.io.IOException)3 BaseTest (com.att.aro.core.BaseTest)2 BurstCollectionAnalysisData (com.att.aro.core.packetanalysis.pojo.BurstCollectionAnalysisData)2 Statistic (com.att.aro.core.packetanalysis.pojo.Statistic)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 Set (java.util.Set)2