Search in sources :

Example 1 with FileOrderEntry

use of com.att.aro.core.bestpractice.pojo.FileOrderEntry in project VideoOptimzer by attdevsupport.

the class FileOrderImpl method runTest.

@Override
public AbstractBestPracticeResult runTest(PacketAnalyzerResult tracedata) {
    FileOrderResult result = new FileOrderResult();
    List<FileOrderEntry> results = new ArrayList<FileOrderEntry>();
    for (Session session : tracedata.getSessionlist()) {
        HttpRequestResponseInfo lastRequestObj = null;
        for (HttpRequestResponseInfo req : session.getRequestResponseInfo()) {
            Document doc = null;
            if (req.getDirection() == HttpDirection.RESPONSE) {
                doc = parseHtml(req, session);
            } else if (req.getDirection() == HttpDirection.REQUEST) {
                lastRequestObj = req;
            }
            if (doc != null && checkFileOrderAnalysisResults(doc, result)) {
                results.add(new FileOrderEntry(req, lastRequestObj, session.getDomainName()));
            }
        }
    }
    String text = "";
    if (results.isEmpty()) {
        result.setResultType(BPResultType.PASS);
        text = MessageFormat.format(textResultPass, ApplicationConfig.getInstance().getAppShortName(), results.size());
        result.setResultExcelText(BPResultType.PASS.getDescription());
    } else {
        result.setResultType(BPResultType.FAIL);
        if (results.size() > 1) {
            text = MessageFormat.format(textResults, ApplicationConfig.getInstance().getAppShortName(), results.size());
        } else {
            text = MessageFormat.format(textResult, ApplicationConfig.getInstance().getAppShortName(), results.size());
        }
        result.setResultExcelText(MessageFormat.format(textExcelResults, BPResultType.FAIL.getDescription(), results.size()));
    }
    result.setResultText(text);
    result.setResults(results);
    result.setAboutText(aboutText);
    result.setDetailTitle(detailTitle);
    result.setLearnMoreUrl(learnMoreUrl);
    result.setOverviewTitle(overviewTitle);
    result.setTextResult(textResult);
    result.setExportAll(exportAll);
    return result;
}
Also used : FileOrderEntry(com.att.aro.core.bestpractice.pojo.FileOrderEntry) HttpRequestResponseInfo(com.att.aro.core.packetanalysis.pojo.HttpRequestResponseInfo) ArrayList(java.util.ArrayList) FileOrderResult(com.att.aro.core.bestpractice.pojo.FileOrderResult) Document(org.jsoup.nodes.Document) Session(com.att.aro.core.packetanalysis.pojo.Session)

Example 2 with FileOrderEntry

use of com.att.aro.core.bestpractice.pojo.FileOrderEntry in project VideoOptimzer by attdevsupport.

the class BpHtmlFileOrderTablePanel method getContentTable.

/**
 * Initializes and returns the RequestResponseTable.
 */
@SuppressWarnings("unchecked")
public DataTable<FileOrderEntry> getContentTable() {
    if (contentTable == null) {
        contentTable = new DataTable<FileOrderEntry>(tableModel);
        contentTable.setName(ResourceBundleHelper.getMessageString("html.file.order.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;
}
Also used : FileOrderEntry(com.att.aro.core.bestpractice.pojo.FileOrderEntry) DataTablePopupMenu(com.att.aro.ui.model.DataTablePopupMenu)

Aggregations

FileOrderEntry (com.att.aro.core.bestpractice.pojo.FileOrderEntry)2 FileOrderResult (com.att.aro.core.bestpractice.pojo.FileOrderResult)1 HttpRequestResponseInfo (com.att.aro.core.packetanalysis.pojo.HttpRequestResponseInfo)1 Session (com.att.aro.core.packetanalysis.pojo.Session)1 DataTablePopupMenu (com.att.aro.ui.model.DataTablePopupMenu)1 ArrayList (java.util.ArrayList)1 Document (org.jsoup.nodes.Document)1