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;
}
}
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));
}
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);
}
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);
}
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);
}
Aggregations