1 package org
.codehaus
.groovy
.grails
.orm
.hibernate
;
3 import org
.codehaus
.groovy
.grails
.commons
.*
5 class ClosureMappingTests
extends AbstractGrailsHibernateTests
{
7 void testClosureMapping() {
8 def thingClass
= ga
.getDomainClass("Thing")
10 def thing
= thingClass
.newInstance()
12 assertEquals
"Hello, Fred!", thing
.whoHello("Fred")
17 this.gcl
.parseClass('''
23 def whoHello = { who ->
24 return "Hello, ${who}!"
27 class ApplicationDataSource {
28 boolean pooling = true
30 String dbCreate = "create-drop" // one of 'create
', 'create
-drop
','update
'
31 String url = "jdbc:hsqldb:mem:testDB"
32 String driverClassName = "org.hsqldb.jdbcDriver"
33 String username = "sa"