Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix inheritance tests from grails 7 upgrade #599

Merged
merged 3 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
1 change: 1 addition & 0 deletions json/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ dependencies {
testImplementation libs.grails.datastore.gorm.hibernate5
testImplementation libs.spock.core
testImplementation libs.jackson.databind
testImplementation libs.jakarta.servlet.api

testRuntimeOnly libs.slf4j.nop // Get rid of warning about missing slf4j implementation during test task
}
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
1 change: 1 addition & 0 deletions markup/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ dependencies {

testImplementation libs.grails.web.urlmappings
testImplementation libs.spock.core
testImplementation libs.jakarta.servlet.api
testRuntimeOnly libs.slf4j.nop // Get rid of warning about missing slf4j implementation during test task
}

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
Loading