use of com.att.aro.core.bestpractice.pojo.DisplayNoneInCSSEntry in project VideoOptimzer by attdevsupport.
the class DisplayNoneInCSSImpl method runTest.
@Override
public AbstractBestPracticeResult runTest(PacketAnalyzerResult tracedata) {
DisplayNoneInCSSResult result = new DisplayNoneInCSSResult();
List<DisplayNoneInCSSEntry> results = new ArrayList<DisplayNoneInCSSEntry>();
for (Session session : tracedata.getSessionlist()) {
for (HttpRequestResponseInfo reqinfo : session.getRequestResponseInfo()) {
Document doc = null;
String css;
if ((reqinfo.getDirection() == HttpDirection.RESPONSE) && (reqinfo.getContentType() != null) && (reqinfo.getContentType().equalsIgnoreCase("text/html"))) {
doc = getParsedHtml(reqinfo, session);
if (doc != null && checkIfDisplayNoneIsPresentInCSSembeddedInHTML(doc)) {
results.add(new DisplayNoneInCSSEntry(reqinfo));
}
} else if (reqinfo.getDirection() == HttpDirection.RESPONSE && reqinfo.getContentType() != null && reqinfo.getContentType().equalsIgnoreCase("text/css")) {
css = getCSS(reqinfo, session);
if (css != null && checkIfDisplayNoneIsPresentInCSS(css)) {
results.add(new DisplayNoneInCSSEntry(reqinfo));
}
}
}
}
int numOfCSSFiles = results.size();
String text = "";
if (results.isEmpty()) {
result.setResultType(BPResultType.PASS);
text = MessageFormat.format(textResultPass, ApplicationConfig.getInstance().getAppShortName(), numOfCSSFiles);
} else {
result.setResultType(BPResultType.FAIL);
text = MessageFormat.format(textResults, ApplicationConfig.getInstance().getAppShortName(), numOfCSSFiles);
}
result.setResultExcelText(MessageFormat.format(textExcelResults, result.getResultType().getDescription(), numOfCSSFiles));
result.setResultText(text);
result.setResults(results);
result.setAboutText(aboutText);
result.setDetailTitle(detailTitle);
result.setLearnMoreUrl(learnMoreUrl);
result.setOverviewTitle(overviewTitle);
result.setExportAll(exportAll);
return result;
}
use of com.att.aro.core.bestpractice.pojo.DisplayNoneInCSSEntry in project VideoOptimzer by attdevsupport.
the class ARODiagnosticsOverviewRouteImpl method updateDiagnosticsTab.
@Override
public void updateDiagnosticsTab(Object routeInfo) {
int oldPanelIndex = jtabbedPane.getSelectedIndex();
jtabbedPane.setSelectedIndex(DIAGNOSTIC_INDEX);
DiagnosticsTab diagnosticsTab = (DiagnosticsTab) jtabbedPane.getSelectedComponent();
if (routeInfo == null) {
jtabbedPane.setSelectedIndex(oldPanelIndex);
LOG.error("Diagnostics Tab needs a type for updating");
return;
}
LOG.debug("Type used to route to Diagnostics Tab: " + routeInfo.getClass().getSimpleName());
if (routeInfo instanceof CacheEntry) {
diagnosticsTab.setHighlightedTCP(((CacheEntry) routeInfo).getHttpRequestResponse());
} else if (routeInfo instanceof Session) {
diagnosticsTab.setHighlightedTCP(((Session) routeInfo));
} else if (routeInfo instanceof HttpRequestResponseInfo) {
diagnosticsTab.setHighlightedTCP((HttpRequestResponseInfo) routeInfo);
} else if (routeInfo instanceof HttpEntry) {
diagnosticsTab.setHighlightedTCP(((HttpEntry) routeInfo).getHttpRequestResponse());
} else if (routeInfo instanceof DisplayNoneInCSSEntry) {
diagnosticsTab.setHighlightedTCP(((DisplayNoneInCSSEntry) routeInfo).getHttpRequestResponse());
} else if (routeInfo instanceof ImageMdataEntry) {
diagnosticsTab.setHighlightedTCP(((ImageMdataEntry) routeInfo).getHttpRequestResponse());
} else if (routeInfo instanceof ImageCompressionEntry) {
diagnosticsTab.setHighlightedTCP(((ImageCompressionEntry) routeInfo).getHttpRequestResponse());
} else if (routeInfo instanceof MultipleConnectionsEntry) {
if (((MultipleConnectionsEntry) routeInfo).isMultiple()) {
jtabbedPane.setSelectedIndex(WATERFALL_INDEX);
WaterfallTab waterfallTab = (WaterfallTab) jtabbedPane.getSelectedComponent();
waterfallTab.updateGraph(((MultipleConnectionsEntry) routeInfo).getHttpReqRespInfo());
} else {
if (((MultipleConnectionsEntry) routeInfo).getHttpReqRespInfo().getSession() != null) {
diagnosticsTab.setHighlightedSessionTCP(((MultipleConnectionsEntry) routeInfo).getHttpReqRespInfo());
} else {
diagnosticsTab.setHighlightedTCP(((MultipleConnectionsEntry) routeInfo).getHttpReqRespInfo());
}
}
} else if (routeInfo instanceof SpriteImageEntry) {
diagnosticsTab.setHighlightedTCP(((SpriteImageEntry) routeInfo).getHttpRequestResponse());
} else if (routeInfo instanceof UnnecessaryConnectionEntry) {
UnnecessaryConnectionEntry unConnectionEntry = (UnnecessaryConnectionEntry) routeInfo;
diagnosticsTab.setHighlightedTCP(unConnectionEntry.getLowTime());
} else if (routeInfo instanceof TransmissionPrivateDataEntry || routeInfo instanceof UnsecureSSLVersionEntry || routeInfo instanceof ForwardSecrecyEntry) {
diagnosticsTab.setHighlightedTCP(routeInfo);
} else if (routeInfo instanceof VideoStall) {
double timestamp = ((VideoStall) routeInfo).getSegmentTryingToPlay().getStartTS();
diagnosticsTab.getGraphPanel().setGraphView(timestamp, true);
diagnosticsTab.getVideoPlayer().setMediaTime(timestamp);
} else {
jtabbedPane.setSelectedIndex(oldPanelIndex);
LOG.error("Diagnostics Tab cannot handle a type of " + routeInfo.getClass().getSimpleName() + " for updating");
}
}
use of com.att.aro.core.bestpractice.pojo.DisplayNoneInCSSEntry in project VideoOptimzer by attdevsupport.
the class BpHtmlDisplayNoneInCSSTablePanel method getContentTable.
/**
* Initializes and returns the RequestResponseTable.
*/
@SuppressWarnings("unchecked")
public DataTable<DisplayNoneInCSSEntry> getContentTable() {
if (contentTable == null) {
contentTable = new DataTable<DisplayNoneInCSSEntry>(tableModel);
contentTable.setName(ResourceBundleHelper.getMessageString("html.display.none.tableName"));
contentTable.setAutoCreateRowSorter(true);
contentTable.setGridColor(Color.LIGHT_GRAY);
contentTable.setRowHeight(ROW_HEIGHT);
contentTable.setAutoResizeMode(JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS);
DataTablePopupMenu popupMenu = (DataTablePopupMenu) contentTable.getPopup();
popupMenu.initialize();
}
return contentTable;
}
Aggregations