|
Groovy example source code file (LocalVariableTest.groovy)
The Groovy LocalVariableTest.groovy source code
package groovy
class LocalVariableTest extends GroovyTestCase {
void testAssert() {
def x = "abc"
assert x != "foo"
assert x != null
assert x != "def"
assert x == "abc"
assert x.equals("abc")
}
void testUnknownVariable() {
shouldFail {
def shell = new GroovyShell()
shell.evaluate """
def y = x
"""
}
}
}
Other Groovy examples (source code examples)Here is a short list of links related to this Groovy LocalVariableTest.groovy source code file: |
Other websites by Alvin Alexander:
Life/living in Alaska (OneMansAlaska.com)
How I Sold My Business (HowISoldMyBusiness.com)
Copyright 1998-2011 Alvin Alexander, devdaily.com
All Rights Reserved.