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

Groovy example source code file (RodsBug.groovy)

This example Groovy source code file (RodsBug.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, rod, rod, rodsbug, rodsbug, string, string

The Groovy RodsBug.groovy source code

package groovy.bugs

/**
 * @author Rod Cope
 * @version $Revision: 4996 $
 */
class RodsBug extends GroovyTestCase {
    
    void testBug() {
        doTest(true)
        /*
         def x = 1
         if (x > 0) {
         String name = "Rod"
         println(name)
         }
         */
    }
    
    void testBug2() {
        def x = 1
        if (x > 0) {
            //String name = "Rod"
            def name = "Rod"
            println(name)
        }
    }
    
    void doTest(flag) {
        if (flag) {
            String name = "Rod"
            //def name = "Rod"
            doAssert(name)
        }
    }
    
    void doTest() {
        String name = "Rod"
        doAssert(name)
    }
    
    void doAssert(text) {
        assert text != null
    }
}

Other Groovy examples (source code examples)

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

new blog posts

 

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