|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object junit.framework.TestCase groovy.util.GroovyTestCase groovy.lang.GroovyLogTestCase
class GroovyLogTestCase extends GroovyTestCase
Helper class to spoof log entries as produced by calling arbitrary code. This allows non-intrusive testing of dependent objects without explicitly using Mock objects as long as those dependent objects do some proper logging. As a measure of last resort, it can be used on MetaClass to spoof it's log entries on 'invokeMethod'.
Field Summary |
---|
Fields inherited from class GroovyTestCase | |
---|---|
TEST_SCRIPT_NAME_PREFIX, log |
Method Summary | |
---|---|
static java.lang.String
|
stringLog(java.util.logging.Level level, java.lang.String qualifier, Closure yield)
Execute the given Closure with the according level for the Logger that is qualified by the qualifier and return the log output as a String. |
static java.lang.Object
|
withLevel(java.util.logging.Level level, java.lang.String qualifier, Closure yield)
Execute the given Closure with the according level for the Logger that is qualified by the qualifier. |
Method Detail |
---|
static java.lang.String stringLog(java.util.logging.Level level, java.lang.String qualifier, Closure yield)
static java.lang.Object withLevel(java.util.logging.Level level, java.lang.String qualifier, Closure yield)
Groovy Documentation