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
public static class CommonTestInjection.BreakpointSetter extends Object implements Closeable
Breakpoints should be set via thisCommonTestInjection.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 Constructor Description BreakpointSetter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
setImplementation(String key, CommonTestInjection.Breakpoint implementation)
This is usually set by the test cases.
-
-
-
Method Detail
-
setImplementation
public void setImplementation(String key, CommonTestInjection.Breakpoint implementation)
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:
CommonTestInjection.injectBreakpoint(String, Object...)
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
-