|
Groovy example source code file (AstBuilderFromCodePackageImportTest.groovy)
The Groovy AstBuilderFromCodePackageImportTest.groovy source codepackage org.codehaus.groovy.ast.builder.testpackage import org.codehaus.groovy.ast.builder.* import org.codehaus.groovy.runtime.MethodClosure /** * Test package imports in AstBuilder. * * It is important that this class contains an import of builder.* and not * the AstBuilder class individually. * * @author Hamlet D'Arcy */ @WithAstBuilder public class AstBuilderFromCodePackageImportTest extends GroovyTestCase { public void testPackageImport() { def expected = new AstBuilder().buildFromString(""" println "Hello World" """) def result = new AstBuilder().buildFromCode { println "Hello World" } AstAssert.assertSyntaxTree(expected, result) } } Other Groovy examples (source code examples)Here is a short list of links related to this Groovy AstBuilderFromCodePackageImportTest.groovy source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
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.