@Test public void testParentDomainNameUsed_DifferentSubdomains() { pktAnalyzerResult = domainNameTestSetup("157.56.19.80", "216.58.194.196", "www.gstatic.com", "ssl.gstatic.com", "www.arotest.com"); httpsUsageResult = (HttpsUsageResult) httpsUsageImpl.runTest(pktAnalyzerResult); httpsUsageEntries = httpsUsageResult.getResults(); domainNameTestVerification(httpsUsageEntries); }
@Override public AbstractBestPracticeResult runTest(PacketAnalyzerResult tracedata) { totalNumConnectionsCurrentTrace = 0; totalNumHttpConnectionsCurrentTrace = 0; List<Session> sessions = tracedata.getSessionlist(); Map<InetAddress, List<Session>> ipSessionsMap = buildIpSessionsMap(sessions); List<HttpsUsageEntry> httpsUsageEntries = buildHttpsUsageEntry(ipSessionsMap); int httpConnectionsPercentageCurrentTrace = getHttpConnectionsPercentage(totalNumHttpConnectionsCurrentTrace, totalNumConnectionsCurrentTrace); HttpsUsageResult result = new HttpsUsageResult(); String testResultText = ""; if (passTest()) { result.setResultType(BPResultType.PASS); testResultText = MessageFormat.format(testResultPassText, ApplicationConfig.getInstance().getAppShortName(), totalNumHttpConnectionsCurrentTrace); } else if (failTest(httpsUsageEntries, httpConnectionsPercentageCurrentTrace)) { result.setResultType(BPResultType.FAIL); testResultText = MessageFormat.format(testResultAnyText, ApplicationConfig.getInstance().getAppShortName(), totalNumHttpConnectionsCurrentTrace, httpConnectionsPercentageCurrentTrace); } else { result.setResultType(BPResultType.WARNING); testResultText = MessageFormat.format(testResultAnyText, ApplicationConfig.getInstance().getAppShortName(), totalNumHttpConnectionsCurrentTrace, httpConnectionsPercentageCurrentTrace); } result.setOverviewTitle(overviewTitle); result.setDetailTitle(detailedTitle); result.setLearnMoreUrl(learnMoreUrl); result.setAboutText(aboutText); result.setResults(httpsUsageEntries); result.setResultText(testResultText); result.setExportAll(exportAll); return result; }
HttpsUsageImpl implements IBestPractice { @Override public AbstractBestPracticeResult runTest(PacketAnalyzerResult tracedata) { totalNumConnectionsCurrentTrace = 0; totalNumHttpConnectionsCurrentTrace = 0; List<Session> sessions = tracedata.getSessionlist(); Map<InetAddress, List<Session>> ipSessionsMap = buildIpSessionsMap(sessions); List<HttpsUsageEntry> httpsUsageEntries = buildHttpsUsageEntry(ipSessionsMap); int httpConnectionsPercentageCurrentTrace = getHttpConnectionsPercentage(totalNumHttpConnectionsCurrentTrace, totalNumConnectionsCurrentTrace); HttpsUsageResult result = new HttpsUsageResult(); String testResultText = ""; if (passTest()) { result.setResultType(BPResultType.PASS); testResultText = MessageFormat.format(testResultPassText, ApplicationConfig.getInstance().getAppShortName(), totalNumHttpConnectionsCurrentTrace); } else if (failTest(httpsUsageEntries, httpConnectionsPercentageCurrentTrace)) { result.setResultType(BPResultType.FAIL); testResultText = MessageFormat.format(testResultAnyText, ApplicationConfig.getInstance().getAppShortName(), totalNumHttpConnectionsCurrentTrace, httpConnectionsPercentageCurrentTrace); } else { result.setResultType(BPResultType.WARNING); testResultText = MessageFormat.format(testResultAnyText, ApplicationConfig.getInstance().getAppShortName(), totalNumHttpConnectionsCurrentTrace, httpConnectionsPercentageCurrentTrace); } result.setOverviewTitle(overviewTitle); result.setDetailTitle(detailedTitle); result.setLearnMoreUrl(learnMoreUrl); result.setAboutText(aboutText); result.setResults(httpsUsageEntries); result.setResultText(testResultText); result.setExportAll(exportAll); return result; } }
HttpsUsageImpl implements IBestPractice { @Override public AbstractBestPracticeResult runTest(PacketAnalyzerResult tracedata) { totalNumConnectionsCurrentTrace = 0; totalNumHttpConnectionsCurrentTrace = 0; List<Session> sessions = tracedata.getSessionlist(); Map<InetAddress, List<Session>> ipSessionsMap = buildIpSessionsMap(sessions); List<HttpsUsageEntry> httpsUsageEntries = buildHttpsUsageEntry(ipSessionsMap); int httpConnectionsPercentageCurrentTrace = getHttpConnectionsPercentage(totalNumHttpConnectionsCurrentTrace, totalNumConnectionsCurrentTrace); HttpsUsageResult result = new HttpsUsageResult(); String testResultText = ""; if (passTest()) { result.setResultType(BPResultType.PASS); testResultText = MessageFormat.format(testResultPassText, ApplicationConfig.getInstance().getAppShortName(), totalNumHttpConnectionsCurrentTrace); } else if (failTest(httpsUsageEntries, httpConnectionsPercentageCurrentTrace)) { result.setResultType(BPResultType.FAIL); testResultText = MessageFormat.format(testResultAnyText, ApplicationConfig.getInstance().getAppShortName(), totalNumHttpConnectionsCurrentTrace, httpConnectionsPercentageCurrentTrace); } else { result.setResultType(BPResultType.WARNING); testResultText = MessageFormat.format(testResultAnyText, ApplicationConfig.getInstance().getAppShortName(), totalNumHttpConnectionsCurrentTrace, httpConnectionsPercentageCurrentTrace); } result.setOverviewTitle(overviewTitle); result.setDetailTitle(detailedTitle); result.setLearnMoreUrl(learnMoreUrl); result.setAboutText(aboutText); result.setResults(httpsUsageEntries); result.setResultText(testResultText); result.setExportAll(exportAll); return result; }  }
HttpsUsageImpl implements IBestPractice { @Override public AbstractBestPracticeResult runTest(PacketAnalyzerResult tracedata) { totalNumConnectionsCurrentTrace = 0; totalNumHttpConnectionsCurrentTrace = 0; List<Session> sessions = tracedata.getSessionlist(); Map<InetAddress, List<Session>> ipSessionsMap = buildIpSessionsMap(sessions); List<HttpsUsageEntry> httpsUsageEntries = buildHttpsUsageEntry(ipSessionsMap); int httpConnectionsPercentageCurrentTrace = getHttpConnectionsPercentage(totalNumHttpConnectionsCurrentTrace, totalNumConnectionsCurrentTrace); HttpsUsageResult result = new HttpsUsageResult(); String testResultText = ""; if (passTest()) { result.setResultType(BPResultType.PASS); testResultText = MessageFormat.format(testResultPassText, ApplicationConfig.getInstance().getAppShortName(), totalNumHttpConnectionsCurrentTrace); } else if (failTest(httpsUsageEntries, httpConnectionsPercentageCurrentTrace)) { result.setResultType(BPResultType.FAIL); testResultText = MessageFormat.format(testResultAnyText, ApplicationConfig.getInstance().getAppShortName(), totalNumHttpConnectionsCurrentTrace, httpConnectionsPercentageCurrentTrace); } else { result.setResultType(BPResultType.WARNING); testResultText = MessageFormat.format(testResultAnyText, ApplicationConfig.getInstance().getAppShortName(), totalNumHttpConnectionsCurrentTrace, httpConnectionsPercentageCurrentTrace); } result.setOverviewTitle(overviewTitle); result.setDetailTitle(detailedTitle); result.setLearnMoreUrl(learnMoreUrl); result.setAboutText(aboutText); result.setResults(httpsUsageEntries); result.setResultText(testResultText); result.setExportAll(exportAll); return result; }  @Override AbstractBestPracticeResult runTest(PacketAnalyzerResult tracedata); }
HttpsUsageImpl implements IBestPractice { @Override public AbstractBestPracticeResult runTest(PacketAnalyzerResult tracedata) { totalNumConnectionsCurrentTrace = 0; totalNumHttpConnectionsCurrentTrace = 0; List<Session> sessions = tracedata.getSessionlist(); Map<InetAddress, List<Session>> ipSessionsMap = buildIpSessionsMap(sessions); List<HttpsUsageEntry> httpsUsageEntries = buildHttpsUsageEntry(ipSessionsMap); int httpConnectionsPercentageCurrentTrace = getHttpConnectionsPercentage(totalNumHttpConnectionsCurrentTrace, totalNumConnectionsCurrentTrace); HttpsUsageResult result = new HttpsUsageResult(); String testResultText = ""; if (passTest()) { result.setResultType(BPResultType.PASS); testResultText = MessageFormat.format(testResultPassText, ApplicationConfig.getInstance().getAppShortName(), totalNumHttpConnectionsCurrentTrace); } else if (failTest(httpsUsageEntries, httpConnectionsPercentageCurrentTrace)) { result.setResultType(BPResultType.FAIL); testResultText = MessageFormat.format(testResultAnyText, ApplicationConfig.getInstance().getAppShortName(), totalNumHttpConnectionsCurrentTrace, httpConnectionsPercentageCurrentTrace); } else { result.setResultType(BPResultType.WARNING); testResultText = MessageFormat.format(testResultAnyText, ApplicationConfig.getInstance().getAppShortName(), totalNumHttpConnectionsCurrentTrace, httpConnectionsPercentageCurrentTrace); } result.setOverviewTitle(overviewTitle); result.setDetailTitle(detailedTitle); result.setLearnMoreUrl(learnMoreUrl); result.setAboutText(aboutText); result.setResults(httpsUsageEntries); result.setResultText(testResultText); result.setExportAll(exportAll); return result; }  @Override AbstractBestPracticeResult runTest(PacketAnalyzerResult tracedata);  }