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