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

Groovy example source code file (PropertyNameBug.groovy)

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

Java - Groovy tags/keywords

any, any, character, character, foobar, foobar-bar, foobar-bar, groovytestcase, hashmap, map, propertynamebug, specical, test, test

The Groovy PropertyNameBug.groovy source code

package groovy.bugs

 * Test to fix the issue GROOVY-843.
 * @author Pilho Kim
 * @version $Revision: 2206 $

public class PropertyNameBug extends GroovyTestCase {
    void testNonJavaIdentifierChacactersWithJavaSyntax() {
        Map map = new HashMap()
        map.put("", "FooBar")
        map.put("", "FooBar-Bar")
        map.put("foo.=;&|^*-+-/\\'?.*:arbitrary()[]{}%#@!", "Any character")

        println("foo.bar1 = ${map.get("foo.bar1")}")
        println(" = ${map.get("")}")
        println("Specical Character Test: ${map.get("foo.=;&|^*-+-/\\'?.*:arbitrary()[]{}%#@!")}")

    void testNonJavaIdentifierChacactersWithGroovySyntax() {
        def map = [:]
        map."" = "FooBar"
        map."" = "FooBar-Bar"
        map."foo.=;&|^*-+-/\\'?.*:arbitrary()[]{}%#@!" = "Any character"

        println("foo.bar1 = ${map."foo.bar1"}")
        println(" = ${map.""}")
        println("Specical Character Test: ${map."foo.=;&|^*-+-/\\'?.*:arbitrary()[]{}%#@!"}")

Other Groovy examples (source code examples)

Here is a short list of links related to this Groovy PropertyNameBug.groovy source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller


new blog posts


Copyright 1998-2021 Alvin Alexander,
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.