From 875edaef95b68582631df41db67ad76a36058505 Mon Sep 17 00:00:00 2001 From: James Daugherty Date: Tue, 10 Dec 2024 15:35:31 -0500 Subject: [PATCH] Fix inheritance tests from grails 7 upgrade --- .github/workflows/gradle.yml | 2 -- .github/workflows/groovy-joint-workflow.yml | 1 - .sdkmanrc | 2 ++ .../plugin/ExamplesFunctionalTestsPluginGrailsPlugin.groovy | 2 +- .../grails-app/domain/functional/tests/Garage.groovy | 3 +-- .../domain}/functional/tests/Vehicle.groovy | 0 examples/functional-tests/grails-app/init/BootStrap.groovy | 5 ----- .../groovy/functional/tests/VehicleSpec.groovy | 4 +--- gradle/libs.versions.toml | 4 ++-- .../grails/plugin/json/view/JsonViewGrailsPlugin.groovy | 2 +- .../grails/plugin/markup/view/MarkupViewGrailsPlugin.groovy | 2 +- 11 files changed, 9 insertions(+), 18 deletions(-) create mode 100644 .sdkmanrc rename examples/functional-tests/{src/main/groovy => grails-app/domain}/functional/tests/Vehicle.groovy (100%) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index abb744598..c4237ef57 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -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 @@ -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() diff --git a/.github/workflows/groovy-joint-workflow.yml b/.github/workflows/groovy-joint-workflow.yml index 2fe97092e..322cb782a 100644 --- a/.github/workflows/groovy-joint-workflow.yml +++ b/.github/workflows/groovy-joint-workflow.yml @@ -141,6 +141,5 @@ jobs: run: > ./gradlew build - -Dgeb.env=chromeHeadless -PgroovyVersion=${{needs.build_groovy.outputs.groovyVersion}} -x groovydoc \ No newline at end of file diff --git a/.sdkmanrc b/.sdkmanrc new file mode 100644 index 000000000..96e716dc2 --- /dev/null +++ b/.sdkmanrc @@ -0,0 +1,2 @@ +# Enable auto-env through the sdkman_auto_env config - https://sdkman.io/usage#env +java=17.0.12-librca diff --git a/examples/functional-tests-plugin/src/main/groovy/functional/tests/plugin/ExamplesFunctionalTestsPluginGrailsPlugin.groovy b/examples/functional-tests-plugin/src/main/groovy/functional/tests/plugin/ExamplesFunctionalTestsPluginGrailsPlugin.groovy index cbfc45431..5176374da 100644 --- a/examples/functional-tests-plugin/src/main/groovy/functional/tests/plugin/ExamplesFunctionalTestsPluginGrailsPlugin.groovy +++ b/examples/functional-tests-plugin/src/main/groovy/functional/tests/plugin/ExamplesFunctionalTestsPluginGrailsPlugin.groovy @@ -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" diff --git a/examples/functional-tests/grails-app/domain/functional/tests/Garage.groovy b/examples/functional-tests/grails-app/domain/functional/tests/Garage.groovy index f908ce8ac..f03dac0b7 100644 --- a/examples/functional-tests/grails-app/domain/functional/tests/Garage.groovy +++ b/examples/functional-tests/grails-app/domain/functional/tests/Garage.groovy @@ -4,7 +4,6 @@ class Garage { String owner - // GORM Inheritance not working in Groovy 4 - //static hasMany = [vehicles: Vehicle] + static hasMany = [vehicles: Vehicle] } diff --git a/examples/functional-tests/src/main/groovy/functional/tests/Vehicle.groovy b/examples/functional-tests/grails-app/domain/functional/tests/Vehicle.groovy similarity index 100% rename from examples/functional-tests/src/main/groovy/functional/tests/Vehicle.groovy rename to examples/functional-tests/grails-app/domain/functional/tests/Vehicle.groovy diff --git a/examples/functional-tests/grails-app/init/BootStrap.groovy b/examples/functional-tests/grails-app/init/BootStrap.groovy index f6206cd39..a13e4aedb 100644 --- a/examples/functional-tests/grails-app/init/BootStrap.groovy +++ b/examples/functional-tests/grails-app/init/BootStrap.groovy @@ -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")) diff --git a/examples/functional-tests/src/integration-test/groovy/functional/tests/VehicleSpec.groovy b/examples/functional-tests/src/integration-test/groovy/functional/tests/VehicleSpec.groovy index dde4e3e20..1f5f7df5e 100644 --- a/examples/functional-tests/src/integration-test/groovy/functional/tests/VehicleSpec.groovy +++ b/examples/functional-tests/src/integration-test/groovy/functional/tests/VehicleSpec.groovy @@ -17,7 +17,6 @@ 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') @@ -25,11 +24,10 @@ class VehicleSpec extends HttpClientSpec { 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') diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 272f4bb4b..ca2a1221c 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -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' diff --git a/json/src/main/groovy/grails/plugin/json/view/JsonViewGrailsPlugin.groovy b/json/src/main/groovy/grails/plugin/json/view/JsonViewGrailsPlugin.groovy index 514c50663..dc488fd7d 100644 --- a/json/src/main/groovy/grails/plugin/json/view/JsonViewGrailsPlugin.groovy +++ b/json/src/main/groovy/grails/plugin/json/view/JsonViewGrailsPlugin.groovy @@ -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" diff --git a/markup/src/main/groovy/grails/plugin/markup/view/MarkupViewGrailsPlugin.groovy b/markup/src/main/groovy/grails/plugin/markup/view/MarkupViewGrailsPlugin.groovy index 03b290e90..76358ed5e 100644 --- a/markup/src/main/groovy/grails/plugin/markup/view/MarkupViewGrailsPlugin.groovy +++ b/markup/src/main/groovy/grails/plugin/markup/view/MarkupViewGrailsPlugin.groovy @@ -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"