Search in sources :

Example 11 with RrcStateMachine3G

use of com.att.aro.core.packetanalysis.pojo.RrcStateMachine3G in project VideoOptimzer by attdevsupport.

the class RrcStateMachineFactoryImplTest method create_T3GStateIsTAIL_DCH.

@Test
public void create_T3GStateIsTAIL_DCH() {
    List<PacketInfo> packetlist1 = new ArrayList<PacketInfo>();
    when(profilefactory.energy3G(any(double.class), any(double.class), any(RRCState.class), any(Profile3G.class))).thenReturn(100.0);
    Profile3G profile11 = mock(Profile3G.class);
    when(profile11.getProfileType()).thenReturn(ProfileType.T3G);
    List<RrcStateRange> staterangelist = new ArrayList<RrcStateRange>();
    RrcStateRange[] rrcStateRangeArray = new RrcStateRange[5];
    for (int i = 0; i < 5; i++) {
        rrcStateRangeArray[i] = mock(RrcStateRange.class);
        when(rrcStateRangeArray[i].getState()).thenReturn(RRCState.TAIL_DCH);
        when(rrcStateRangeArray[i].getBeginTime()).thenReturn((double) date.getTime() + 2 * i * 500);
        when(rrcStateRangeArray[i].getEndTime()).thenReturn((double) date.getTime() + (2 * i + 1) * 500.0);
    }
    for (int i = 0; i < 5; i++) {
        staterangelist.add(rrcStateRangeArray[i]);
    }
    when(staterange.create(any(ArrayList.class), any(Profile.class), any(double.class))).thenReturn(staterangelist);
    RrcStateMachine3G rrcStateMachine3G = (RrcStateMachine3G) machineFactoryimpl.create(packetlist1, profile11, packetDuration, traceDuration, totalBytes * 100, null);
    assertEquals(50.0, rrcStateMachine3G.getJoulesPerKilobyte(), 0.0);
    assertEquals(2500, rrcStateMachine3G.getDchTailTime(), 0.0);
    assertEquals(500, rrcStateMachine3G.getDchTailEnergy(), 0.0);
}
Also used : RrcStateMachine3G(com.att.aro.core.packetanalysis.pojo.RrcStateMachine3G) RRCState(com.att.aro.core.packetanalysis.pojo.RRCState) ArrayList(java.util.ArrayList) PacketInfo(com.att.aro.core.packetanalysis.pojo.PacketInfo) Profile3G(com.att.aro.core.configuration.pojo.Profile3G) RrcStateRange(com.att.aro.core.packetanalysis.pojo.RrcStateRange) Profile(com.att.aro.core.configuration.pojo.Profile) BaseTest(com.att.aro.core.BaseTest) Test(org.junit.Test)

Example 12 with RrcStateMachine3G

use of com.att.aro.core.packetanalysis.pojo.RrcStateMachine3G in project VideoOptimzer by attdevsupport.

the class RrcStateMachineFactoryImplTest method create_T3GStateIsTAIL_FACH.

@Test
public void create_T3GStateIsTAIL_FACH() {
    List<PacketInfo> packetlist1 = new ArrayList<PacketInfo>();
    when(profilefactory.energy3G(any(double.class), any(double.class), any(RRCState.class), any(Profile3G.class))).thenReturn(100.0);
    Profile3G profile13 = mock(Profile3G.class);
    when(profile13.getProfileType()).thenReturn(ProfileType.T3G);
    List<RrcStateRange> staterangelist = new ArrayList<RrcStateRange>();
    RrcStateRange[] rrcStateRangeArray = new RrcStateRange[5];
    for (int i = 0; i < 5; i++) {
        rrcStateRangeArray[i] = mock(RrcStateRange.class);
        when(rrcStateRangeArray[i].getState()).thenReturn(RRCState.TAIL_FACH);
        when(rrcStateRangeArray[i].getBeginTime()).thenReturn((double) date.getTime() + 2 * i * 500);
        when(rrcStateRangeArray[i].getEndTime()).thenReturn((double) date.getTime() + (2 * i + 1) * 500.0);
    }
    for (int i = 0; i < 5; i++) {
        staterangelist.add(rrcStateRangeArray[i]);
    }
    when(staterange.create(any(ArrayList.class), any(Profile.class), any(double.class))).thenReturn(staterangelist);
    RrcStateMachine3G rrcStateMachine3G = (RrcStateMachine3G) machineFactoryimpl.create(packetlist1, profile13, packetDuration, traceDuration, totalBytes * 100, null);
    assertEquals(50.0, rrcStateMachine3G.getJoulesPerKilobyte(), 0.0);
    assertEquals(2500, rrcStateMachine3G.getFachTailTime(), 0.0);
    assertEquals(500, rrcStateMachine3G.getFachTailEnergy(), 0.0);
}
Also used : RrcStateMachine3G(com.att.aro.core.packetanalysis.pojo.RrcStateMachine3G) RRCState(com.att.aro.core.packetanalysis.pojo.RRCState) ArrayList(java.util.ArrayList) PacketInfo(com.att.aro.core.packetanalysis.pojo.PacketInfo) Profile3G(com.att.aro.core.configuration.pojo.Profile3G) RrcStateRange(com.att.aro.core.packetanalysis.pojo.RrcStateRange) Profile(com.att.aro.core.configuration.pojo.Profile) BaseTest(com.att.aro.core.BaseTest) Test(org.junit.Test)

Example 13 with RrcStateMachine3G

use of com.att.aro.core.packetanalysis.pojo.RrcStateMachine3G in project VideoOptimzer by attdevsupport.

the class RrcStateMachineFactoryImplTest method create_3GStateRrcStateRangeListIsEmpty.

@Test
public void create_3GStateRrcStateRangeListIsEmpty() {
    Profile3G profile16 = mock(Profile3G.class);
    when(profile16.getProfileType()).thenReturn(ProfileType.T3G);
    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);
    RrcStateMachine3G rrcStateMachine3G = (RrcStateMachine3G) machineFactoryimpl.create(packetlist1, profile16, packetDuration, traceDuration, 0 * totalBytes, null);
    assertEquals(0.0, rrcStateMachine3G.getJoulesPerKilobyte(), 0.0);
    assertEquals(1000, rrcStateMachine3G.getPacketsDuration(), 0.0);
    assertEquals(2000, rrcStateMachine3G.getTraceDuration(), 0.0);
}
Also used : RrcStateMachine3G(com.att.aro.core.packetanalysis.pojo.RrcStateMachine3G) ArrayList(java.util.ArrayList) Profile3G(com.att.aro.core.configuration.pojo.Profile3G) PacketInfo(com.att.aro.core.packetanalysis.pojo.PacketInfo) RrcStateRange(com.att.aro.core.packetanalysis.pojo.RrcStateRange) Profile(com.att.aro.core.configuration.pojo.Profile) BaseTest(com.att.aro.core.BaseTest) Test(org.junit.Test)

Aggregations

RrcStateMachine3G (com.att.aro.core.packetanalysis.pojo.RrcStateMachine3G)13 RrcStateRange (com.att.aro.core.packetanalysis.pojo.RrcStateRange)9 BaseTest (com.att.aro.core.BaseTest)8 Profile (com.att.aro.core.configuration.pojo.Profile)8 Profile3G (com.att.aro.core.configuration.pojo.Profile3G)8 PacketInfo (com.att.aro.core.packetanalysis.pojo.PacketInfo)8 ArrayList (java.util.ArrayList)8 Test (org.junit.Test)8 RRCState (com.att.aro.core.packetanalysis.pojo.RRCState)7 RrcStateMachineLTE (com.att.aro.core.packetanalysis.pojo.RrcStateMachineLTE)1 RrcStateMachineWiFi (com.att.aro.core.packetanalysis.pojo.RrcStateMachineWiFi)1 AROUIPanelException (com.att.aro.ui.exception.AROUIPanelException)1 TraceBenchmarkInfo (com.att.aro.ui.model.overview.TraceBenchmarkInfo)1