Skip to content

Commit

Permalink
test: All tests working except GORM Inheritance
Browse files Browse the repository at this point in the history
  • Loading branch information
matrei committed Oct 1, 2024
1 parent 1fd1813 commit 3c70774
Show file tree
Hide file tree
Showing 20 changed files with 966 additions and 429 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ allprojects {

version = rootProject.version
repositories {
mavenLocal() // Used by Groovy Joint workflow github action after building Groovy
mavenCentral()
maven { url = 'https://repo.grails.org/grails/core' }
// mavenLocal() // Keep, this will be uncommented and used by CI (groovy-joint-workflow)
if (libs.versions.groovy.get().endsWith('-SNAPSHOT')) {
maven {
name = 'JFrog Groovy snapshot repo'
Expand Down
2 changes: 1 addition & 1 deletion examples/functional-tests-plugin/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id 'java-library'
id 'org.grails.grails-plugin'
//id 'org.grails.plugins.views-json'
id 'org.grails.plugins.views-json'
}

group = 'functional.tests.plugin'
Expand Down
15 changes: 8 additions & 7 deletions examples/functional-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,10 @@ group = 'functional.tests'

dependencies {


implementation project(':examples-functional-tests-plugin')
implementation project(':views-json')
implementation project(':views-markup')

runtimeOnly project(':views-json-templates')

testImplementation project(':views-json-testing-support')

implementation 'org.grails:grails-core'
implementation 'org.grails:grails-logging'
implementation 'org.grails:grails-web-boot'
Expand All @@ -38,14 +33,20 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-autoconfigure'
implementation 'org.springframework.boot:spring-boot-starter-logging'
implementation 'org.springframework.boot:spring-boot-starter-tomcat'
implementation libs.jakarta.servlet.api

compileOnly libs.jakarta.servlet.api // Provided by Tomcat

runtimeOnly project(':views-json-templates')
runtimeOnly 'com.h2database:h2'
runtimeOnly 'org.apache.tomcat:tomcat-jdbc'
runtimeOnly libs.assetpipeline

testImplementation project(':views-json-testing-support')
testImplementation libs.grails.testing.support.core
testImplementation libs.micronaut.http.client

integrationTestImplementation libs.jackson.databind
integrationTestImplementation libs.micronaut.http.client
integrationTestImplementation libs.micronaut.jackson.databind
}

assets {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ class BookController extends RestfulController<Book> {
[books: listAllResources(params)]
}


def listExcludesRespond() {
respond([books: listAllResources(params)])
}
Expand All @@ -34,7 +33,7 @@ class BookController extends RestfulController<Book> {
}

def nonStandardTemplate() {
respond([book: new Book(title: 'template found'), custom: new CustomClass(name: "Sally")], view:'/non-standard/template')
respond([book: new Book(title: 'template found'), custom: new CustomClass(name: 'Sally')], view:'/non-standard/template')
}

def showWithParams() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class Garage {

String owner

static hasMany = [vehicles: Vehicle]
// GORM Inheritance not working in Groovy 4
//static hasMany = [vehicles: Vehicle]

}
3 changes: 3 additions & 0 deletions examples/functional-tests/grails-app/init/BootStrap.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,13 @@ class BootStrap {

new Proxy(name: "Sally").save(flush: true, failOnError: true)

// GORM inheritance not working in Groovy 4
/*
new Garage(owner: "Jay Leno")
.addToVehicles(new Bus(maxPassengers: 30, route: "around town"))
.addToVehicles(new Car(maxPassengers: 4, make: "Subaru", model: "WRX", year: 2016))
.save(flush: true, failOnError: true)
*/

new Customer(name: "Nokia")
.addToSites(new Site(name: "Salo"))
Expand Down
Loading

0 comments on commit 3c70774

Please sign in to comment.