Groovy动态语言 运行在JVM中的动态语言 可以方便的处理业务逻辑变化大的业务
源代码在线查看: rodsbug.groovy
/**
* @author Rod Cope
* @version $Revision: 2285 $
*/
class RodsBug extends GroovyTestCase {
void testBug() {
doTest(true)
/*
def x = 1
if (x > 0) {
String name = "Rod"
println(name)
}
*/
}
void testBug2() {
def x = 1
if (x > 0) {
//String name = "Rod"
def name = "Rod"
println(name)
}
}
void doTest(flag) {
if (flag) {
String name = "Rod"
//def name = "Rod"
doAssert(name)
}
}
void doTest() {
String name = "Rod"
doAssert(name)
}
void doAssert(text) {
assert text != null
}
}