Skip to content

Commit

Permalink
put dynamically compiled test classes in a package
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Brown authored and smaldini committed Mar 26, 2012
1 parent 1f38442 commit e7c7fb1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Expand Up @@ -8,6 +8,8 @@ class OneToManySelfInheritanceTests extends AbstractGrailsHibernateTests {

protected void onSetUp() {
gcl.parseClass '''
package onetomanyselfinheritancetests
import grails.persistence.*
@Entity
Expand All @@ -30,8 +32,8 @@ class ExtOrg extends Org {}
}

void testOneToManyWithSelf() {
def Root = ga.getDomainClass("OrgRoot").clazz
def Org = ga.getDomainClass("Org").clazz
def Root = ga.getDomainClass("onetomanyselfinheritancetests.OrgRoot").clazz
def Org = ga.getDomainClass("onetomanyselfinheritancetests.Org").clazz

def org1 = Org.newInstance(name:"org1")
assertNotNull "should have saved",org1.save(flush:true)
Expand Down Expand Up @@ -59,7 +61,7 @@ class ExtOrg extends Org {}

void testOneToManyExt() {

def ExtOrg = ga.getDomainClass("ExtOrg").clazz
def ExtOrg = ga.getDomainClass("onetomanyselfinheritancetests.ExtOrg").clazz

def org1 = ExtOrg.newInstance(name:"org1")
assertNotNull "should have saved",org1.save(flush:true)
Expand Down
Expand Up @@ -8,6 +8,8 @@ class OneToManyWithSelfAndInheritanceTests extends AbstractGrailsHibernateTests

protected void onSetUp() {
gcl.parseClass '''
package onetomanywithselfandinheritancetests
import grails.persistence.*
@Entity
Expand All @@ -29,8 +31,8 @@ class ExtOrganization extends Organization{}

// test for GRAILS-3210
void testSubclassAssociationsWork() {
def Organization = ga.getDomainClass("Organization").clazz
def ExtOrganization = ga.getDomainClass("ExtOrganization").clazz
def Organization = ga.getDomainClass("onetomanywithselfandinheritancetests.Organization").clazz
def ExtOrganization = ga.getDomainClass("onetomanywithselfandinheritancetests.ExtOrganization").clazz

def org1 = Organization.newInstance(name:'Org 1', description:'root organization').save()
def orgA = Organization.newInstance(name:'Org A', description:'child A of Org 1', parent: org1).save()
Expand Down

0 comments on commit e7c7fb1

Please sign in to comment.