Search in sources :

Example 6 with Profile3G

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

the class RrcStateRangeFactoryImplTest method Create3G_test14.

@Test
public void Create3G_test14() {
    // 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.DOWNLINK);
    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.DOWNLINK);
    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.DOWNLINK);
    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 7 with Profile3G

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

the class RrcStateRangeFactoryImplTest method Create3G_test15.

@Test
public void Create3G_test15() {
    // 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.DOWNLINK);
    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.DOWNLINK);
    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.DOWNLINK);
    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 8 with Profile3G

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

the class RrcStateRangeFactoryImplTest method create3G_test2.

@Test
public void create3G_test2() {
    // promotestate is TAIL_DCH
    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.TAIL_DCH);
    packetlist.add(pktInfoArray[0]);
    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);
    packetlist.add(pktInfoArray[1]);
    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 9 with Profile3G

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

the class RrcStateRangeFactoryImplTest method Create3G_test9.

@Test
public void Create3G_test9() {
    // promoState == RRCState.STATE_DCH
    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.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() + 10000.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() + 15000.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 10 with Profile3G

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

the class UserPreferencesTest method testSetLastProfile_ProfileType_3G.

@Test
public void testSetLastProfile_ProfileType_3G() {
    UserPreferences userPrefs = MockUserPreferencesFactory.getInstance().create();
    Profile3G profile3G = new Profile3G();
    String expectedProfileName = "testProfile3G";
    profile3G.setName(expectedProfileName);
    userPrefs.setLastProfile(profile3G);
    IPreferenceHandler mockPrefHandler = userPrefs.getPreferenceHandler();
    assertEquals(expectedProfileName, mockPrefHandler.getPref(PROFILE));
    assertEquals(expectedProfileName, mockPrefHandler.getPref(PROFILE_3G));
    assertNull(mockPrefHandler.getPref(PROFILE_LTE));
    assertNull(mockPrefHandler.getPref(PROFILE_WIFI));
}
Also used : Profile3G(com.att.aro.core.configuration.pojo.Profile3G) 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