home | career | drupal | java | mac | mysql | perl | scala | uml | unix

Groovy example source code file (PropertyExpressionTest.groovy)

This example Groovy source code file (PropertyExpressionTest.groovy) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Groovy tags/keywords

groovytestcase, groovytestcase, propertyexpression, propertyexpression, propertyexpressiontest, propertyexpressiontest, variableexpression, variableexpression

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:

new blog posts


Copyright 1998-2014 Alvin Alexander, alvinalexander.com
All Rights Reserved.