use of com.att.aro.core.configuration.pojo.ProfileLTE in project VideoOptimzer by attdevsupport.
the class PeriodicTransferImplTest method runTest_AresultIsPass.
@Test
public void runTest_AresultIsPass() {
PacketAnalyzerResult tracedata01 = new PacketAnalyzerResult();
Date date = new Date();
List<Burst> burstCollection = new ArrayList<Burst>();
BurstCollectionAnalysisData burstcollectionAnalysisData = new BurstCollectionAnalysisData();
InetAddress remoteIP = null;
InetAddress localIP = null;
try {
localIP = InetAddress.getLocalHost();
remoteIP = InetAddress.getLocalHost();
} catch (UnknownHostException e) {
e.printStackTrace();
}
int remotePort = 80;
int localPort = 80;
byte[] d1 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 8, 0, 69, 0, 0, 52, -99, -87, 64, 0, 64, 6, -27, -25, 10, -27, 77, 114, 74, 125, 20, 95, -90, 2, 1, -69, -108, -18, 20, 87, -4, -110, -105, -88, -128, 16, 6, 88, 51, 24, 0, 0, 1, 1, 8, 10, -1, -1, -87, 50, 101, -15, -111, -73 };
Packet packet01 = new Packet(1, 1418242722L, 324000, 66, d1);
byte[] d2 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 8, 0, 69, 0, 0, 52, 0, 0, 64, 0, 64, 6, -125, -111, 74, 125, 20, 95, 10, -27, 77, 114, 1, -69, -90, 2, 0, 0, 0, 0, -108, -18, 20, 87, -128, 4, 0, 0, 119, -98, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
Packet packet02 = new Packet(1, 1418242722L, 325000, 63, d2);
PacketInfo packetInfo01 = new PacketInfo(packet01);
PacketInfo packetInfo02 = new PacketInfo(packet02);
packetInfo01.setTcpInfo(TcpInfo.TCP_ESTABLISH);
packetInfo01.setTimestamp((double) date.getTime());
packetInfo02.setTcpInfo(TcpInfo.TCP_ACK);
List<PacketInfo> packetlist = new ArrayList<PacketInfo>();
packetlist.add(packetInfo01);
packetlist.add(packetInfo02);
Burst burst01 = new Burst(packetlist);
burst01.setFirstUplinkDataPacket(packetInfo01);
burst01.setBurstInfo(BurstCategory.CLIENT_APP);
burstCollection.add(burst01);
Session session01 = new Session(localIP, remoteIP, remotePort, localPort, "");
session01.setUdpOnly(false);
session01.setTcpPackets(packetlist);
HttpRequestResponseInfo httpRequestResponseInfo01 = new HttpRequestResponseInfo();
httpRequestResponseInfo01.setFirstDataPacket(packetInfo01);
httpRequestResponseInfo01.setDirection(HttpDirection.REQUEST);
httpRequestResponseInfo01.setHostName("yahoo.com");
httpRequestResponseInfo01.setObjName("");
List<HttpRequestResponseInfo> httpRequestResponseInfolist = new ArrayList<HttpRequestResponseInfo>();
httpRequestResponseInfolist.add(httpRequestResponseInfo01);
session01.setRequestResponseInfo(httpRequestResponseInfolist);
List<Session> sessionlist = new ArrayList<Session>();
sessionlist.add(session01);
ProfileLTE profileLTE = new ProfileLTE();
profileLTE.setPeriodMinCycle(10.0);
profileLTE.setPeriodCycleTol(1.0);
profileLTE.setPeriodMinSamples(3);
profileLTE.setCloseSpacedBurstThreshold(0.0);
burstcollectionAnalysisData.setBurstCollection(burstCollection);
tracedata01.setSessionlist(sessionlist);
tracedata01.setBurstCollectionAnalysisData(burstcollectionAnalysisData);
tracedata01.setProfile(profileLTE);
AbstractBestPracticeResult result01 = periodicTransferImpl.runTest(tracedata01);
assertEquals(BPResultType.PASS, result01.getResultType());
}
use of com.att.aro.core.configuration.pojo.ProfileLTE in project VideoOptimzer by attdevsupport.
the class ProfileFactoryImplTest method energyLTE_RRCStateIsLTE_DRX_SHORT.
@Test
public void energyLTE_RRCStateIsLTE_DRX_SHORT() {
ProfileLTE profileLte01 = Mockito.mock(ProfileLTE.class);
List<PacketInfo> packets = new ArrayList<PacketInfo>();
when(profileLte01.getDrxShortPingPeriod()).thenReturn(5.0);
when(profileLte01.getDrxShortPingPower()).thenReturn(1.0);
when(profileLte01.getLteTailPower()).thenReturn(2.0);
when(profileLte01.getDrxPingTime()).thenReturn(1.0);
double testResult = profilefactory.energyLTE(date.getTime() + 0.0, date.getTime() + 1000.0, RRCState.LTE_DRX_SHORT, profileLte01, packets);
assertEquals(1800.0, testResult, 0.0);
}
use of com.att.aro.core.configuration.pojo.ProfileLTE in project VideoOptimzer by attdevsupport.
the class ProfileFactoryImplTest method create_profileTypeIsLTE.
@Test
public void create_profileTypeIsLTE() {
Properties property01 = Mockito.mock(Properties.class);
Mockito.when(property01.getProperty(Profile.CARRIER)).thenReturn("AT&T");
Mockito.when(property01.getProperty(Profile.DEVICE)).thenReturn("Captivate - ad study");
ProfileLTE profileTest = (ProfileLTE) profilefactory.create(ProfileType.LTE, property01);
assertEquals(0.26, profileTest.getPromotionTime(), 0.0);
}
use of com.att.aro.core.configuration.pojo.ProfileLTE in project VideoOptimzer by attdevsupport.
the class ProfileFactoryImplTest method energyLTE_RRCStateIsLTE_PROMOTION.
@Test
public void energyLTE_RRCStateIsLTE_PROMOTION() {
ProfileLTE profileLte06 = Mockito.mock(ProfileLTE.class);
List<PacketInfo> packets = new ArrayList<PacketInfo>();
when(profileLte06.getLtePromotionPower()).thenReturn(3.0);
double testResult = profilefactory.energyLTE(date.getTime() + 0.0, date.getTime() + 1000.0, RRCState.LTE_PROMOTION, profileLte06, packets);
assertEquals(3000.0, testResult, 0.0);
}
use of com.att.aro.core.configuration.pojo.ProfileLTE in project VideoOptimzer by attdevsupport.
the class ProfileFactoryImplTest method saveLTE_ProfileLTE.
@Test
public void saveLTE_ProfileLTE() throws IOException {
OutputStream output = Mockito.mock(OutputStream.class);
ProfileLTE profileLte = Mockito.mock(ProfileLTE.class);
when(profileLte.getCarrier()).thenReturn("AT&T");
when(profileLte.getDevice()).thenReturn("Captivate - ad study");
when(profileLte.getProfileType()).thenReturn(ProfileType.LTE);
when(profileLte.getUserInputTh()).thenReturn(1.0);
when(profileLte.getPowerGpsActive()).thenReturn(1.0);
when(profileLte.getPowerGpsStandby()).thenReturn(0.5);
when(profileLte.getPowerCameraOn()).thenReturn(0.3);
when(profileLte.getPowerBluetoothActive()).thenReturn(1.0);
when(profileLte.getPowerBluetoothStandby()).thenReturn(0.5);
when(profileLte.getPowerScreenOn()).thenReturn(0.3);
when(profileLte.getBurstTh()).thenReturn(1.5);
when(profileLte.getLongBurstTh()).thenReturn(5.0);
when(profileLte.getPeriodMinCycle()).thenReturn(10.0);
when(profileLte.getPeriodCycleTol()).thenReturn(1.0);
when(profileLte.getLargeBurstDuration()).thenReturn(5.0);
when(profileLte.getLargeBurstSize()).thenReturn(100000);
when(profileLte.getCloseSpacedBurstThreshold()).thenReturn(10.0);
when(profileLte.getThroughputWindow()).thenReturn(0.5);
profilefactory.saveLTE(output, profileLte);
}
Aggregations