Search in sources :

Example 21 with ProfileLTE

use of com.att.aro.core.configuration.pojo.ProfileLTE in project VideoOptimzer by attdevsupport.

the class RrcStateMachineFactoryImplTest method create_LTEStateIsLTE_CR_TAIL.

@Test
public void create_LTEStateIsLTE_CR_TAIL() {
    ProfileLTE profile06 = mock(ProfileLTE.class);
    when(profile06.getProfileType()).thenReturn(ProfileType.LTE);
    when(profilefactory.energyLTE(any(double.class), any(double.class), any(RRCState.class), any(ProfileLTE.class), any(ArrayList.class))).thenReturn(5.0);
    List<PacketInfo> packetlist1 = new ArrayList<PacketInfo>();
    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.LTE_CR_TAIL);
        when(rrcStateRangeArray[i].getBeginTime()).thenReturn((double) date.getTime() + 2 * i * 1000);
        when(rrcStateRangeArray[i].getEndTime()).thenReturn((double) date.getTime() + (2 * i + 1) * 1000.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);
    RrcStateMachineLTE rrcStateMachineLTE = (RrcStateMachineLTE) machineFactoryimpl.create(packetlist1, profile06, packetDuration, traceDuration, totalBytes * 200, null);
    assertEquals(1.25, rrcStateMachineLTE.getJoulesPerKilobyte(), 0.0);
    assertEquals(5000, rrcStateMachineLTE.getLteCrTailTime(), 0.0);
    assertEquals(25, rrcStateMachineLTE.getLteCrTailEnergy(), 0.0);
}
Also used : RrcStateMachineLTE(com.att.aro.core.packetanalysis.pojo.RrcStateMachineLTE) 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) ProfileLTE(com.att.aro.core.configuration.pojo.ProfileLTE) Profile(com.att.aro.core.configuration.pojo.Profile) BaseTest(com.att.aro.core.BaseTest) Test(org.junit.Test)

Example 22 with ProfileLTE

use of com.att.aro.core.configuration.pojo.ProfileLTE in project VideoOptimzer by attdevsupport.

the class RrcStateMachineFactoryImplTest method create_LTEStateRrcStateRangeListIsEmpty.

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

Example 23 with ProfileLTE

use of com.att.aro.core.configuration.pojo.ProfileLTE in project VideoOptimzer by attdevsupport.

the class RrcStateMachineFactoryImplTest method create_LTEStateIsLTE_DRX_SHORT.

@Test
public void create_LTEStateIsLTE_DRX_SHORT() {
    ProfileLTE profile07 = mock(ProfileLTE.class);
    when(profile07.getProfileType()).thenReturn(ProfileType.LTE);
    when(profilefactory.energyLTE(any(double.class), any(double.class), any(RRCState.class), any(ProfileLTE.class), any(ArrayList.class))).thenReturn(6.0);
    List<PacketInfo> packetlist1 = new ArrayList<PacketInfo>();
    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.LTE_DRX_SHORT);
        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);
    RrcStateMachineLTE rrcStateMachineLTE = (RrcStateMachineLTE) machineFactoryimpl.create(packetlist1, profile07, packetDuration, traceDuration, totalBytes * 125, null);
    assertEquals(2.4, rrcStateMachineLTE.getJoulesPerKilobyte(), 0.0);
    assertEquals(2500, rrcStateMachineLTE.getLteDrxShortTime(), 0.0);
    assertEquals(30, rrcStateMachineLTE.getLteDrxShortEnergy(), 0.0);
}
Also used : RrcStateMachineLTE(com.att.aro.core.packetanalysis.pojo.RrcStateMachineLTE) 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) ProfileLTE(com.att.aro.core.configuration.pojo.ProfileLTE) Profile(com.att.aro.core.configuration.pojo.Profile) BaseTest(com.att.aro.core.BaseTest) Test(org.junit.Test)

Example 24 with ProfileLTE

use of com.att.aro.core.configuration.pojo.ProfileLTE in project VideoOptimzer by attdevsupport.

the class RrcStateMachineFactoryImplTest method create_LTEStateIsLTE_CONTINUOUS.

@Test
public void create_LTEStateIsLTE_CONTINUOUS() {
    ProfileLTE profile05 = mock(ProfileLTE.class);
    when(profile05.getProfileType()).thenReturn(ProfileType.LTE);
    when(profilefactory.energyLTE(any(double.class), any(double.class), any(RRCState.class), any(ProfileLTE.class), any(ArrayList.class))).thenReturn(4.0);
    List<PacketInfo> packetlist1 = new ArrayList<PacketInfo>();
    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.LTE_CONTINUOUS);
        when(rrcStateRangeArray[i].getBeginTime()).thenReturn((double) date.getTime() + 2 * i * 1000);
        when(rrcStateRangeArray[i].getEndTime()).thenReturn((double) date.getTime() + (2 * i + 1) * 1000.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);
    RrcStateMachineLTE rrcStateMachineLTE = (RrcStateMachineLTE) machineFactoryimpl.create(packetlist1, profile05, packetDuration, traceDuration, totalBytes * 100, null);
    assertEquals(2, rrcStateMachineLTE.getJoulesPerKilobyte(), 0.0);
    assertEquals(20, rrcStateMachineLTE.getLteCrEnergy(), 0.0);
    assertEquals(5000, rrcStateMachineLTE.getLteCrTime(), 0.0);
}
Also used : RrcStateMachineLTE(com.att.aro.core.packetanalysis.pojo.RrcStateMachineLTE) 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) ProfileLTE(com.att.aro.core.configuration.pojo.ProfileLTE) Profile(com.att.aro.core.configuration.pojo.Profile) BaseTest(com.att.aro.core.BaseTest) Test(org.junit.Test)

Example 25 with ProfileLTE

use of com.att.aro.core.configuration.pojo.ProfileLTE in project VideoOptimzer by attdevsupport.

the class RrcStateRangeFactoryImplTest method create_ProfileIsLTE.

@Test
public void create_ProfileIsLTE() {
    // not sure
    ProfileLTE profile01 = mock(ProfileLTE.class);
    List<PacketInfo> packetlist = new ArrayList<PacketInfo>();
    double traceDuration = 2000.0;
    when(profile01.getProfileType()).thenReturn(ProfileType.LTE);
    when(profile01.getPromotionTime()).thenReturn(1000.0);
    when(profile01.getInactivityTimer()).thenReturn(1000.0);
    when(profile01.getDrxShortTime()).thenReturn(1000.0);
    when(profile01.getDrxLongTime()).thenReturn(1000.0);
    when(pktInfoArray[0].getTimeStamp()).thenReturn(date.getTime() - 1500.0);
    when(pktInfoArray[1].getTimeStamp()).thenReturn(date.getTime() + 100.0);
    when(pktInfoArray[2].getTimeStamp()).thenReturn(date.getTime() + 500.0);
    when(pktInfoArray[3].getTimeStamp()).thenReturn(date.getTime() + 2300.0);
    when(pktInfoArray[4].getTimeStamp()).thenReturn(date.getTime() + 3005.0);
    when(pktInfoArray[5].getTimeStamp()).thenReturn(date.getTime() + 4500.0);
    when(pktInfoArray[6].getTimeStamp()).thenReturn(date.getTime() + 5501.0);
    when(pktInfoArray[7].getTimeStamp()).thenReturn(date.getTime() + 6001.0);
    when(pktInfoArray[8].getTimeStamp()).thenReturn(date.getTime() + 9001.0);
    when(pktInfoArray[9].getTimeStamp()).thenReturn(date.getTime() + 16001.0);
    when(pktInfoArray[10].getTimeStamp()).thenReturn(date.getTime() + 17001.0);
    when(pktInfoArray[11].getTimeStamp()).thenReturn(date.getTime() + 19000.0);
    when(pktInfoArray[12].getTimeStamp()).thenReturn(date.getTime() + 29900.0);
    when(pktInfoArray[13].getTimeStamp()).thenReturn(date.getTime() + 35500.0);
    when(pktInfoArray[14].getTimeStamp()).thenReturn(date.getTime() + 45005.0);
    when(pktInfoArray[15].getTimeStamp()).thenReturn(date.getTime() + 46500.0);
    when(pktInfoArray[16].getTimeStamp()).thenReturn(date.getTime() + 47501.0);
    when(pktInfoArray[17].getTimeStamp()).thenReturn(date.getTime() + 47601.0);
    when(pktInfoArray[18].getTimeStamp()).thenReturn(date.getTime() + 57001.0);
    when(pktInfoArray[19].getTimeStamp()).thenReturn(date.getTime() + 66001.0);
    for (int i = 0; i < 20; i++) {
        packetlist.add(pktInfoArray[i]);
    }
    List<RrcStateRange> testList = rrcStateRangeFactory.create(packetlist, profile01, traceDuration);
    assertEquals(64, testList.size());
}
Also used : ArrayList(java.util.ArrayList) PacketInfo(com.att.aro.core.packetanalysis.pojo.PacketInfo) RrcStateRange(com.att.aro.core.packetanalysis.pojo.RrcStateRange) ProfileLTE(com.att.aro.core.configuration.pojo.ProfileLTE) Test(org.junit.Test) BaseTest(com.att.aro.core.BaseTest)

Aggregations

ProfileLTE (com.att.aro.core.configuration.pojo.ProfileLTE)25 BaseTest (com.att.aro.core.BaseTest)22 Test (org.junit.Test)22 PacketInfo (com.att.aro.core.packetanalysis.pojo.PacketInfo)18 ArrayList (java.util.ArrayList)18 RrcStateRange (com.att.aro.core.packetanalysis.pojo.RrcStateRange)12 Profile (com.att.aro.core.configuration.pojo.Profile)10 RrcStateMachineLTE (com.att.aro.core.packetanalysis.pojo.RrcStateMachineLTE)8 RRCState (com.att.aro.core.packetanalysis.pojo.RRCState)7 BurstCollectionAnalysisData (com.att.aro.core.packetanalysis.pojo.BurstCollectionAnalysisData)3 PacketAnalyzerResult (com.att.aro.core.packetanalysis.pojo.PacketAnalyzerResult)3 CpuActivity (com.att.aro.core.peripheral.pojo.CpuActivity)3 InetAddress (java.net.InetAddress)3 AnalysisFilter (com.att.aro.core.packetanalysis.pojo.AnalysisFilter)2 Session (com.att.aro.core.packetanalysis.pojo.Session)2 DomainNameSystem (com.att.aro.core.packetreader.pojo.DomainNameSystem)2 TCPPacket (com.att.aro.core.packetreader.pojo.TCPPacket)2 UDPPacket (com.att.aro.core.packetreader.pojo.UDPPacket)2 CpuActivityList (com.att.aro.core.peripheral.pojo.CpuActivityList)2 HashSet (java.util.HashSet)2