use of com.att.aro.core.packetanalysis.pojo.Session in project VideoOptimzer by attdevsupport.
the class DisplayNoneInCSSImplTest method runTest_ResultIsPass.
@Test
public void runTest_ResultIsPass() {
Mockito.when(httpRequestInfo06.getDirection()).thenReturn(HttpDirection.RESPONSE);
Mockito.when(httpRequestInfo06.getContentType()).thenReturn("text/html");
Mockito.when(httpRequestInfo06.getContentLength()).thenReturn(1);
Mockito.when(httpRequestInfo06.getAssocReqResp()).thenReturn(httpRequestInfo01);
Mockito.when(httpRequestInfo06.getObjName()).thenReturn(htmlString);
displayNoneInCSSImpl.setHttpRequestResponseHelper(reqhelper);
try {
Mockito.when(reqhelper.getContentString(any(HttpRequestResponseInfo.class), any(Session.class))).thenReturn(htmlString2);
} catch (Exception e) {
e.printStackTrace();
}
List<HttpRequestResponseInfo> value = new ArrayList<HttpRequestResponseInfo>();
value.add(httpRequestInfo06);
Mockito.when(session03.getRequestResponseInfo()).thenReturn(value);
List<Session> sessionList = new ArrayList<Session>();
Mockito.when(session03.getDomainName()).thenReturn("www.google.com");
sessionList.add(session03);
Mockito.when(tracedata.getSessionlist()).thenReturn(sessionList);
AbstractBestPracticeResult testResult = displayNoneInCSSImpl.runTest(tracedata);
assertEquals(BPResultType.PASS, testResult.getResultType());
}
use of com.att.aro.core.packetanalysis.pojo.Session in project VideoOptimzer by attdevsupport.
the class DomainsTCPSessions method extractDomainTcpSessions.
/**
* @param sessions
* @return
*/
public static Collection<DomainsTCPSessions> extractDomainTcpSessions(Collection<Session> sessions) {
if (sessions == null || sessions.size() <= 0) {
return Collections.emptyList();
}
Map<String, ArrayList<Session>> distinctMap = new HashMap<String, ArrayList<Session>>();
for (Session tcpSession : sessions) {
if (tcpSession != null) {
if (!tcpSession.isUdpOnly()) {
String domainName = tcpSession.getDomainName();
ArrayList<Session> tempList = distinctMap.get(domainName);
if (tempList == null) {
tempList = new ArrayList<Session>();
distinctMap.put(domainName, tempList);
}
tempList.add(tcpSession);
}
}
}
List<DomainsTCPSessions> result = new ArrayList<DomainsTCPSessions>();
for (Map.Entry<String, ArrayList<Session>> entry : distinctMap.entrySet()) {
ArrayList<Session> tempList = entry.getValue();
tempList.trimToSize();
result.add(new DomainsTCPSessions(entry.getKey(), tempList));
}
return result;
}
use of com.att.aro.core.packetanalysis.pojo.Session in project VideoOptimzer by attdevsupport.
the class TCPUDPFlowsTableModel method refresh.
public void refresh(AROTraceData aroTraceData, Font font) {
this.font = font;
maxDomainColWidth = 0;
maxRemoteIpColWidth = 0;
maxByteCountColWidth = 0;
List<Session> sessionlist = aroTraceData.getAnalyzerResult().getSessionlist();
setData(sessionlist);
getCheckboxMap().clear();
for (Session session : sessionlist) {
String sessionKey = getSessionKey(session);
sessionMap.put(sessionKey, session);
checkboxMap.put(sessionKey, new Boolean(true));
}
}
use of com.att.aro.core.packetanalysis.pojo.Session in project VideoOptimzer by attdevsupport.
the class LatencyPlot method populate.
@Override
public void populate(XYPlot plot, AROTraceData analysis) {
series = new XYSeries(0);
if (analysis != null) {
List<Session> sessionList = analysis.getAnalyzerResult().getSessionlist();
List<Session> tooltipList = new ArrayList<Session>(sessionList.size());
if (sessionList.size() > 0) {
for (Session session : sessionList) {
if (session.getLatency() >= 0) {
series.add(session.getSessionStartTime(), session.getLatency());
tooltipList.add(session);
}
}
} else {
return;
}
plot.setDataset(new XYSeriesCollection(series));
plot.getRenderer().setBaseToolTipGenerator(new XYToolTipGenerator() {
@Override
public String generateToolTip(XYDataset dataset, int series, int item) {
return item < tooltipList.size() ? getToolTip(tooltipList.get(item)) : "";
}
private String getToolTip(Session session) {
StringBuffer tooltipValue = new StringBuffer();
tooltipValue.append(String.format("%.3f,%s,%.3f,%.3f", session.getSessionStartTime(), Util.formatDoubleToMicro(session.getLatency()), session.getSynTime(), session.getSynAckTime()));
String[] value = tooltipValue.toString().split(",");
return (MessageFormat.format(ResourceBundleHelper.getDefaultBundle().getString("latency.tooltip"), value[0], value[1], value[2], value[3]));
}
});
}
}
use of com.att.aro.core.packetanalysis.pojo.Session in project VideoOptimzer by attdevsupport.
the class DLPacketPlot method addSeries.
private void addSeries(Session session, LinkedHashMap<Color, PacketSeries> dlDatasets, AnalysisFilter filter) {
Session thisSession = session;
for (PacketInfo packet : session.getAllPackets()) {
if (packet.getDir() == null) {
continue;
}
if (isDownloadPacket() && packet.getDir() == PacketDirection.DOWNLINK) {
// Add the packet to the proper series based on color
Color color = filter.getPacketColor(packet);
PacketSeries series = dlDatasets.get(color);
if (series == null) {
series = new PacketSeries(color);
dlDatasets.put(color, series);
}
series.add(new PacketDataItem(thisSession, packet));
} else if (!isDownloadPacket() && packet.getDir() == PacketDirection.UPLINK) {
// Add the packet to the proper series based on color
Color color = filter.getPacketColor(packet);
PacketSeries series = dlDatasets.get(color);
if (series == null) {
series = new PacketSeries(color);
dlDatasets.put(color, series);
}
series.add(new PacketDataItem(thisSession, packet));
} else {
continue;
}
}
}
Aggregations