|
Groovy example source code file (SugarTest.groovy)
The Groovy SugarTest.groovy source code
package org.codehaus.groovy.jsr223
import javax.script.ScriptEngineManager
class SugarTest extends GroovyTestCase {
void testEvalMethodsWithBindingAndMissingPropertyLanguageSelection() {
def binding = new Binding()
binding.x = 10
binding.y = 5
assert ScriptEngineManager.groovy.eval('2 * x + y', binding) == 25
ScriptEngineManager.groovy.eval('z = x + y', binding)
assert binding.z == 15
}
}
Other Groovy examples (source code examples)Here is a short list of links related to this Groovy SugarTest.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.