|
Groovy example source code file (UnsafeNavigationTest.groovy)
The Groovy UnsafeNavigationTest.groovy source code
package groovy
class UnsafeNavigationTest extends GroovyTestCase {
void testUnsafePropertyNavigations() {
def x = null
try {
def y = x.foo
fail("should fail")
}
catch (NullPointerException e) {
assert e != null
}
}
}
Other Groovy examples (source code examples)Here is a short list of links related to this Groovy UnsafeNavigationTest.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.