use of com.att.aro.core.configuration.pojo.Profile3G in project VideoOptimzer by attdevsupport.
the class RrcStateMachineFactoryImplTest method create_T3GStateIsPROMO_IDLE_DCH.
@Test
public void create_T3GStateIsPROMO_IDLE_DCH() {
List<PacketInfo> packetlist1 = new ArrayList<PacketInfo>();
when(profilefactory.energy3G(any(double.class), any(double.class), any(RRCState.class), any(Profile3G.class))).thenReturn(100.0);
Profile3G profile14 = mock(Profile3G.class);
when(profile14.getProfileType()).thenReturn(ProfileType.T3G);
List<RrcStateRange> staterangelist = new ArrayList<RrcStateRange>();
RrcStateRange[] rrcStateRangeArray = new RrcStateRange[5];
for (int i = 0; i < 5; i++) {
rrcStateRangeArray[i] = mock(RrcStateRange.class);
when(rrcStateRangeArray[i].getState()).thenReturn(RRCState.PROMO_IDLE_DCH);
when(rrcStateRangeArray[i].getBeginTime()).thenReturn((double) date.getTime() + 2 * i * 500);
when(rrcStateRangeArray[i].getEndTime()).thenReturn((double) date.getTime() + (2 * i + 1) * 500.0);
}
for (int i = 0; i < 5; i++) {
staterangelist.add(rrcStateRangeArray[i]);
}
when(staterange.create(any(ArrayList.class), any(Profile.class), any(double.class))).thenReturn(staterangelist);
RrcStateMachine3G rrcStateMachine3G = (RrcStateMachine3G) machineFactoryimpl.create(packetlist1, profile14, packetDuration, traceDuration, totalBytes * 100, null);
assertEquals(50.0, rrcStateMachine3G.getJoulesPerKilobyte(), 0.0);
assertEquals(5, rrcStateMachine3G.getIdleToDch(), 0.0);
assertEquals(2500, rrcStateMachine3G.getIdleToDchTime(), 0.0);
assertEquals(500, rrcStateMachine3G.getIdleToDchEnergy(), 0.0);
}
use of com.att.aro.core.configuration.pojo.Profile3G in project VideoOptimzer by attdevsupport.
the class RrcStateMachineFactoryImplTest method create_T3GStateIsSTATE_IDLE.
@Test
public void create_T3GStateIsSTATE_IDLE() {
List<PacketInfo> packetlist1 = new ArrayList<PacketInfo>();
when(profilefactory.energy3G(any(double.class), any(double.class), any(RRCState.class), any(Profile3G.class))).thenReturn(100.0);
Profile3G profile10 = mock(Profile3G.class);
when(profile10.getProfileType()).thenReturn(ProfileType.T3G);
List<RrcStateRange> staterangelist = new ArrayList<RrcStateRange>();
RrcStateRange[] rrcStateRangeArray = new RrcStateRange[5];
for (int i = 0; i < 5; i++) {
rrcStateRangeArray[i] = mock(RrcStateRange.class);
when(rrcStateRangeArray[i].getState()).thenReturn(RRCState.STATE_IDLE);
when(rrcStateRangeArray[i].getBeginTime()).thenReturn((double) date.getTime() + 2 * i * 500);
when(rrcStateRangeArray[i].getEndTime()).thenReturn((double) date.getTime() + (2 * i + 1) * 500.0);
}
for (int i = 0; i < 5; i++) {
staterangelist.add(rrcStateRangeArray[i]);
}
when(staterange.create(any(ArrayList.class), any(Profile.class), any(double.class))).thenReturn(staterangelist);
RrcStateMachine3G rrcStateMachine3G = (RrcStateMachine3G) machineFactoryimpl.create(packetlist1, profile10, packetDuration, traceDuration, totalBytes * 100, null);
assertEquals(50.0, rrcStateMachine3G.getJoulesPerKilobyte(), 0.0);
assertEquals(2500, rrcStateMachine3G.getIdleTime(), 0.0);
assertEquals(500, rrcStateMachine3G.getIdleEnergy(), 0.0);
}
use of com.att.aro.core.configuration.pojo.Profile3G in project VideoOptimzer by attdevsupport.
the class RrcStateMachineFactoryImplTest method create_T3GStateIsTAIL_DCH.
@Test
public void create_T3GStateIsTAIL_DCH() {
List<PacketInfo> packetlist1 = new ArrayList<PacketInfo>();
when(profilefactory.energy3G(any(double.class), any(double.class), any(RRCState.class), any(Profile3G.class))).thenReturn(100.0);
Profile3G profile11 = mock(Profile3G.class);
when(profile11.getProfileType()).thenReturn(ProfileType.T3G);
List<RrcStateRange> staterangelist = new ArrayList<RrcStateRange>();
RrcStateRange[] rrcStateRangeArray = new RrcStateRange[5];
for (int i = 0; i < 5; i++) {
rrcStateRangeArray[i] = mock(RrcStateRange.class);
when(rrcStateRangeArray[i].getState()).thenReturn(RRCState.TAIL_DCH);
when(rrcStateRangeArray[i].getBeginTime()).thenReturn((double) date.getTime() + 2 * i * 500);
when(rrcStateRangeArray[i].getEndTime()).thenReturn((double) date.getTime() + (2 * i + 1) * 500.0);
}
for (int i = 0; i < 5; i++) {
staterangelist.add(rrcStateRangeArray[i]);
}
when(staterange.create(any(ArrayList.class), any(Profile.class), any(double.class))).thenReturn(staterangelist);
RrcStateMachine3G rrcStateMachine3G = (RrcStateMachine3G) machineFactoryimpl.create(packetlist1, profile11, packetDuration, traceDuration, totalBytes * 100, null);
assertEquals(50.0, rrcStateMachine3G.getJoulesPerKilobyte(), 0.0);
assertEquals(2500, rrcStateMachine3G.getDchTailTime(), 0.0);
assertEquals(500, rrcStateMachine3G.getDchTailEnergy(), 0.0);
}
use of com.att.aro.core.configuration.pojo.Profile3G in project VideoOptimzer by attdevsupport.
the class RrcStateMachineFactoryImplTest method create_T3GStateIsTAIL_FACH.
@Test
public void create_T3GStateIsTAIL_FACH() {
List<PacketInfo> packetlist1 = new ArrayList<PacketInfo>();
when(profilefactory.energy3G(any(double.class), any(double.class), any(RRCState.class), any(Profile3G.class))).thenReturn(100.0);
Profile3G profile13 = mock(Profile3G.class);
when(profile13.getProfileType()).thenReturn(ProfileType.T3G);
List<RrcStateRange> staterangelist = new ArrayList<RrcStateRange>();
RrcStateRange[] rrcStateRangeArray = new RrcStateRange[5];
for (int i = 0; i < 5; i++) {
rrcStateRangeArray[i] = mock(RrcStateRange.class);
when(rrcStateRangeArray[i].getState()).thenReturn(RRCState.TAIL_FACH);
when(rrcStateRangeArray[i].getBeginTime()).thenReturn((double) date.getTime() + 2 * i * 500);
when(rrcStateRangeArray[i].getEndTime()).thenReturn((double) date.getTime() + (2 * i + 1) * 500.0);
}
for (int i = 0; i < 5; i++) {
staterangelist.add(rrcStateRangeArray[i]);
}
when(staterange.create(any(ArrayList.class), any(Profile.class), any(double.class))).thenReturn(staterangelist);
RrcStateMachine3G rrcStateMachine3G = (RrcStateMachine3G) machineFactoryimpl.create(packetlist1, profile13, packetDuration, traceDuration, totalBytes * 100, null);
assertEquals(50.0, rrcStateMachine3G.getJoulesPerKilobyte(), 0.0);
assertEquals(2500, rrcStateMachine3G.getFachTailTime(), 0.0);
assertEquals(500, rrcStateMachine3G.getFachTailEnergy(), 0.0);
}
use of com.att.aro.core.configuration.pojo.Profile3G in project VideoOptimzer by attdevsupport.
the class RrcStateMachineFactoryImplTest method create_3GStateRrcStateRangeListIsEmpty.
@Test
public void create_3GStateRrcStateRangeListIsEmpty() {
Profile3G profile16 = mock(Profile3G.class);
when(profile16.getProfileType()).thenReturn(ProfileType.T3G);
List<PacketInfo> packetlist1 = new ArrayList<PacketInfo>();
List<RrcStateRange> staterangelist = new ArrayList<RrcStateRange>();
when(staterange.create(any(ArrayList.class), any(Profile.class), any(double.class))).thenReturn(staterangelist);
RrcStateMachine3G rrcStateMachine3G = (RrcStateMachine3G) machineFactoryimpl.create(packetlist1, profile16, packetDuration, traceDuration, 0 * totalBytes, null);
assertEquals(0.0, rrcStateMachine3G.getJoulesPerKilobyte(), 0.0);
assertEquals(1000, rrcStateMachine3G.getPacketsDuration(), 0.0);
assertEquals(2000, rrcStateMachine3G.getTraceDuration(), 0.0);
}
Aggregations