|
Groovy example source code file (GroovyLogTestCaseTest.groovy)
The Groovy GroovyLogTestCaseTest.groovy source code
package groovy.lang
import java.util.logging.Level
import java.util.logging.Logger
/**
Showing usage of the GroovyLogTestCase
@author Dierk Koenig
**/
class GroovyLogTestCaseTest extends GroovyLogTestCase {
static final LOG = Logger.getLogger('groovy.lang.GroovyLogTestCaseTest')
void loggedMethod() {
LOG.finer 'some log entry'
}
void testStringLog(){
def result = stringLog(Level.FINER, 'groovy.lang.GroovyLogTestCaseTest') {
loggedMethod()
}
assertTrue result, result.contains('some log entry')
}
void testCombinedUsageForMetaClass(){
/*
def result = withLevel(Level.FINER, 'groovy.lang.MetaClass') {
stringLog(Level.FINER, 'methodCalls'){
'hi'.toString()
}
}
assertTrue result, result.contains('java.lang.String toString()')
*/
}
}
Other Groovy examples (source code examples)Here is a short list of links related to this Groovy GroovyLogTestCaseTest.groovy source code file: |
| ... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.