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


##########
grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/tests/FindByMethodSpec.groovy:
##########
@@ -93,12 +114,17 @@ class FindByMethodSpec extends GrailsDataTckSpec {
         3 == cnt
     }
 
+    @Requires({

Review Comment:
   These `@Requires` annotations were reverted in a prior cleanup commit — the 
affected specs run without restrictions in the current branch.



##########
grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/tests/EnumSpec.groovy:
##########
@@ -127,6 +116,105 @@ class EnumSpec extends GrailsDataTckSpec {
         instance3 == null
     }
 
+    @Issue('GPMONGODB-248')
+    @spock.lang.Requires({ System.getProperty('hibernate5.gorm.suite') == 
'true' || System.getProperty('hibernate7.gorm.suite') == 'true' || 
System.getProperty('mongodb.gorm.suite') == 'true' })

Review Comment:
   These `@Requires` annotations were reverted in a prior cleanup commit — the 
affected specs run without restrictions in the current branch.



##########
grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/tests/EnumSpec.groovy:
##########
@@ -127,6 +116,105 @@ class EnumSpec extends GrailsDataTckSpec {
         instance3 == null
     }
 
+    @Issue('GPMONGODB-248')
+    @spock.lang.Requires({ System.getProperty('hibernate5.gorm.suite') == 
'true' || System.getProperty('hibernate7.gorm.suite') == 'true' || 
System.getProperty('mongodb.gorm.suite') == 'true' })
+    void "Test findByInList()"() {
+        given:
+
+        new EnumThing(name: 'e1', en: TestEnum.V1).save(failOnError: true)
+        new EnumThing(name: 'e2', en: TestEnum.V1).save(failOnError: true)
+        new EnumThing(name: 'e3', en: TestEnum.V2).save(failOnError: true)
+
+        List instance1
+        List instance2
+        List instance3
+
+        when:
+        instance1 = EnumThing.findAllByEn(TestEnum.V1)
+        instance2 = EnumThing.findAllByEn(TestEnum.V2)
+        instance3 = EnumThing.findAllByEn(TestEnum.V3)
+
+        then:
+        instance1.size() == 2
+        instance1.every { it.en == TestEnum.V1 }
+
+        instance2.size() == 1
+        instance2.every { it.en == TestEnum.V2 }
+
+        instance3.isEmpty()
+
+        when:
+        instance1 = EnumThing.findAllByEnInList([TestEnum.V1])
+        instance2 = EnumThing.findAllByEnInList([TestEnum.V2])
+        instance3 = EnumThing.findAllByEnInList([TestEnum.V3])
+
+        then:
+        instance1.size() == 2
+        instance1.every { it.en == TestEnum.V1 }
+
+        instance2.size() == 1
+        instance2.every { it.en == TestEnum.V2 }
+
+        instance3.isEmpty()
+    }
+
+    @spock.lang.Requires({ System.getProperty('hibernate5.gorm.suite') == 
'true' || System.getProperty('hibernate7.gorm.suite') == 'true' || 
System.getProperty('mongodb.gorm.suite') == 'true' })
+    void "Test findAllBy()"() {
+        given:
+
+        new EnumThing(name: 'e1', en: TestEnum.V1).save(failOnError: true)
+        new EnumThing(name: 'e2', en: TestEnum.V1).save(failOnError: true)
+        new EnumThing(name: 'e3', en: TestEnum.V2).save(failOnError: true)
+
+        List instance1
+        List instance2
+        List instance3
+
+        when:
+        instance1 = EnumThing.findAllByEn(TestEnum.V1)
+        instance2 = EnumThing.findAllByEn(TestEnum.V2)
+        instance3 = EnumThing.findAllByEn(TestEnum.V3)
+
+        then:
+        instance1.size() == 2
+        instance1.every { it.en == TestEnum.V1 }
+
+        instance2.size() == 1
+        instance2.every { it.en == TestEnum.V2 }
+
+        instance3.isEmpty()
+
+    }
+
+    @spock.lang.Requires({ System.getProperty('hibernate5.gorm.suite') == 
'true' || System.getProperty('hibernate7.gorm.suite') == 'true' || 
System.getProperty('mongodb.gorm.suite') == 'true' })

Review Comment:
   These `@Requires` annotations were reverted in a prior cleanup commit — the 
affected specs run without restrictions in the current branch.



##########
grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/tests/EnumSpec.groovy:
##########
@@ -127,6 +116,105 @@ class EnumSpec extends GrailsDataTckSpec {
         instance3 == null
     }
 
+    @Issue('GPMONGODB-248')
+    @spock.lang.Requires({ System.getProperty('hibernate5.gorm.suite') == 
'true' || System.getProperty('hibernate7.gorm.suite') == 'true' || 
System.getProperty('mongodb.gorm.suite') == 'true' })
+    void "Test findByInList()"() {
+        given:
+
+        new EnumThing(name: 'e1', en: TestEnum.V1).save(failOnError: true)
+        new EnumThing(name: 'e2', en: TestEnum.V1).save(failOnError: true)
+        new EnumThing(name: 'e3', en: TestEnum.V2).save(failOnError: true)
+
+        List instance1
+        List instance2
+        List instance3
+
+        when:
+        instance1 = EnumThing.findAllByEn(TestEnum.V1)
+        instance2 = EnumThing.findAllByEn(TestEnum.V2)
+        instance3 = EnumThing.findAllByEn(TestEnum.V3)
+
+        then:
+        instance1.size() == 2
+        instance1.every { it.en == TestEnum.V1 }
+
+        instance2.size() == 1
+        instance2.every { it.en == TestEnum.V2 }
+
+        instance3.isEmpty()
+
+        when:
+        instance1 = EnumThing.findAllByEnInList([TestEnum.V1])
+        instance2 = EnumThing.findAllByEnInList([TestEnum.V2])
+        instance3 = EnumThing.findAllByEnInList([TestEnum.V3])
+
+        then:
+        instance1.size() == 2
+        instance1.every { it.en == TestEnum.V1 }
+
+        instance2.size() == 1
+        instance2.every { it.en == TestEnum.V2 }
+
+        instance3.isEmpty()
+    }
+
+    @spock.lang.Requires({ System.getProperty('hibernate5.gorm.suite') == 
'true' || System.getProperty('hibernate7.gorm.suite') == 'true' || 
System.getProperty('mongodb.gorm.suite') == 'true' })
+    void "Test findAllBy()"() {
+        given:
+
+        new EnumThing(name: 'e1', en: TestEnum.V1).save(failOnError: true)
+        new EnumThing(name: 'e2', en: TestEnum.V1).save(failOnError: true)
+        new EnumThing(name: 'e3', en: TestEnum.V2).save(failOnError: true)
+
+        List instance1
+        List instance2
+        List instance3
+
+        when:
+        instance1 = EnumThing.findAllByEn(TestEnum.V1)
+        instance2 = EnumThing.findAllByEn(TestEnum.V2)
+        instance3 = EnumThing.findAllByEn(TestEnum.V3)
+
+        then:
+        instance1.size() == 2
+        instance1.every { it.en == TestEnum.V1 }
+
+        instance2.size() == 1
+        instance2.every { it.en == TestEnum.V2 }
+
+        instance3.isEmpty()
+
+    }
+
+    @spock.lang.Requires({ System.getProperty('hibernate5.gorm.suite') == 
'true' || System.getProperty('hibernate7.gorm.suite') == 'true' || 
System.getProperty('mongodb.gorm.suite') == 'true' })
+    void "Test findAllBy() with clearing the session"() {
+        given:
+
+        new EnumThing(name: 'e1', en: TestEnum.V1).save(failOnError: true, 
flush: true)
+        new EnumThing(name: 'e2', en: TestEnum.V1).save(failOnError: true, 
flush: true)
+        new EnumThing(name: 'e3', en: TestEnum.V2).save(failOnError: true, 
flush: true)
+        manager.session.clear()
+
+        List instance1
+        List instance2
+        List instance3
+
+        when:
+        instance1 = EnumThing.findAllByEn(TestEnum.V1)
+        instance2 = EnumThing.findAllByEn(TestEnum.V2)
+        instance3 = EnumThing.findAllByEn(TestEnum.V3)
+
+        then:
+        instance1.size() == 2
+        instance1.every { it.en == TestEnum.V1 }
+
+        instance2.size() == 1
+        instance2.every { it.en == TestEnum.V2 }
+
+        instance3.isEmpty()
+    }
+
+    @spock.lang.Requires({ System.getProperty('hibernate5.gorm.suite') == 
'true' || System.getProperty('hibernate7.gorm.suite') == 'true' || 
System.getProperty('mongodb.gorm.suite') == 'true' })

Review Comment:
   These `@Requires` annotations were reverted in a prior cleanup commit — the 
affected specs run without restrictions in the current branch.



##########
grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/tests/DomainEventsSpec.groovy:
##########
@@ -155,6 +159,7 @@ class DomainEventsSpec extends GrailsDataTckSpec {
         1 == PersonEvent.STORE.afterDelete
     }
 
+    @spock.lang.Requires({ System.getProperty('hibernate5.gorm.suite') == 
'true' || System.getProperty('hibernate7.gorm.suite') == 'true' || 
System.getProperty('mongodb.gorm.suite') == 'true' })

Review Comment:
   These `@Requires` annotations were reverted in a prior cleanup commit — the 
affected specs run without restrictions in the current branch.



##########
grails-datamapping-tck/src/main/groovy/org/apache/grails/data/testing/tck/tests/DomainEventsSpec.groovy:
##########
@@ -265,6 +270,7 @@ class DomainEventsSpec extends GrailsDataTckSpec {
         1 == PersonEvent.STORE.afterLoad
     }
 
+    @spock.lang.Requires({ System.getProperty('hibernate5.gorm.suite') == 
'true' || System.getProperty('hibernate7.gorm.suite') == 'true' || 
System.getProperty('mongodb.gorm.suite') == 'true' })

Review Comment:
   These `@Requires` annotations were reverted in a prior cleanup commit — the 
affected specs run without restrictions in the current branch.



##########
grails-datamapping-core-test/src/test/groovy/org/grails/datastore/gorm/OrderBySpec.groovy:
##########
@@ -42,6 +48,9 @@ class OrderBySpec extends 
GrailsDataTckSpec<GrailsDataCoreTckManager> {
         45 == result.age
     }
 
+    @Requires({ System.getProperty('hibernate5.gorm.suite') == 'true' ||

Review Comment:
   These `@Requires` annotations were reverted in a prior cleanup commit — the 
affected specs run without restrictions in the current branch.



##########
grails-datamapping-core-test/src/test/groovy/org/grails/datastore/gorm/NotLikeSpec.groovy:
##########
@@ -27,6 +27,11 @@ import 
org.apache.grails.data.testing.tck.base.GrailsDataTckSpec
  */
 class NotLikeSpec extends GrailsDataTckSpec<GrailsDataCoreTckManager> {
 
+    void setupSpec() {
+        manager.addAllDomainClasses([TestEntity])
+    }
+
+    @spock.lang.Requires({ System.getProperty('hibernate5.gorm.suite') == 
'true' || System.getProperty('hibernate7.gorm.suite') == 'true' || 
System.getProperty('mongodb.gorm.suite') == 'true' })

Review Comment:
   These `@Requires` annotations were reverted in a prior cleanup commit — the 
affected specs run without restrictions in the current branch.



-- 
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