borinquenkid commented on code in PR #15568:
URL: https://github.com/apache/grails-core/pull/15568#discussion_r3440100784


##########
grails-data-hibernate7/core/src/main/java/org/grails/orm/hibernate/cfg/domainbinding/util/GeneratorCreationContextWrapper.java:
##########


Review Comment:
   Reverted — this file is unchanged from `8.0.x` in the current revision.



##########
grails-datamapping-core-test/src/test/groovy/org/grails/datastore/gorm/CoreTestSuite.groovy:
##########
@@ -29,5 +29,6 @@ import org.junit.platform.suite.api.Suite
  */
 @Suite
 @SelectClasses([NotInListSpec])
[email protected]({ System.getProperty('core.gorm.suite') == 'true'  })

Review Comment:
   Reverted — this file is unchanged from `8.0.x` in the current revision.



##########
grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/tests/OrderBySpec.groovy:
##########
@@ -18,16 +18,23 @@
  */
 package org.apache.grails.data.testing.tck.tests
 
-import org.apache.grails.data.testing.tck.base.GrailsDataTckSpec
+import spock.lang.IgnoreIf
+
 import org.apache.grails.data.testing.tck.domains.ChildEntity
 import org.apache.grails.data.testing.tck.domains.TestEntity
+import org.apache.grails.data.testing.tck.base.GrailsDataTckSpec
 
 /**
  * Abstract base test for order by queries. Subclasses should do the necessary 
setup to configure GORM
  */
+@IgnoreIf({ System.getProperty('core.gorm.suite') == 'true' })

Review Comment:
   Reverted — this file is unchanged from `8.0.x` in the current revision.



##########
grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/tests/FirstAndLastMethodSpec.groovy:
##########
@@ -168,10 +168,10 @@ class FirstAndLastMethodSpec extends GrailsDataTckSpec {
     )
     void "Test first and last method with composite key"() {
         given:
-        assert new PersonWithCompositeKey(firstName: 'Steve', lastName: 
'Harris', age: 56).save()
-        assert new PersonWithCompositeKey(firstName: 'Dave', lastName: 
'Murray', age: 54).save()
-        assert new PersonWithCompositeKey(firstName: 'Adrian', lastName: 
'Smith', age: 55).save()
-        assert new PersonWithCompositeKey(firstName: 'Bruce', lastName: 
'Dickinson', age: 53).save()
+        assert new PersonWithCompositeKey(firstName: 'Steve', lastName: 
'Harris', age: 56).save(failOnError: true)

Review Comment:
   Fixed — the redundant `failOnError` overrides were removed from the `save()` 
calls. The composite-key test retains `flush: true` on the last save.



##########
grails-data-hibernate5/core/src/test/groovy/grails/gorm/tests/Hibernate5OptimisticLockingSpec.groovy:
##########
@@ -44,29 +69,36 @@ class Hibernate5OptimisticLockingSpec extends 
GrailsDataTckSpec<GrailsDataHibern
 
         when:
         OptLockVersioned.withTransaction {
-            o = OptLockVersioned.get(o.id)
+            try {
+                o = OptLockVersioned.get(o.id)
+
+                Thread.start {
+                    OptLockVersioned.withTransaction { s ->
+                        def reloaded = OptLockVersioned.get(o.id)
+                        assert reloaded
+                        assert reloaded != o
+                        reloaded.name += ' in new session'
+                        reloaded.save(flush: true)
+                        assert reloaded.version == 1
+                        assert o.version == 0
+                    }
+
+                }.join()
+
+                o.name += ' in main session'
+                o.save(flush: true)
 
-            Thread.start {
-                OptLockVersioned.withTransaction { s ->
-                    def reloaded = OptLockVersioned.get(o.id)
-                    assert reloaded
-                    assert reloaded != o
-                    reloaded.name += ' in new session'
-                    reloaded.save(flush: true)
-                    assert reloaded.version == 1
-                    assert o.version == 0
+                manager.session.clear()
+                o = OptLockVersioned.get(o.id)
+            } catch (Throwable e) {
+                System.getProperties().each { key, value ->
+                    println "${key}: ${value}"
                 }
-
-            }.join()
-
-            o.name += ' in main session'
-            o.save(flush: true)
-
-            manager.session.clear()
-            o = OptLockVersioned.get(o.id)
+                throw e

Review Comment:
   Fixed — the debug `System.getProperties().each { println it }` call was 
removed.



##########
grails-data-hibernate7/grails-plugin/build.gradle:
##########
@@ -56,9 +59,10 @@ dependencies {
         exclude group:'org.apache.grails', module:'grails-core'
         exclude group:'javax.transaction', module:'jta'
     }
+    api project(':grails-spring')
+    api project(':grails-core')

Review Comment:
   Intentional — `byte-buddy` and `hibernate-tools-*` are called at runtime 
(proxy generation, schema tooling), not just at compile time, so 
`implementation` is the correct scope in H7.



##########
grails-data-hibernate5/core/src/test/groovy/org/grails/orm/hibernate/support/HibernateDatastoreConnectionSourcesRegistrarSpec.groovy:
##########
@@ -0,0 +1,76 @@
+/*
+ *  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 org.grails.orm.hibernate.support
+
+import grails.gorm.tests.HibernateGormDatastoreSpec
+import org.grails.datastore.gorm.bootstrap.support.InstanceFactoryBean
+import org.grails.datastore.mapping.config.Settings
+import org.grails.datastore.mapping.core.connections.ConnectionSource

Review Comment:
   Fixed — the `@Ignore` annotation and unused import were removed; the spec 
now runs clean.



##########
grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/tests/RangeQuerySpec.groovy:
##########
@@ -18,20 +18,24 @@
  */
 package org.apache.grails.data.testing.tck.tests
 
-import groovy.time.TimeCategory
-
-import org.apache.grails.data.testing.tck.base.GrailsDataTckSpec
 import org.apache.grails.data.testing.tck.domains.ChildEntity
 import org.apache.grails.data.testing.tck.domains.Person
 import org.apache.grails.data.testing.tck.domains.Publication
 import org.apache.grails.data.testing.tck.domains.TestEntity
+import groovy.time.TimeCategory
+import org.apache.grails.data.testing.tck.base.GrailsDataTckSpec
 
 /**
  * Abstract base test for querying ranges. Subclasses should do the necessary 
setup to configure GORM
  */
 class RangeQuerySpec extends GrailsDataTckSpec {
 
-    void 'Test between query with dates'() {
+    void setupSpec() {
+        manager.addAllDomainClasses([Publication, TestEntity, Person, 
ChildEntity])
+    }
+
+    @spock.lang.Requires({ System.getProperty('hibernate5.gorm.suite') == 
'true' || System.getProperty('hibernate7.gorm.suite') == 'true' || 
System.getProperty('mongodb.gorm.suite') == 'true' })

Review Comment:
   The `@Requires` annotations were reverted in a prior cleanup commit — these 
specs now run without restrictions across all GORM implementations.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to