|
Groovy example source code file (PropertyExpressionTest.groovy)
The Groovy PropertyExpressionTest.groovy source code
package org.codehaus.groovy.ast.expr
/**
*
* @author Hamlet D'Arcy
*/
class PropertyExpressionTest extends GroovyTestCase {
void testGetText() {
PropertyExpression property = new PropertyExpression(new VariableExpression('foo'), 'bar')
assert 'foo.bar' == property.text
property.safe = true
property.spreadSafe = false
assert 'foo?.bar' == property.text
property.safe = false
property.spreadSafe = true
assert 'foo*.bar' == property.text
property.safe = true
property.spreadSafe = true
assert 'foo*?.bar' == property.text
}
}
Other Groovy examples (source code examples)Here is a short list of links related to this Groovy PropertyExpressionTest.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.