Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit d8c0b04

Browse files
committed
Update for H2 reserved keywords, Add .sdkmanrc, Update to ContainerGebSpec, Remove @ignore on tests fixed by classpath scanning fixes
1 parent b5e5565 commit d8c0b04

File tree

31 files changed

+18
-268
lines changed

31 files changed

+18
-268
lines changed

.sdkmanrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
java=17.0.12-librca

boot-plugin/src/test/groovy/org/grails/datastore/gorm/boot/autoconfigure/HibernateGormAutoConfigurationSpec.groovy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ class HibernateGormAutoConfigurationSpec extends Specification{
3535
PropertyPlaceholderAutoConfiguration.class);
3636
}
3737

38-
@Ignore("java.lang.IllegalStateException: Either class [org.grails.datastore.gorm.boot.autoconfigure.Person] is not a domain class or GORM has not been initialized correctly or has already been shutdown. Ensure GORM is loaded and configured correctly before calling any methods on a GORM entity.")
3938
void 'Test that GORM is correctly configured'() {
4039
when:"The context is refreshed"
4140
context.refresh()

examples/grails-hibernate-groovy-proxy/src/test/groovy/example/ProxySpec.groovy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import spock.lang.Ignore
1313
class ProxySpec extends HibernateSpec {
1414

1515
@Rollback
16-
@Ignore("java.lang.IllegalStateException: Either class [example.Customer] is not a domain class or GORM has not been initialized correctly or has already been shutdown. Ensure GORM is loaded and configured correctly before calling any methods on a GORM entity.")
1716
void "Test Proxy"() {
1817
when:
1918
new Customer(1, "Bob").save(failOnError: true, flush: true)

examples/grails3-database-per-tenant/src/test/groovy/example/DatabasePerTenantSpec.groovy

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ class DatabasePerTenantSpec extends HibernateSpec {
2727
System.setProperty(SystemPropertyTenantResolver.PROPERTY_NAME, "")
2828
}
2929

30-
//@Rollback("moreBooks")
31-
@Ignore("java.lang.IllegalStateException: Either class [example.Book] is not a domain class or GORM has not been initialized correctly or has already been shutdown. Ensure GORM is loaded and configured correctly before calling any methods on a GORM entity.")
30+
@Rollback("moreBooks")
3231
void "Test should rollback changes in a previous test"() {
3332
when:"When there is no tenant"
3433
Book.count()
@@ -45,8 +44,7 @@ class DatabasePerTenantSpec extends HibernateSpec {
4544
bookDataService.countBooks() == 1
4645
}
4746

48-
@Ignore("java.lang.IllegalStateException: Either class [example.Book] is not a domain class or GORM has not been initialized correctly or has already been shutdown. Ensure GORM is loaded and configured correctly before calling any methods on a GORM entity.")
49-
void 'Test database per tenant'() {
47+
void 'Test database per tenant'() {
5048
when:"When there is no tenant"
5149
Book.count()
5250

examples/grails3-hibernate5/build.gradle

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -31,33 +31,7 @@ dependencies {
3131
exclude group: "org.spockframework", module: "spock-core"
3232
}
3333

34-
integrationTestImplementation "org.gebish:geb-spock:$gebVersion"
35-
integrationTestRuntimeOnly "org.seleniumhq.selenium:selenium-chrome-driver:$seleniumVersion"
36-
integrationTestRuntimeOnly "org.seleniumhq.selenium:selenium-firefox-driver:$seleniumVersion"
37-
integrationTestRuntimeOnly "org.seleniumhq.selenium:selenium-safari-driver:$seleniumSafariDriverVersion"
38-
39-
integrationTestRuntimeOnly "org.seleniumhq.selenium:selenium-remote-driver:$seleniumVersion"
40-
integrationTestRuntimeOnly "org.seleniumhq.selenium:selenium-api:$seleniumVersion"
41-
integrationTestRuntimeOnly "org.seleniumhq.selenium:selenium-support:$seleniumVersion"
42-
}
43-
44-
tasks.withType(Test) {
45-
systemProperty "geb.env", System.getProperty('geb.env')
46-
systemProperty "geb.build.reportsDir", reporting.file("geb/integrationTest")
47-
if (!System.getenv().containsKey('CI')) {
48-
systemProperty 'webdriver.chrome.driver', System.getProperty('webdriver.chrome.driver')
49-
systemProperty 'webdriver.gecko.driver', System.getProperty('webdriver.gecko.driver')
50-
} else {
51-
systemProperty 'webdriver.chrome.driver', "${System.getenv('CHROMEWEBDRIVER')}/chromedriver"
52-
systemProperty 'webdriver.gecko.driver', "${System.getenv('GECKOWEBDRIVER')}/geckodriver"
53-
}
54-
}
55-
56-
webdriverBinaries {
57-
if (!System.getenv().containsKey('CI')) {
58-
chromedriver "$chromeDriverVersion"
59-
geckodriver "$geckodriverVersion"
60-
}
34+
integrationTestImplementation testFixtures("org.grails.plugins:geb:$gebPluginVersion")
6135
}
6236

6337

examples/grails3-hibernate5/src/integration-test/groovy/functional/tests/BookControllerSpec.groovy

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
package functional.tests
22

3+
import grails.plugin.geb.ContainerGebSpec
34
import grails.testing.mixin.integration.Integration
4-
import geb.spock.GebSpec
5-
import spock.lang.Ignore
65

76
@Integration(applicationClass = Application)
8-
@Ignore //FAILING downloading the firefox driver
9-
class BookControllerSpec extends GebSpec {
7+
class BookControllerSpec extends ContainerGebSpec {
108

119
void "Test list books"() {
1210
when:"The home page is visited"

examples/grails3-hibernate5/src/integration-test/groovy/functional/tests/CascadeValidationSpec.groovy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import spock.lang.Specification
1010
@Integration(applicationClass = Application)
1111
class CascadeValidationSpec extends Specification {
1212

13-
@Ignore("org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'functional.tests.Employee : (unsaved)' with class 'functional.tests.Employee' to class 'functional.tests.Person'")
1413
void "validation cascades correctly"() {
1514
given: "an invalid business"
1615
Business b = new Business(name: null)

examples/grails3-hibernate5/src/integration-test/resources/GebConfig.groovy

Lines changed: 0 additions & 41 deletions
This file was deleted.

examples/grails3-hibernate5/src/test/groovy/functional/tests/BookControllerUnitSpec.groovy

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ class BookControllerUnitSpec extends HibernateSpec implements ControllerUnitTest
3131
params["title"] = 'The Stand'
3232
}
3333

34-
@Ignore("java.lang.IllegalStateException: Either class [functional.tests.Book] is not a domain class or GORM has not been initialized correctly or has already been shutdown. Ensure GORM is loaded and configured correctly before calling any methods on a GORM entity.")
3534
void "Test the index action returns the correct model"() {
3635

3736
when:"The index action is executed"
@@ -50,7 +49,6 @@ class BookControllerUnitSpec extends HibernateSpec implements ControllerUnitTest
5049
model.book!= null
5150
}
5251

53-
@Ignore("java.lang.IllegalStateException: Either class [functional.tests.Book] is not a domain class or GORM has not been initialized correctly or has already been shutdown. Ensure GORM is loaded and configured correctly before calling any methods on a GORM entity.")
5452
void "Test the save action correctly persists an instance"() {
5553

5654
when:"The save action is executed with an invalid instance"
@@ -77,7 +75,6 @@ class BookControllerUnitSpec extends HibernateSpec implements ControllerUnitTest
7775
Book.count() == 1
7876
}
7977

80-
@Ignore("java.lang.IllegalStateException: Either class [functional.tests.Book] is not a domain class or GORM has not been initialized correctly or has already been shutdown. Ensure GORM is loaded and configured correctly before calling any methods on a GORM entity.")
8178
void "Test that the show action returns the correct model"() {
8279
when:"The show action is executed with a null domain"
8380
controller.show(null)
@@ -111,7 +108,6 @@ class BookControllerUnitSpec extends HibernateSpec implements ControllerUnitTest
111108
model.book == book
112109
}
113110

114-
@Ignore("java.lang.IllegalStateException: Either class [functional.tests.Book] is not a domain class or GORM has not been initialized correctly or has already been shutdown. Ensure GORM is loaded and configured correctly before calling any methods on a GORM entity.")
115111
void "Test the update action performs an update on a valid domain instance"() {
116112
when:"Update is called for a domain instance that doesn't exist"
117113
request.contentType = FORM_CONTENT_TYPE
@@ -144,7 +140,6 @@ class BookControllerUnitSpec extends HibernateSpec implements ControllerUnitTest
144140
flash.message != null
145141
}
146142

147-
@Ignore("java.lang.IllegalStateException: Either class [functional.tests.Book] is not a domain class or GORM has not been initialized correctly or has already been shutdown. Ensure GORM is loaded and configured correctly before calling any methods on a GORM entity.")
148143
void "Test that the delete action deletes an instance if it exists"() {
149144
when:"The delete action is called for a null instance"
150145
request.contentType = FORM_CONTENT_TYPE

examples/grails3-multiple-datasources/build.gradle

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -24,32 +24,7 @@ dependencies {
2424

2525
testImplementation "org.grails:grails-gorm-testing-support:$testingSupportVersion"
2626

27-
integrationTestImplementation "org.gebish:geb-spock:$gebVersion"
28-
integrationTestRuntimeOnly "org.seleniumhq.selenium:selenium-chrome-driver:$seleniumVersion"
29-
integrationTestRuntimeOnly "org.seleniumhq.selenium:selenium-firefox-driver:$seleniumVersion"
30-
integrationTestRuntimeOnly "org.seleniumhq.selenium:selenium-safari-driver:$seleniumSafariDriverVersion"
31-
32-
integrationTestRuntimeOnly "org.seleniumhq.selenium:selenium-remote-driver:$seleniumVersion"
33-
integrationTestRuntimeOnly "org.seleniumhq.selenium:selenium-api:$seleniumVersion"
34-
integrationTestRuntimeOnly "org.seleniumhq.selenium:selenium-support:$seleniumVersion"
35-
}
3627

37-
tasks.withType(Test) {
38-
systemProperty "geb.env", System.getProperty('geb.env')
39-
systemProperty "geb.build.reportsDir", reporting.file("geb/integrationTest")
40-
if (!System.getenv().containsKey('CI')) {
41-
systemProperty 'webdriver.chrome.driver', System.getProperty('webdriver.chrome.driver')
42-
systemProperty 'webdriver.gecko.driver', System.getProperty('webdriver.gecko.driver')
43-
} else {
44-
systemProperty 'webdriver.chrome.driver', "${System.getenv('CHROMEWEBDRIVER')}/chromedriver"
45-
systemProperty 'webdriver.gecko.driver', "${System.getenv('GECKOWEBDRIVER')}/geckodriver"
46-
}
47-
}
48-
49-
webdriverBinaries {
50-
if (!System.getenv().containsKey('CI')) {
51-
chromedriver "$chromeDriverVersion"
52-
geckodriver "$geckodriverVersion"
53-
}
28+
integrationTestImplementation testFixtures("org.grails.plugins:geb:$gebPluginVersion")
5429
}
5530

0 commit comments

Comments
 (0)