Skip to content

Commit

Permalink
Fix inheritance tests from grails 7 upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
jdaugherty committed Dec 10, 2024
1 parent 4090fe8 commit 875edae
Show file tree
Hide file tree
Showing 11 changed files with 9 additions and 18 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ jobs:
DEVELOCITY_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
run: >
./gradlew
-Dgeb.env=chromeHeadless
check
build_project:
runs-on: ubuntu-latest
Expand All @@ -54,7 +53,6 @@ jobs:
DEVELOCITY_BUILD_CACHE_NODE_KEY: ${{ secrets.GRADLE_ENTERPRISE_BUILD_CACHE_NODE_KEY }}
run: >
./gradlew
-Dgeb.env=chromeHeadless
build
- name: "📤 Publish Snapshot Artifacts to Artifactory (repo.grails.org)"
if: success()
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/groovy-joint-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,5 @@ jobs:
run: >
./gradlew
build
-Dgeb.env=chromeHeadless
-PgroovyVersion=${{needs.build_groovy.outputs.groovyVersion}}
-x groovydoc
2 changes: 2 additions & 0 deletions .sdkmanrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Enable auto-env through the sdkman_auto_env config - https://sdkman.io/usage#env
java=17.0.12-librca
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import grails.plugins.*
class ExamplesFunctionalTestsPluginGrailsPlugin extends Plugin {

// the version or versions of Grails the plugin is designed for
def grailsVersion = "4.0.0.BUILD-SNAPSHOT > *"
def grailsVersion = "7.0.0-SNAPSHOT > *"
// resources that are excluded from plugin packaging
def pluginExcludes = [
"grails-app/views/error.gsp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ class Garage {

String owner

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

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

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

// GORM inheritance not working in Groovy 4
// See https://issues.apache.org/jira/browse/GROOVY-5106,
// https://github.com/grails/grails-views/pull/589
/*
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
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,17 @@ class VehicleSpec extends HttpClientSpec {
super.init()
}

@PendingFeature(reason = 'GORM inheritance not working in Groovy 4')
void "Test that domain subclasses render their properties"() {
when:
HttpRequest request = HttpRequest.GET('/vehicle/list')
HttpResponse<String> resp = client.toBlocking().exchange(request, String)

then:"The correct response is returned"
resp.status == HttpStatus.OK
resp.body() == '[{"id":1,"route":"around town","maxPassengers":30},{"id":2,"make":"Subaru","year":2016,"model":"WRX","maxPassengers":4}]'
resp.body() == '[{"id":1,"route":"around town","maxPassengers":30},{"id":2,"make":"Subaru","model":"WRX","year":2016,"maxPassengers":4}]'

}

@PendingFeature(reason = 'GORM inheritance not working in Groovy 4')
void "Test that domain association subclasses render their properties"() {
when:
HttpRequest request = HttpRequest.GET('/vehicle/garage')
Expand Down
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ assetpipeline = '5.0.1'
caffeine = '2.9.3'
gorm = '9.0.0-SNAPSHOT'
gorm-hibernate5 = '9.0.0-SNAPSHOT'
gorm-mongodb = '8.2.0'
gorm-mongodb = '9.0.0-SNAPSHOT'
grails = '7.0.0-SNAPSHOT'
grails-gradle-plugin = '7.0.0-SNAPSHOT'
grails-testing-support = '4.0.0-SNAPSHOT'
groovy = '4.0.22'
groovy = '4.0.24'
java-baseline = '17'
jackson-databind = '2.18.0'
jakarta-annotation-api = '3.0.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import grails.views.resolve.PluginAwareTemplateResolver
class JsonViewGrailsPlugin extends Plugin {

// the version or versions of Grails the plugin is designed for
def grailsVersion = "6.0.0 > *"
def grailsVersion = "7.0.0 > *"

def title = "JSON Views" // Headline display name of the plugin
def author = "Graeme Rocher"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import grails.views.resolve.PluginAwareTemplateResolver
class MarkupViewGrailsPlugin extends Plugin {

// the version or versions of Grails the plugin is designed for
def grailsVersion = "6.0.0 > *"
def grailsVersion = "7.0.0 > *"

def title = "Markup Views" // Headline display name of the plugin
def author = "Graeme Rocher"
Expand Down

0 comments on commit 875edae

Please sign in to comment.