01: package org.hansel.probes;
02:
03: import org.hansel.Probe;
04: import org.hansel.ProbeData;
05:
06: /**
07: * A probe for an exception handler or finally block
08: * @author Niklas Mehner.
09: */
10: public class ExceptionProbe extends MethodProbe {
11:
12: private Probe methodProbe;
13:
14: /**
15: * Create a new Probe.
16: * @param methodProbe MethodProbe of the method this probe is contained in.
17: * @param pd Data for this probe.
18: */
19: public ExceptionProbe(Probe methodProbe, ProbeData pd) {
20: super (pd);
21: assert methodProbe != null : "Method probe may not be null.";
22: this .methodProbe = methodProbe;
23: }
24:
25: public boolean displayFailure() {
26: return super .displayFailure() && !methodProbe.displayFailure();
27: }
28:
29: public String getFailureMessage() {
30: return "Exception handler or finally block not covered.";
31: }
32: }
|