use of com.sun.appserv.management.ext.coverage.CoverageInfo in project Payara by payara.
the class CoverageInfoAnalyzer method getCoverage.
public Map<String, CoverageInfo> getCoverage(final Set<AMX> candidates) {
final Map<String, CoverageInfo> coverageMap = new HashMap<String, CoverageInfo>();
for (final AMX amx : candidates) {
final AMXDebugStuff debug = mTestUtil.asAMXDebugStuff(amx);
final CoverageInfo coverageInfo = debug.getCoverageInfo();
assert (coverageInfo != null);
handleSpecialCases(coverageInfo);
final String j2eeType = amx.getJ2EEType();
final CoverageInfo existing = coverageMap.get(j2eeType);
if (existing != null) {
existing.merge(coverageInfo);
} else {
coverageMap.put(j2eeType, coverageInfo);
}
}
return coverageMap;
}
use of com.sun.appserv.management.ext.coverage.CoverageInfo in project Payara by payara.
the class CoverageInfoAnalyzer method getCoverageSummary.
public String getCoverageSummary() {
final Set<AMX> amx = mTestUtil.getAllAMX();
final Map<String, CoverageInfo> coverage = getCoverage(amx);
final String[] j2eeTypes = GSetUtil.toStringArray(coverage.keySet());
Arrays.sort(j2eeTypes);
final String LINE_SEP = System.getProperty("line.separator");
final StringBuilder builder = new StringBuilder();
for (final String j2eeType : j2eeTypes) {
final CoverageInfo info = coverage.get(j2eeType);
final String infoString = "Coverage for j2eeType = " + j2eeType + ": " + (info.getFullCoverage() ? "100%" : "INCOMPLETE COVERAGE") + LINE_SEP + info.toString(false) + LINE_SEP + LINE_SEP;
builder.append(infoString);
}
final String msg = "No AMX MBeans having the following types " + "were ever present, and so were NEVER TESTED:" + NEWLINE;
builder.append(createMissingString(msg));
return builder.toString();
}
Aggregations