Hi everyone, I use Grails 2.0.0 and Groovy 1.8.5 (JVM 1.6.0_13)
I've developed two simple classes for testing the 1:n relationship
Here they are
package com.book
class Book {
static hasMany = [sheets:Sheet]
static constraints = {
}
}
package com.book
class Sheet {
static belongsTo = [book:Book]
static constraints = {
}
}
I've added the following code to both the unit tests:
void testSomething() {
def sheet = new Sheet()
def book = new Book()
book.addToSheets(sheet)
assertTrue book.sheets.size() > 0
}
This code runs well in the BookTests.groovy unit testing, but in
SheetTests.groovy unit testing
this code fails with the following exception
No signature of method: com.book.Book.addToSheets() is applicable for
argument types:
(com.book.Sheet) values: [com.book.Sheet : null] Possible solutions:
getSheets()
Any solutions?
Thanks in advance
Alex Pileci
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email