assertEndPointAnalysis(op, 3777347);
}
}
private EndPointAnalysis assertEndPointAnalysis(Operation op, int depth) {
EndPointAnalysis analysis = analyzer.makeEndPoint(createMockOperationWrapperFrame(op), depth);
assertNotNull("No analysis", analysis);
assertSame("Mismatched source operation", op, analysis.getSourceOperation());
NamedPropertySource props = JmxInvocationEndPointAnalyzer.toPropertySource(op);
EndPointName name = analysis.getEndPointName();
assertEquals("Mismatched endpoint",
PropertiesUtil.format(analyzer.getSettingFormat(JmxInvocationEndPointAnalyzer.ENDPOINT_FORMAT), props),
name.getName());
assertEquals("Mismatched label",
PropertiesUtil.format(analyzer.getSettingFormat(JmxInvocationEndPointAnalyzer.LABEL_FORMAT), props),
analysis.getResourceLabel());
assertEquals("Mismatched example",
PropertiesUtil.format(analyzer.getSettingFormat(JmxInvocationEndPointAnalyzer.EXAMPLE_FORMAT), props),
analysis.getExample());
String scoreType = analyzer.getSettingFormat(JmxInvocationEndPointAnalyzer.SCORE_VALUE);
Number expScore = JmxInvocationEndPointAnalyzer.DEFAULT_SCORE_FORMAT.equals(scoreType)
? Integer.valueOf(EndPointAnalysis.depth2score(depth))
: JmxInvocationEndPointAnalyzer.resolveOperationScore(op, scoreType);
assertNotNull("Cannot resolve score for mode=" + scoreType, expScore);
assertEquals("Mismatched score", expScore.intValue(), analysis.getScore());
return analysis;
}