Class MockOutputTool
java.lang.Object
org.codehaus.groovy.tools.groovydoc.MockOutputTool
- All Implemented Interfaces:
OutputTool
In-memory
OutputTool used by tests. Nothing is written to disk
by default, so test runs leave no filesystem artifacts.
Debugging: pass the groovydoc.mockOutputTool.dumpDir
system property to also mirror every output call to that directory.
Example (from the groovy-groovydoc module):
./gradlew :groovy-groovydoc:test -Dgroovydoc.mockOutputTool.dumpDir=build/mock-dumpWhen the property is unset, all calls are captured only in the in-memory
output and outputAreas maps; inspect them via
getText(String) or via a debugger breakpoint.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcopyResource(String srcPath, String dstPath) Copy a resource file (doc-files/, snippet-files/ content) fromsrcPathtodstPath.booleanisValidOutputArea(String fileName) voidmakeOutputArea(String filename) toString()voidwriteToOutput(String fileName, String text, String charset)
-
Constructor Details
-
MockOutputTool
public MockOutputTool()
-
-
Method Details
-
makeOutputArea
- Specified by:
makeOutputAreain interfaceOutputTool
-
writeToOutput
- Specified by:
writeToOutputin interfaceOutputTool- Throws:
Exception
-
copyResource
Description copied from interface:OutputToolCopy a resource file (doc-files/, snippet-files/ content) fromsrcPathtodstPath. Routed through the tool rather than callingFiles.copydirectly so that alternative tools (notablyMockOutputTool) can intercept the side-effect.- Specified by:
copyResourcein interfaceOutputTool- Throws:
IOException
-
isValidOutputArea
-
getText
-
toString
-