Search in sources :

Example 56 with RrcStateRange

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

the class RrcStateRangeFactoryImplTest method Create3G_test13.

@Test
public void Create3G_test13() {
    // RRCState.STATE_FACH
    Profile3G profile3g = mock(Profile3G.class);
    when(profile3g.getProfileType()).thenReturn(ProfileType.T3G);
    when(profile3g.getIdleDchPromoAvg()).thenReturn(12000.0);
    when(profile3g.getIdleDchPromoMin()).thenReturn(1000.0);
    when(profile3g.getIdleDchPromoMax()).thenReturn(20000.0);
    when(profile3g.getFachDchPromoAvg()).thenReturn(1000.0);
    when(profile3g.getFachDchPromoMin()).thenReturn(2500.0);
    when(profile3g.getFachDchPromoMax()).thenReturn(6000.0);
    when(profile3g.getDchFachTimer()).thenReturn(1000.0);
    when(profile3g.getFachIdleTimer()).thenReturn(2000.0);
    double traceDuration = 2000.0;
    List<PacketInfo> packetlist = new ArrayList<PacketInfo>();
    when(pktInfoArray[0].getTimeStamp()).thenReturn(date.getTime() - 1500.0);
    when(pktInfoArray[0].getDir()).thenReturn(PacketDirection.UPLINK);
    when(pktInfoArray[0].getLen()).thenReturn(1000);
    when(pktInfoArray[0].getStateMachine()).thenReturn(RRCState.STATE_FACH);
    packetlist.add(pktInfoArray[0]);
    when(pktInfoArray[1].getTimeStamp()).thenReturn(date.getTime() + 1000.0);
    when(pktInfoArray[1].getDir()).thenReturn(PacketDirection.UPLINK);
    when(pktInfoArray[1].getLen()).thenReturn(1000);
    when(pktInfoArray[1].getStateMachine()).thenReturn(RRCState.STATE_FACH);
    packetlist.add(pktInfoArray[1]);
    when(pktInfoArray[2].getTimeStamp()).thenReturn(date.getTime() + 1500.0);
    when(pktInfoArray[2].getDir()).thenReturn(PacketDirection.UPLINK);
    when(pktInfoArray[2].getLen()).thenReturn(1000);
    when(pktInfoArray[2].getStateMachine()).thenReturn(RRCState.STATE_FACH);
    packetlist.add(pktInfoArray[2]);
    List<RrcStateRange> testList = rrcStateRangeFactory.create(packetlist, profile3g, traceDuration);
    assertEquals(1, testList.size());
}
Also used : 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) Test(org.junit.Test) BaseTest(com.att.aro.core.BaseTest)

Example 57 with RrcStateRange

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

the class RrcStateRangeFactoryImplTest method Create3G_test6.

@Test
public void Create3G_test6() {
    Profile3G profile3g = mock(Profile3G.class);
    when(profile3g.getProfileType()).thenReturn(ProfileType.T3G);
    when(profile3g.getIdleDchPromoAvg()).thenReturn(12000.0);
    when(profile3g.getIdleDchPromoMin()).thenReturn(1000.0);
    when(profile3g.getIdleDchPromoMax()).thenReturn(20000.0);
    when(profile3g.getFachDchPromoAvg()).thenReturn(1000.0);
    when(profile3g.getFachDchPromoMin()).thenReturn(2500.0);
    when(profile3g.getFachDchPromoMax()).thenReturn(6000.0);
    when(profile3g.getDchFachTimer()).thenReturn(5000.0);
    when(profile3g.getFachIdleTimer()).thenReturn(10000.0);
    double traceDuration = 2000.0;
    List<PacketInfo> packetlist = new ArrayList<PacketInfo>();
    when(pktInfoArray[0].getTimeStamp()).thenReturn(date.getTime() - 5500.0);
    when(pktInfoArray[0].getDir()).thenReturn(PacketDirection.UPLINK);
    when(pktInfoArray[0].getLen()).thenReturn(1000);
    when(pktInfoArray[0].getStateMachine()).thenReturn(RRCState.PROMO_FACH_DCH);
    packetlist.add(pktInfoArray[0]);
    when(pktInfoArray[1].getTimeStamp()).thenReturn(date.getTime() + 1000.0);
    when(pktInfoArray[1].getDir()).thenReturn(PacketDirection.UPLINK);
    when(pktInfoArray[1].getLen()).thenReturn(1000);
    when(pktInfoArray[1].getStateMachine()).thenReturn(RRCState.PROMO_IDLE_DCH);
    packetlist.add(pktInfoArray[1]);
    when(pktInfoArray[2].getTimeStamp()).thenReturn(date.getTime() + 5000.0);
    when(pktInfoArray[2].getDir()).thenReturn(PacketDirection.UPLINK);
    when(pktInfoArray[2].getLen()).thenReturn(1000);
    when(pktInfoArray[2].getStateMachine()).thenReturn(RRCState.PROMO_IDLE_DCH);
    packetlist.add(pktInfoArray[2]);
    List<RrcStateRange> testList = rrcStateRangeFactory.create(packetlist, profile3g, traceDuration);
    assertEquals(1, testList.size());
}
Also used : 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) Test(org.junit.Test) BaseTest(com.att.aro.core.BaseTest)

Example 58 with RrcStateRange

use of com.att.aro.core.packetanalysis.pojo.RrcStateRange 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)

Example 59 with RrcStateRange

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

the class RrcStateRangeFactoryImplTest method Create3G_test12.

@Test
public void Create3G_test12() {
    Profile3G profile3g = mock(Profile3G.class);
    when(profile3g.getProfileType()).thenReturn(ProfileType.T3G);
    when(profile3g.getIdleDchPromoAvg()).thenReturn(12000.0);
    when(profile3g.getIdleDchPromoMin()).thenReturn(1000.0);
    when(profile3g.getIdleDchPromoMax()).thenReturn(20000.0);
    when(profile3g.getFachDchPromoAvg()).thenReturn(1000.0);
    when(profile3g.getFachDchPromoMin()).thenReturn(2500.0);
    when(profile3g.getFachDchPromoMax()).thenReturn(6000.0);
    when(profile3g.getDchFachTimer()).thenReturn(1000.0);
    when(profile3g.getFachIdleTimer()).thenReturn(2000.0);
    double traceDuration = 2000.0;
    List<PacketInfo> packetlist = new ArrayList<PacketInfo>();
    when(pktInfoArray[0].getTimeStamp()).thenReturn(date.getTime() - 1500.0);
    when(pktInfoArray[0].getDir()).thenReturn(PacketDirection.UPLINK);
    when(pktInfoArray[0].getLen()).thenReturn(1000);
    when(pktInfoArray[0].getStateMachine()).thenReturn(RRCState.STATE_DCH);
    packetlist.add(pktInfoArray[0]);
    when(pktInfoArray[1].getTimeStamp()).thenReturn(date.getTime() + 1000.0);
    when(pktInfoArray[1].getDir()).thenReturn(PacketDirection.UPLINK);
    when(pktInfoArray[1].getLen()).thenReturn(1000);
    when(pktInfoArray[1].getStateMachine()).thenReturn(RRCState.STATE_DCH);
    packetlist.add(pktInfoArray[1]);
    when(pktInfoArray[2].getTimeStamp()).thenReturn(date.getTime() + 1500.0);
    when(pktInfoArray[2].getDir()).thenReturn(PacketDirection.UPLINK);
    when(pktInfoArray[2].getLen()).thenReturn(1000);
    when(pktInfoArray[2].getStateMachine()).thenReturn(RRCState.STATE_DCH);
    packetlist.add(pktInfoArray[2]);
    List<RrcStateRange> testList = rrcStateRangeFactory.create(packetlist, profile3g, traceDuration);
    assertEquals(1, testList.size());
}
Also used : 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) Test(org.junit.Test) BaseTest(com.att.aro.core.BaseTest)

Aggregations

RrcStateRange (com.att.aro.core.packetanalysis.pojo.RrcStateRange)59 PacketInfo (com.att.aro.core.packetanalysis.pojo.PacketInfo)48 ArrayList (java.util.ArrayList)47 BaseTest (com.att.aro.core.BaseTest)42 Test (org.junit.Test)42 Profile3G (com.att.aro.core.configuration.pojo.Profile3G)27 Profile (com.att.aro.core.configuration.pojo.Profile)23 RRCState (com.att.aro.core.packetanalysis.pojo.RRCState)22 ProfileLTE (com.att.aro.core.configuration.pojo.ProfileLTE)12 ProfileWiFi (com.att.aro.core.configuration.pojo.ProfileWiFi)9 RrcStateMachine3G (com.att.aro.core.packetanalysis.pojo.RrcStateMachine3G)9 RrcStateMachineLTE (com.att.aro.core.packetanalysis.pojo.RrcStateMachineLTE)9 TCPPacket (com.att.aro.core.packetreader.pojo.TCPPacket)5 UDPPacket (com.att.aro.core.packetreader.pojo.UDPPacket)5 BurstCollectionAnalysisData (com.att.aro.core.packetanalysis.pojo.BurstCollectionAnalysisData)4 RrcStateMachineWiFi (com.att.aro.core.packetanalysis.pojo.RrcStateMachineWiFi)4 DomainNameSystem (com.att.aro.core.packetreader.pojo.DomainNameSystem)4 CpuActivity (com.att.aro.core.peripheral.pojo.CpuActivity)4 InetAddress (java.net.InetAddress)4 HashSet (java.util.HashSet)4