Search in sources :

Example 31 with Profile3G

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

the class RrcStateRangeFactoryImplTest method create3G_test4.

@Test
public void create3G_test4() {
    Profile3G profile3g = mock(Profile3G.class);
    when(profile3g.getProfileType()).thenReturn(ProfileType.T3G);
    when(profile3g.getIdleDchPromoAvg()).thenReturn((double) date.getTime());
    when(profile3g.getIdleDchPromoMin()).thenReturn((double) date.getTime());
    when(profile3g.getIdleDchPromoMax()).thenReturn((double) date.getTime());
    when(profile3g.getFachDchPromoAvg()).thenReturn((double) date.getTime());
    when(profile3g.getFachDchPromoMin()).thenReturn((double) date.getTime());
    when(profile3g.getFachDchPromoMax()).thenReturn((double) date.getTime());
    when(profile3g.getDchFachTimer()).thenReturn((double) date.getTime());
    when(profile3g.getFachIdleTimer()).thenReturn((double) date.getTime());
    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.DOWNLINK);
    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() + 100.0);
    when(pktInfoArray[1].getDir()).thenReturn(PacketDirection.DOWNLINK);
    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() + 500.0);
    when(pktInfoArray[2].getDir()).thenReturn(PacketDirection.DOWNLINK);
    when(pktInfoArray[2].getLen()).thenReturn(1000);
    when(pktInfoArray[2].getStateMachine()).thenReturn(RRCState.PROMO_IDLE_DCH);
    packetlist.add(pktInfoArray[2]);
    when(pktInfoArray[3].getTimeStamp()).thenReturn(date.getTime() + 2300.0);
    when(pktInfoArray[3].getDir()).thenReturn(PacketDirection.UNKNOWN);
    when(pktInfoArray[3].getLen()).thenReturn(1000);
    when(pktInfoArray[3].getStateMachine()).thenReturn(RRCState.PROMO_FACH_DCH);
    packetlist.add(pktInfoArray[3]);
    when(pktInfoArray[4].getTimeStamp()).thenReturn(date.getTime() + 3005.0);
    when(pktInfoArray[4].getDir()).thenReturn(PacketDirection.UNKNOWN);
    when(pktInfoArray[4].getLen()).thenReturn(1000);
    when(pktInfoArray[4].getStateMachine()).thenReturn(RRCState.PROMO_FACH_DCH);
    packetlist.add(pktInfoArray[4]);
    when(pktInfoArray[5].getTimeStamp()).thenReturn(date.getTime() + 4500.0);
    when(pktInfoArray[5].getDir()).thenReturn(PacketDirection.UNKNOWN);
    when(pktInfoArray[5].getLen()).thenReturn(1000);
    when(pktInfoArray[5].getStateMachine()).thenReturn(RRCState.PROMO_FACH_DCH);
    packetlist.add(pktInfoArray[5]);
    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 32 with Profile3G

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

the class RrcStateRangeFactoryImplTest method Create3G_test10.

@Test
public void Create3G_test10() {
    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() - 3500.0);
    when(pktInfoArray[0].getDir()).thenReturn(PacketDirection.DOWNLINK);
    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.DOWNLINK);
    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.DOWNLINK);
    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)

Example 33 with Profile3G

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

the class RrcStateRangeFactoryImplTest method create3G_.

@Test
public void create3G_() {
    Profile3G profile3g = mock(Profile3G.class);
    when(profile3g.getProfileType()).thenReturn(ProfileType.T3G);
    when(profile3g.getIdleDchPromoAvg()).thenReturn(1000.0);
    when(profile3g.getIdleDchPromoMin()).thenReturn(1000.0);
    when(profile3g.getIdleDchPromoMax()).thenReturn(1000.0);
    when(profile3g.getFachDchPromoAvg()).thenReturn(1000.0);
    when(profile3g.getFachDchPromoMin()).thenReturn(1000.0);
    when(profile3g.getFachDchPromoMax()).thenReturn(1000.0);
    when(profile3g.getDchFachTimer()).thenReturn(1000.0);
    when(profile3g.getFachIdleTimer()).thenReturn(1000.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.DOWNLINK);
    when(pktInfoArray[0].getLen()).thenReturn(1000);
    when(pktInfoArray[0].getStateMachine()).thenReturn(RRCState.PROMO_FACH_DCH);
    when(pktInfoArray[1].getTimeStamp()).thenReturn(date.getTime() + 100.0);
    when(pktInfoArray[1].getDir()).thenReturn(PacketDirection.UPLINK);
    when(pktInfoArray[1].getLen()).thenReturn(1000);
    when(pktInfoArray[1].getStateMachine()).thenReturn(RRCState.STATE_DCH);
    when(pktInfoArray[2].getTimeStamp()).thenReturn(date.getTime() + 500.0);
    when(pktInfoArray[2].getDir()).thenReturn(PacketDirection.DOWNLINK);
    when(pktInfoArray[2].getLen()).thenReturn(1000);
    when(pktInfoArray[2].getStateMachine()).thenReturn(RRCState.STATE_FACH);
    when(pktInfoArray[3].getTimeStamp()).thenReturn(date.getTime() + 2300.0);
    when(pktInfoArray[3].getDir()).thenReturn(PacketDirection.UPLINK);
    when(pktInfoArray[3].getLen()).thenReturn(1000);
    when(pktInfoArray[3].getStateMachine()).thenReturn(RRCState.STATE_DCH);
    when(pktInfoArray[4].getTimeStamp()).thenReturn(date.getTime() + 3005.0);
    when(pktInfoArray[4].getDir()).thenReturn(PacketDirection.DOWNLINK);
    when(pktInfoArray[4].getLen()).thenReturn(1000);
    when(pktInfoArray[4].getStateMachine()).thenReturn(RRCState.STATE_DCH);
    when(pktInfoArray[5].getTimeStamp()).thenReturn(date.getTime() + 4500.0);
    when(pktInfoArray[5].getDir()).thenReturn(PacketDirection.UPLINK);
    when(pktInfoArray[5].getLen()).thenReturn(1000);
    when(pktInfoArray[5].getStateMachine()).thenReturn(RRCState.STATE_FACH);
    when(pktInfoArray[6].getTimeStamp()).thenReturn(date.getTime() + 5501.0);
    when(pktInfoArray[6].getDir()).thenReturn(PacketDirection.DOWNLINK);
    when(pktInfoArray[6].getLen()).thenReturn(1000);
    when(pktInfoArray[6].getStateMachine()).thenReturn(RRCState.STATE_FACH);
    when(pktInfoArray[7].getTimeStamp()).thenReturn(date.getTime() + 6001.0);
    when(pktInfoArray[7].getDir()).thenReturn(PacketDirection.UPLINK);
    when(pktInfoArray[7].getLen()).thenReturn(1000);
    when(pktInfoArray[7].getStateMachine()).thenReturn(RRCState.PROMO_FACH_DCH);
    when(pktInfoArray[8].getTimeStamp()).thenReturn(date.getTime() + 9601.0);
    when(pktInfoArray[8].getDir()).thenReturn(PacketDirection.UPLINK);
    when(pktInfoArray[8].getLen()).thenReturn(1000);
    when(pktInfoArray[8].getStateMachine()).thenReturn(RRCState.STATE_FACH);
    when(pktInfoArray[9].getTimeStamp()).thenReturn(date.getTime() + 16001.0);
    when(pktInfoArray[9].getDir()).thenReturn(PacketDirection.DOWNLINK);
    when(pktInfoArray[9].getLen()).thenReturn(1000);
    when(pktInfoArray[9].getStateMachine()).thenReturn(RRCState.PROMO_FACH_DCH);
    when(pktInfoArray[10].getTimeStamp()).thenReturn(date.getTime() + 17601.0);
    when(pktInfoArray[10].getDir()).thenReturn(PacketDirection.UPLINK);
    when(pktInfoArray[10].getLen()).thenReturn(1000);
    when(pktInfoArray[10].getStateMachine()).thenReturn(RRCState.STATE_DCH);
    when(pktInfoArray[11].getTimeStamp()).thenReturn(date.getTime() + 18000.0);
    when(pktInfoArray[11].getDir()).thenReturn(PacketDirection.DOWNLINK);
    when(pktInfoArray[11].getLen()).thenReturn(1000);
    when(pktInfoArray[11].getStateMachine()).thenReturn(RRCState.PROMO_FACH_DCH);
    when(pktInfoArray[12].getTimeStamp()).thenReturn(date.getTime() + 29900.0);
    when(pktInfoArray[12].getDir()).thenReturn(PacketDirection.DOWNLINK);
    when(pktInfoArray[12].getLen()).thenReturn(1000);
    when(pktInfoArray[12].getStateMachine()).thenReturn(RRCState.PROMO_IDLE_DCH);
    when(pktInfoArray[13].getTimeStamp()).thenReturn(date.getTime() + 35500.0);
    when(pktInfoArray[13].getDir()).thenReturn(PacketDirection.UPLINK);
    when(pktInfoArray[13].getLen()).thenReturn(1000);
    when(pktInfoArray[13].getStateMachine()).thenReturn(RRCState.STATE_DCH);
    when(pktInfoArray[14].getTimeStamp()).thenReturn(date.getTime() + 45005.0);
    when(pktInfoArray[14].getDir()).thenReturn(PacketDirection.DOWNLINK);
    when(pktInfoArray[14].getLen()).thenReturn(1000);
    when(pktInfoArray[14].getStateMachine()).thenReturn(RRCState.STATE_DCH);
    when(pktInfoArray[15].getTimeStamp()).thenReturn(date.getTime() + 46500.0);
    when(pktInfoArray[15].getDir()).thenReturn(PacketDirection.UPLINK);
    when(pktInfoArray[15].getLen()).thenReturn(1000);
    when(pktInfoArray[15].getStateMachine()).thenReturn(RRCState.STATE_DCH);
    when(pktInfoArray[16].getTimeStamp()).thenReturn(date.getTime() + 47501.0);
    when(pktInfoArray[16].getDir()).thenReturn(PacketDirection.DOWNLINK);
    when(pktInfoArray[16].getLen()).thenReturn(1000);
    when(pktInfoArray[16].getStateMachine()).thenReturn(RRCState.PROMO_FACH_DCH);
    when(pktInfoArray[17].getTimeStamp()).thenReturn(date.getTime() + 47601.0);
    when(pktInfoArray[17].getDir()).thenReturn(PacketDirection.UPLINK);
    when(pktInfoArray[17].getLen()).thenReturn(1000);
    when(pktInfoArray[17].getStateMachine()).thenReturn(RRCState.PROMO_IDLE_DCH);
    when(pktInfoArray[18].getTimeStamp()).thenReturn(date.getTime() + 57001.0);
    when(pktInfoArray[18].getDir()).thenReturn(PacketDirection.DOWNLINK);
    when(pktInfoArray[18].getLen()).thenReturn(1000);
    when(pktInfoArray[18].getStateMachine()).thenReturn(RRCState.PROMO_FACH_DCH);
    when(pktInfoArray[19].getTimeStamp()).thenReturn(date.getTime() + 66001.0);
    when(pktInfoArray[19].getDir()).thenReturn(PacketDirection.UPLINK);
    when(pktInfoArray[19].getLen()).thenReturn(1000);
    when(pktInfoArray[19].getStateMachine()).thenReturn(RRCState.STATE_DCH);
    when(pktInfoArray[20].getTimeStamp()).thenReturn(date.getTime() + 66301.0);
    when(pktInfoArray[20].getDir()).thenReturn(PacketDirection.UPLINK);
    when(pktInfoArray[20].getLen()).thenReturn(1000);
    when(pktInfoArray[20].getStateMachine()).thenReturn(RRCState.STATE_FACH);
    when(pktInfoArray[21].getTimeStamp()).thenReturn(date.getTime() + 62301.0);
    when(pktInfoArray[21].getDir()).thenReturn(PacketDirection.DOWNLINK);
    when(pktInfoArray[21].getLen()).thenReturn(1000);
    when(pktInfoArray[21].getStateMachine()).thenReturn(RRCState.STATE_FACH);
    when(pktInfoArray[22].getTimeStamp()).thenReturn(date.getTime() + 63101.0);
    when(pktInfoArray[22].getDir()).thenReturn(PacketDirection.UPLINK);
    when(pktInfoArray[22].getLen()).thenReturn(1000);
    when(pktInfoArray[22].getStateMachine()).thenReturn(RRCState.STATE_FACH);
    when(pktInfoArray[23].getTimeStamp()).thenReturn(date.getTime() + 65501.0);
    when(pktInfoArray[23].getDir()).thenReturn(PacketDirection.DOWNLINK);
    when(pktInfoArray[23].getLen()).thenReturn(1000);
    when(pktInfoArray[23].getStateMachine()).thenReturn(RRCState.STATE_FACH);
    when(pktInfoArray[24].getTimeStamp()).thenReturn(date.getTime() + 67501.0);
    when(pktInfoArray[24].getDir()).thenReturn(PacketDirection.DOWNLINK);
    when(pktInfoArray[24].getLen()).thenReturn(1000);
    when(pktInfoArray[24].getStateMachine()).thenReturn(RRCState.PROMO_FACH_DCH);
    when(pktInfoArray[25].getTimeStamp()).thenReturn(date.getTime() + 70501.0);
    when(pktInfoArray[25].getDir()).thenReturn(PacketDirection.DOWNLINK);
    when(pktInfoArray[25].getLen()).thenReturn(1000);
    when(pktInfoArray[25].getStateMachine()).thenReturn(RRCState.PROMO_FACH_DCH);
    when(pktInfoArray[26].getTimeStamp()).thenReturn(date.getTime() + 80501.0);
    when(pktInfoArray[26].getDir()).thenReturn(PacketDirection.DOWNLINK);
    when(pktInfoArray[26].getLen()).thenReturn(1000);
    when(pktInfoArray[26].getStateMachine()).thenReturn(RRCState.PROMO_FACH_DCH);
    when(pktInfoArray[27].getTimeStamp()).thenReturn(date.getTime() + 84601.0);
    when(pktInfoArray[27].getDir()).thenReturn(PacketDirection.UPLINK);
    when(pktInfoArray[27].getLen()).thenReturn(1000);
    when(pktInfoArray[27].getStateMachine()).thenReturn(RRCState.PROMO_FACH_DCH);
    when(pktInfoArray[28].getTimeStamp()).thenReturn(date.getTime() + 86101.0);
    when(pktInfoArray[28].getDir()).thenReturn(PacketDirection.DOWNLINK);
    when(pktInfoArray[28].getLen()).thenReturn(1000);
    when(pktInfoArray[28].getStateMachine()).thenReturn(RRCState.PROMO_FACH_DCH);
    when(pktInfoArray[29].getTimeStamp()).thenReturn(date.getTime() + 86301.0);
    when(pktInfoArray[29].getDir()).thenReturn(PacketDirection.DOWNLINK);
    when(pktInfoArray[29].getLen()).thenReturn(1000);
    when(pktInfoArray[29].getStateMachine()).thenReturn(RRCState.PROMO_FACH_DCH);
    when(pktInfoArray[30].getTimeStamp()).thenReturn(date.getTime() + 87901.0);
    when(pktInfoArray[30].getDir()).thenReturn(PacketDirection.UPLINK);
    when(pktInfoArray[30].getLen()).thenReturn(1000);
    when(pktInfoArray[30].getStateMachine()).thenReturn(RRCState.PROMO_FACH_DCH);
    when(pktInfoArray[31].getTimeStamp()).thenReturn(date.getTime() + 88301.0);
    when(pktInfoArray[31].getDir()).thenReturn(PacketDirection.UPLINK);
    when(pktInfoArray[31].getLen()).thenReturn(1000);
    when(pktInfoArray[31].getStateMachine()).thenReturn(RRCState.PROMO_FACH_DCH);
    when(pktInfoArray[32].getTimeStamp()).thenReturn(date.getTime() + 90401.0);
    when(pktInfoArray[32].getDir()).thenReturn(PacketDirection.UPLINK);
    when(pktInfoArray[32].getLen()).thenReturn(1000);
    when(pktInfoArray[32].getStateMachine()).thenReturn(RRCState.PROMO_FACH_DCH);
    when(pktInfoArray[33].getTimeStamp()).thenReturn(date.getTime() + 91101.0);
    when(pktInfoArray[33].getDir()).thenReturn(PacketDirection.UPLINK);
    when(pktInfoArray[33].getLen()).thenReturn(1000);
    when(pktInfoArray[33].getStateMachine()).thenReturn(RRCState.PROMO_FACH_DCH);
    when(pktInfoArray[34].getTimeStamp()).thenReturn(date.getTime() + 91500.0);
    when(pktInfoArray[34].getDir()).thenReturn(PacketDirection.UPLINK);
    when(pktInfoArray[34].getLen()).thenReturn(1000);
    when(pktInfoArray[34].getStateMachine()).thenReturn(RRCState.STATE_DCH);
    when(pktInfoArray[35].getTimeStamp()).thenReturn(date.getTime() + 94605.0);
    when(pktInfoArray[35].getDir()).thenReturn(PacketDirection.UPLINK);
    when(pktInfoArray[35].getLen()).thenReturn(1000);
    when(pktInfoArray[35].getStateMachine()).thenReturn(RRCState.STATE_DCH);
    when(pktInfoArray[36].getTimeStamp()).thenReturn(date.getTime() + 98700.0);
    when(pktInfoArray[36].getDir()).thenReturn(PacketDirection.UPLINK);
    when(pktInfoArray[36].getLen()).thenReturn(1000);
    when(pktInfoArray[36].getStateMachine()).thenReturn(RRCState.STATE_DCH);
    when(pktInfoArray[37].getTimeStamp()).thenReturn(date.getTime() + 98800.0);
    when(pktInfoArray[37].getDir()).thenReturn(PacketDirection.DOWNLINK);
    when(pktInfoArray[37].getLen()).thenReturn(1000);
    when(pktInfoArray[37].getStateMachine()).thenReturn(RRCState.STATE_FACH);
    when(pktInfoArray[38].getTimeStamp()).thenReturn(date.getTime() + 98900.0);
    when(pktInfoArray[38].getDir()).thenReturn(PacketDirection.DOWNLINK);
    when(pktInfoArray[38].getLen()).thenReturn(1000);
    when(pktInfoArray[38].getStateMachine()).thenReturn(RRCState.STATE_FACH);
    when(pktInfoArray[39].getTimeStamp()).thenReturn(date.getTime() + 99200.0);
    when(pktInfoArray[39].getDir()).thenReturn(PacketDirection.DOWNLINK);
    when(pktInfoArray[39].getLen()).thenReturn(1000);
    when(pktInfoArray[39].getStateMachine()).thenReturn(RRCState.STATE_FACH);
    when(pktInfoArray[40].getTimeStamp()).thenReturn(date.getTime() + 99300.0);
    when(pktInfoArray[40].getDir()).thenReturn(PacketDirection.DOWNLINK);
    when(pktInfoArray[40].getLen()).thenReturn(1000);
    when(pktInfoArray[40].getStateMachine()).thenReturn(RRCState.STATE_FACH);
    when(pktInfoArray[41].getTimeStamp()).thenReturn(date.getTime() + 109400.0);
    when(pktInfoArray[41].getDir()).thenReturn(PacketDirection.DOWNLINK);
    when(pktInfoArray[41].getLen()).thenReturn(1000);
    when(pktInfoArray[41].getStateMachine()).thenReturn(RRCState.STATE_FACH);
    when(pktInfoArray[42].getTimeStamp()).thenReturn(date.getTime() + 109500.0);
    when(pktInfoArray[42].getDir()).thenReturn(PacketDirection.UPLINK);
    when(pktInfoArray[42].getLen()).thenReturn(1000);
    when(pktInfoArray[42].getStateMachine()).thenReturn(RRCState.STATE_FACH);
    when(pktInfoArray[43].getTimeStamp()).thenReturn(date.getTime() + 119600.0);
    when(pktInfoArray[43].getDir()).thenReturn(PacketDirection.DOWNLINK);
    when(pktInfoArray[43].getLen()).thenReturn(1000);
    when(pktInfoArray[43].getStateMachine()).thenReturn(RRCState.STATE_FACH);
    when(pktInfoArray[44].getTimeStamp()).thenReturn(date.getTime() + 123600.0);
    when(pktInfoArray[44].getDir()).thenReturn(PacketDirection.DOWNLINK);
    when(pktInfoArray[44].getLen()).thenReturn(1000);
    when(pktInfoArray[44].getStateMachine()).thenReturn(RRCState.STATE_FACH);
    when(pktInfoArray[45].getTimeStamp()).thenReturn(date.getTime() + 124500.0);
    when(pktInfoArray[45].getDir()).thenReturn(PacketDirection.DOWNLINK);
    when(pktInfoArray[45].getLen()).thenReturn(1000);
    when(pktInfoArray[45].getStateMachine()).thenReturn(RRCState.STATE_FACH);
    when(pktInfoArray[46].getTimeStamp()).thenReturn(date.getTime() + 139600.0);
    when(pktInfoArray[46].getDir()).thenReturn(PacketDirection.DOWNLINK);
    when(pktInfoArray[46].getLen()).thenReturn(1000);
    when(pktInfoArray[46].getStateMachine()).thenReturn(RRCState.STATE_FACH);
    for (int i = 0; i < 47; i++) {
        packetlist.add(pktInfoArray[i]);
    }
    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 34 with Profile3G

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

the class RrcStateRangeFactoryImplTest method Create3G_test7.

@Test
public void Create3G_test7() {
    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() - 7500.0);
    when(pktInfoArray[0].getDir()).thenReturn(PacketDirection.UNKNOWN);
    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() + 10000.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() + 15000.0);
    when(pktInfoArray[2].getDir()).thenReturn(PacketDirection.UNKNOWN);
    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 35 with Profile3G

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

the class RrcStateRangeFactoryImplTest method Create3G_test11.

@Test
public void Create3G_test11() {
    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.DOWNLINK);
    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.DOWNLINK);
    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.DOWNLINK);
    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

Profile3G (com.att.aro.core.configuration.pojo.Profile3G)38 BaseTest (com.att.aro.core.BaseTest)34 Test (org.junit.Test)34 RrcStateRange (com.att.aro.core.packetanalysis.pojo.RrcStateRange)26 PacketInfo (com.att.aro.core.packetanalysis.pojo.PacketInfo)25 ArrayList (java.util.ArrayList)25 Profile (com.att.aro.core.configuration.pojo.Profile)9 RrcStateMachine3G (com.att.aro.core.packetanalysis.pojo.RrcStateMachine3G)8 RRCState (com.att.aro.core.packetanalysis.pojo.RRCState)7 ProfileWiFi (com.att.aro.core.configuration.pojo.ProfileWiFi)2 Burst (com.att.aro.core.packetanalysis.pojo.Burst)2 BurstCollectionAnalysisData (com.att.aro.core.packetanalysis.pojo.BurstCollectionAnalysisData)2 Session (com.att.aro.core.packetanalysis.pojo.Session)2 InetAddress (java.net.InetAddress)2 AbstractBestPracticeResult (com.att.aro.core.bestpractice.pojo.AbstractBestPracticeResult)1 ProfileLTE (com.att.aro.core.configuration.pojo.ProfileLTE)1 AbstractRrcStateMachine (com.att.aro.core.packetanalysis.pojo.AbstractRrcStateMachine)1 HttpRequestResponseInfo (com.att.aro.core.packetanalysis.pojo.HttpRequestResponseInfo)1 PacketAnalyzerResult (com.att.aro.core.packetanalysis.pojo.PacketAnalyzerResult)1 DomainNameSystem (com.att.aro.core.packetreader.pojo.DomainNameSystem)1