Search in sources :

Example 16 with Profile3G

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

the class ProfileFactoryImplTest method energy3G_RRCStateIsPROMO_FACH_DCH.

@Test
public void energy3G_RRCStateIsPROMO_FACH_DCH() {
    Profile3G profile3g = Mockito.mock(Profile3G.class);
    Mockito.when(profile3g.getPowerFachDch()).thenReturn(0.3);
    double testResult = profilefactory.energy3G(date.getTime() + 0.0, date.getTime() + 1000.0, RRCState.PROMO_FACH_DCH, profile3g);
    assertEquals(300.0, testResult, 0.0);
}
Also used : Profile3G(com.att.aro.core.configuration.pojo.Profile3G) Test(org.junit.Test) BaseTest(com.att.aro.core.BaseTest)

Example 17 with Profile3G

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

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

the class UserPreferencesTest method testSetLastProfile_NullProfileName.

@Test
public void testSetLastProfile_NullProfileName() {
    UserPreferences userPrefs = MockUserPreferencesFactory.getInstance().create();
    Profile3G profile3G = new Profile3G();
    userPrefs.setLastProfile(profile3G);
    IPreferenceHandler mockPrefHandler = userPrefs.getPreferenceHandler();
    assertNull(mockPrefHandler.getPref(PROFILE));
    assertNull(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)

Example 19 with Profile3G

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

the class ProfileFactoryImplTest method energy3G_RRCStateIsSTATE_IDLE.

@Test
public void energy3G_RRCStateIsSTATE_IDLE() {
    Profile3G profile3g = Mockito.mock(Profile3G.class);
    Mockito.when(profile3g.getPowerIdle()).thenReturn(0.2);
    double testResult = profilefactory.energy3G(date.getTime() + 0.0, date.getTime() + 1000.0, RRCState.STATE_IDLE, profile3g);
    assertEquals(200.0, testResult, 0.0);
}
Also used : Profile3G(com.att.aro.core.configuration.pojo.Profile3G) Test(org.junit.Test) BaseTest(com.att.aro.core.BaseTest)

Example 20 with Profile3G

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

the class ProfileFactoryImplTest method energy3G_RRCStateIsTAIL_DCH.

@Test
public void energy3G_RRCStateIsTAIL_DCH() {
    Profile3G profile3g = Mockito.mock(Profile3G.class);
    Mockito.when(profile3g.getPowerDch()).thenReturn(0.7);
    double testResult = profilefactory.energy3G(date.getTime() + 0.0, date.getTime() + 1000.0, RRCState.TAIL_DCH, profile3g);
    assertEquals(700.0, testResult, 0.0);
}
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