Package org.apache.solr.common.util
Class CommonTestInjection.BreakpointSetter
java.lang.Object
org.apache.solr.common.util.CommonTestInjection.BreakpointSetter
- All Implemented Interfaces:
Closeable,AutoCloseable
- Enclosing class:
CommonTestInjection
Breakpoints should be set via this
CommonTestInjection.BreakpointSetter within the test case and close
should be invoked as cleanup. Since this is closeable, it should usually be used in the
try-with-resource syntax, such as:
try (BreakpointSetter breakpointSetter = new BreakpointSetter() {
//... test code here that calls breakpointSetter.setImplementation(...)
}
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidsetImplementation(String key, CommonTestInjection.Breakpoint implementation) This is usually set by the test cases.
-
Constructor Details
-
BreakpointSetter
public BreakpointSetter()
-
-
Method Details
-
setImplementation
This is usually set by the test cases.If a breakpoint implementation is set by this method, then code execution would break at the code execution point marked by CommonTestInjection#injectBreakpoint with matching key, executes the provided implementation in the
CommonTestInjection.Breakpoint, then resumes the normal code execution.- Parameters:
key- could simply be the fully qualified class name or more granular like class name + other id (such as method name). This should batch the key used in injectBreakpointimplementation- The Breakpoint implementation- See Also:
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-