GRAILS-1019: Allowing expressions to be used with the 'disabled' attribute for g...
[grails.git] / test / groovy / org / codehaus / groovy / grails / orm / hibernate / ClosureMappingTests.groovy
blob3920666f11136d800fd02737a8f25aca79717b1f
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")
16 void onSetUp() {
17 this.gcl.parseClass('''
18 class Thing {
19 Long id
20 Long version
21 String name
23 def whoHello = { who ->
24 return "Hello, ${who}!"
27 class ApplicationDataSource {
28 boolean pooling = true
29 boolean logSql = 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"
34 String password = ""
36 '''
40 void onTearDown() {