This is an automated email from the ASF dual-hosted git repository. jdaugherty pushed a commit to branch 7.0.x in repository https://gitbox.apache.org/repos/asf/grails-core.git
The following commit(s) were added to refs/heads/7.0.x by this push: new b241c86429 test: #14947 - add test case reproducing cast exception b241c86429 is described below commit b241c86429dc74159b219b87a8342a102b60735a Author: James Daugherty <jdaughe...@jdresources.net> AuthorDate: Wed Aug 6 09:33:24 2025 -0400 test: #14947 - add test case reproducing cast exception --- .../commandobjects/CommandObjectController.groovy | 35 +++++++++++++++++++ .../domain/functionaltests/Person.groovy | 30 +++++++++++++++++ .../commandobjects/CommandObjectSpec.groovy | 39 ++++++++++++++++++++++ 3 files changed, 104 insertions(+) diff --git a/grails-test-examples/app1/grails-app/controllers/functionaltests/commandobjects/CommandObjectController.groovy b/grails-test-examples/app1/grails-app/controllers/functionaltests/commandobjects/CommandObjectController.groovy new file mode 100644 index 0000000000..850224b56e --- /dev/null +++ b/grails-test-examples/app1/grails-app/controllers/functionaltests/commandobjects/CommandObjectController.groovy @@ -0,0 +1,35 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package functionaltests.commandobjects + +import functionaltests.Person +import grails.artefact.Controller + +class CommandObjectController implements Controller { + + def echo(String person) { + render(text: person) + } + + def echoPerson(String name) { + Person p1 = Person.findByName(name) + render(text: p1?.name ?: "No Person found with name: $name") + } +} diff --git a/grails-test-examples/app1/grails-app/domain/functionaltests/Person.groovy b/grails-test-examples/app1/grails-app/domain/functionaltests/Person.groovy new file mode 100644 index 0000000000..37bb4e8713 --- /dev/null +++ b/grails-test-examples/app1/grails-app/domain/functionaltests/Person.groovy @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package functionaltests + +class Person { + + String name + + static constraints = {} + + static mapping = { + } +} diff --git a/grails-test-examples/app1/src/integration-test/groovy/functionaltests/commandobjects/CommandObjectSpec.groovy b/grails-test-examples/app1/src/integration-test/groovy/functionaltests/commandobjects/CommandObjectSpec.groovy new file mode 100644 index 0000000000..25f71cc23a --- /dev/null +++ b/grails-test-examples/app1/src/integration-test/groovy/functionaltests/commandobjects/CommandObjectSpec.groovy @@ -0,0 +1,39 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package functionaltests.commandobjects + +import grails.plugin.geb.ContainerGebSpec +import grails.testing.mixin.integration.Integration +import spock.lang.Issue +import spock.lang.PendingFeature + +@Integration +@Issue('https://github.com/apache/grails-core/issues/14947') +class CommandObjectSpec extends ContainerGebSpec { + + @PendingFeature + void 'should display the correct title on the home page'() { + when: 'visiting the home page' + go('/commandObject/echo?person=George+Doe') + + then: 'the page title is correct' + title == 'Welcome to Grails' + } +}