Search in sources :

Example 11 with ProfileLTE

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

the class ProfileManager method getDefaultProfile.

/**
 * Returns the default device profile for the specified profile type (i.e. 3G or LTE)
 *
 * @param profileType
 *            The device profile type. One of the values of the Profiletype enumeration.
 *
 * @return Profile The default profile.
 */
public Profile getDefaultProfile(ProfileType profileType) {
    Profile result = null;
    // Try default pre-defined
    String name = profileType == ProfileType.LTE ? DEFAULT_PROFILE_LTE : DEFAULT_PROFILE;
    try {
        // aroProfiles.getString(name));
        result = getPredefinedProfile(name);
    } catch (ProfileException e) {
        LOGGER.warn("Unable to load default pre-defined profile: " + profileType.name(), e);
    } catch (IOException e) {
        LOGGER.warn("Unable to load default pre-defined profile: " + profileType.name(), e);
    }
    if (result == null) {
        return profileType == ProfileType.LTE ? new ProfileLTE() : new Profile3G();
    } else {
        return result;
    }
}
Also used : Profile3G(com.att.aro.core.configuration.pojo.Profile3G) IOException(java.io.IOException) ProfileLTE(com.att.aro.core.configuration.pojo.ProfileLTE) Profile(com.att.aro.core.configuration.pojo.Profile)

Example 12 with ProfileLTE

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

the class UserPreferencesTest method testSetLastProfile_ProfileType_LTE.

@Test
public void testSetLastProfile_ProfileType_LTE() {
    UserPreferences userPrefs = MockUserPreferencesFactory.getInstance().create();
    ProfileLTE profileLTE = new ProfileLTE();
    String expectedProfileName = "testProfileLTE";
    profileLTE.setName(expectedProfileName);
    userPrefs.setLastProfile(profileLTE);
    IPreferenceHandler mockPrefHandler = userPrefs.getPreferenceHandler();
    assertEquals(expectedProfileName, mockPrefHandler.getPref(PROFILE));
    assertEquals(expectedProfileName, mockPrefHandler.getPref(PROFILE_LTE));
    assertNull(mockPrefHandler.getPref(PROFILE_3G));
    assertNull(mockPrefHandler.getPref(PROFILE_WIFI));
}
Also used : ProfileLTE(com.att.aro.core.configuration.pojo.ProfileLTE) Test(org.junit.Test) BaseTest(com.att.aro.core.BaseTest)

Example 13 with ProfileLTE

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

the class ProfileFactoryImplTest method energyLTE_RRCStateIsLTE_IDLE.

@Test
public void energyLTE_RRCStateIsLTE_IDLE() {
    ProfileLTE profileLte02 = Mockito.mock(ProfileLTE.class);
    List<PacketInfo> packets = new ArrayList<PacketInfo>();
    when(profileLte02.getIdlePingTime()).thenReturn(1.0);
    when(profileLte02.getLteIdlePingPower()).thenReturn(1.0);
    when(profileLte02.getIdlePingPeriod()).thenReturn(2.0);
    when(profileLte02.getLteIdlePower()).thenReturn(1.0);
    double testResult = profilefactory.energyLTE(date.getTime() + 0.0, date.getTime() + 1000.0, RRCState.LTE_IDLE, profileLte02, packets);
    assertEquals(1000.0, testResult, 0.0);
}
Also used : ArrayList(java.util.ArrayList) PacketInfo(com.att.aro.core.packetanalysis.pojo.PacketInfo) ProfileLTE(com.att.aro.core.configuration.pojo.ProfileLTE) Test(org.junit.Test) BaseTest(com.att.aro.core.BaseTest)

Example 14 with ProfileLTE

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

the class ProfileFactoryImplTest method energyLTE_RRCStateIsLTE_IDLE_a.

@Test
public void energyLTE_RRCStateIsLTE_IDLE_a() {
    ProfileLTE profileLte03 = Mockito.mock(ProfileLTE.class);
    List<PacketInfo> packets = new ArrayList<PacketInfo>();
    when(profileLte03.getIdlePingTime()).thenReturn(1.0);
    when(profileLte03.getLteIdlePingPower()).thenReturn(1.0);
    when(profileLte03.getIdlePingPeriod()).thenReturn(9.0);
    when(profileLte03.getLteIdlePower()).thenReturn(1.0);
    double testResult = profilefactory.energyLTE(date.getTime() + 0.0, date.getTime() + 14750.0, RRCState.LTE_IDLE, profileLte03, packets);
    assertEquals(14750.0, testResult, 0.0);
}
Also used : ArrayList(java.util.ArrayList) PacketInfo(com.att.aro.core.packetanalysis.pojo.PacketInfo) ProfileLTE(com.att.aro.core.configuration.pojo.ProfileLTE) Test(org.junit.Test) BaseTest(com.att.aro.core.BaseTest)

Example 15 with ProfileLTE

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

the class ProfileFactoryImplTest method energyLTE_RRCStateIsLTE_CR_TAIL.

@Test
public void energyLTE_RRCStateIsLTE_CR_TAIL() {
    ProfileLTE profileLte04 = Mockito.mock(ProfileLTE.class);
    List<PacketInfo> packets = new ArrayList<PacketInfo>();
    when(profileLte04.getIdlePingTime()).thenReturn(1.0);
    when(profileLte04.getLteIdlePingPower()).thenReturn(1.0);
    when(profileLte04.getIdlePingPeriod()).thenReturn(2.0);
    when(profileLte04.getLteIdlePower()).thenReturn(1.0);
    double testResult = profilefactory.energyLTE(date.getTime() + 0.0, date.getTime() + 1000.0, RRCState.LTE_CR_TAIL, profileLte04, packets);
    assertEquals(0.0, testResult, 0.0);
}
Also used : ArrayList(java.util.ArrayList) PacketInfo(com.att.aro.core.packetanalysis.pojo.PacketInfo) 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