GRAILS-1019: Allowing expressions to be used with the 'disabled' attribute for g...
[grails.git] / test / groovy / org / codehaus / groovy / grails / orm / hibernate / MapDomainTests.groovy
blob8ae5a0130176d71d292b4879684823b53efc2175
1 package org.codehaus.groovy.grails.orm.hibernate;
3 import org.codehaus.groovy.grails.commons.*
4 import org.codehaus.groovy.grails.commons.test.*
6 class MapDomainTests extends AbstractGrailsMockTests {
8 void testMapDomain() {
9 def authorClass = ga.getDomainClass("Author")
10 def bookClass = ga.getDomainClass("Book")
13 def simpleAuthors = bookClass.getPropertyByName("simpleAuthors")
15 assert !simpleAuthors.association
16 assert !simpleAuthors.oneToMany
17 assert simpleAuthors.persistent
19 def authorsProp = bookClass.getPropertyByName("authors")
20 assert simpleAuthors.persistent
21 assert authorsProp.oneToMany
22 assert authorsProp.bidirectional
23 assert authorsProp.association
24 assertEquals "book", authorsProp.referencedPropertyName
25 assertEquals authorClass, authorsProp.referencedDomainClass
26 assertEquals authorClass.clazz, authorsProp.referencedPropertyType
30 void onSetUp() {
31 this.gcl.parseClass('''
32 class Book {
33 Long id
34 Long version
35 Map simpleAuthors
36 Map authors
37 def hasMany = [authors:Author]
39 class Author {
40 Long id
41 Long version
42 Book book
44 '''
48 void onTearDown() {