Search in sources :

Example 26 with Profile3G

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

the class RrcStateMachineFactoryImplTest method create_T3GStateIsPROMO_IDLE_DCH.

@Test
public void create_T3GStateIsPROMO_IDLE_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 profile14 = mock(Profile3G.class);
    when(profile14.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.PROMO_IDLE_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, profile14, packetDuration, traceDuration, totalBytes * 100, null);
    assertEquals(50.0, rrcStateMachine3G.getJoulesPerKilobyte(), 0.0);
    assertEquals(5, rrcStateMachine3G.getIdleToDch(), 0.0);
    assertEquals(2500, rrcStateMachine3G.getIdleToDchTime(), 0.0);
    assertEquals(500, rrcStateMachine3G.getIdleToDchEnergy(), 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 27 with Profile3G

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

the class RrcStateMachineFactoryImplTest method create_T3GStateIsSTATE_IDLE.

@Test
public void create_T3GStateIsSTATE_IDLE() {
    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 profile10 = mock(Profile3G.class);
    when(profile10.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.STATE_IDLE);
        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, profile10, packetDuration, traceDuration, totalBytes * 100, null);
    assertEquals(50.0, rrcStateMachine3G.getJoulesPerKilobyte(), 0.0);
    assertEquals(2500, rrcStateMachine3G.getIdleTime(), 0.0);
    assertEquals(500, rrcStateMachine3G.getIdleEnergy(), 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 28 with Profile3G

use of com.att.aro.core.configuration.pojo.Profile3G 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 29 with Profile3G

use of com.att.aro.core.configuration.pojo.Profile3G 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 30 with Profile3G

use of com.att.aro.core.configuration.pojo.Profile3G 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

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