Skip to content

Commit

Permalink
Merge branch '9.0.x' into 9.0.x-6
Browse files Browse the repository at this point in the history
  • Loading branch information
codeconsole committed Oct 31, 2024
2 parents 5d20a1b + 97aefb3 commit 1419831
Show file tree
Hide file tree
Showing 46 changed files with 63 additions and 303 deletions.
1 change: 1 addition & 0 deletions .sdkmanrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
java=17.0.12-librca
2 changes: 1 addition & 1 deletion boot-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ dependencies {

testRuntimeOnly "org.apache.tomcat:tomcat-jdbc:$tomcatVersion"
testRuntimeOnly "org.apache.tomcat.embed:tomcat-embed-logging-log4j:$tomcatLog4jVersion"
testRuntimeOnly "com.h2database:h2:$h2Version"
testRuntimeOnly "com.h2database:h2"
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ class HibernateGormAutoConfigurationSpec extends Specification{
PropertyPlaceholderAutoConfiguration.class);
}

@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.")
void 'Test that GORM is correctly configured'() {
when:"The context is refreshed"
context.refresh()
Expand Down
8 changes: 5 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ subprojects { Project subproject ->
if(isExample) {
apply plugin: "groovy"

ext['h2.version'] = h2Version
ext['gorm.version'] = gormVersion

if(subproject.name.startsWith("examples-grails")) {
Expand Down Expand Up @@ -117,9 +116,8 @@ subprojects { Project subproject ->
}
}



dependencies {
implementation platform("org.grails:grails-bom:$grailsVersion")
testImplementation "jakarta.annotation:jakarta.annotation-api:$jakartaAnnotationApiVersion"
testImplementation "io.micrometer:micrometer-core:latest.integration"
testImplementation "io.projectreactor:reactor-test:$projectReactorVersion"
Expand Down Expand Up @@ -184,6 +182,10 @@ subprojects { Project subproject ->

apply plugin: 'groovy'

dependencies {
implementation platform("org.grails:grails-bom:$grailsVersion")
}

configurations {
documentation.extendsFrom(compileClasspath)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ class DatabasePerTenantSpec extends HibernateSpec {
System.setProperty(SystemPropertyTenantResolver.PROPERTY_NAME, "")
}

//@Rollback("moreBooks")
@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.")
@Rollback("moreBooks")
void "Test should rollback changes in a previous test"() {
when:"When there is no tenant"
Book.count()
Expand All @@ -45,8 +44,7 @@ class DatabasePerTenantSpec extends HibernateSpec {
bookDataService.countBooks() == 1
}

@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.")
void 'Test database per tenant'() {
void 'Test database per tenant'() {
when:"When there is no tenant"
Book.count()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import spock.lang.Ignore
class ProxySpec extends HibernateSpec {

@Rollback
@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.")
void "Test Proxy"() {
when:
new Customer(1, "Bob").save(failOnError: true, flush: true)
Expand Down
28 changes: 1 addition & 27 deletions examples/grails-hibernate/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,33 +31,7 @@ dependencies {
exclude group: "org.spockframework", module: "spock-core"
}

integrationTestImplementation "org.gebish:geb-spock:$gebVersion"
integrationTestRuntimeOnly "org.seleniumhq.selenium:selenium-chrome-driver:$seleniumVersion"
integrationTestRuntimeOnly "org.seleniumhq.selenium:selenium-firefox-driver:$seleniumVersion"
integrationTestRuntimeOnly "org.seleniumhq.selenium:selenium-safari-driver:$seleniumSafariDriverVersion"

integrationTestRuntimeOnly "org.seleniumhq.selenium:selenium-remote-driver:$seleniumVersion"
integrationTestRuntimeOnly "org.seleniumhq.selenium:selenium-api:$seleniumVersion"
integrationTestRuntimeOnly "org.seleniumhq.selenium:selenium-support:$seleniumVersion"
}

tasks.withType(Test) {
systemProperty "geb.env", System.getProperty('geb.env')
systemProperty "geb.build.reportsDir", reporting.file("geb/integrationTest")
if (!System.getenv().containsKey('CI')) {
systemProperty 'webdriver.chrome.driver', System.getProperty('webdriver.chrome.driver')
systemProperty 'webdriver.gecko.driver', System.getProperty('webdriver.gecko.driver')
} else {
systemProperty 'webdriver.chrome.driver', "${System.getenv('CHROMEWEBDRIVER')}/chromedriver"
systemProperty 'webdriver.gecko.driver', "${System.getenv('GECKOWEBDRIVER')}/geckodriver"
}
}

webdriverBinaries {
if (!System.getenv().containsKey('CI')) {
chromedriver "$chromeDriverVersion"
geckodriver "$geckodriverVersion"
}
integrationTestImplementation testFixtures("org.grails.plugins:geb:$gebPluginVersion")
}


Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package functional.tests

// TODO domain inheritance
class Employee /*extends Person*/ {
class Employee extends Person {

static belongsTo = [
business: Business
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
package functional.tests

import grails.plugin.geb.ContainerGebSpec
import grails.testing.mixin.integration.Integration
import geb.spock.GebSpec
import spock.lang.Ignore

@Integration(applicationClass = Application)
@Ignore //FAILING downloading the firefox driver
class BookControllerSpec extends GebSpec {
class BookControllerSpec extends ContainerGebSpec {

void "Test list books"() {
when:"The home page is visited"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import spock.lang.Specification
@Integration(applicationClass = Application)
class CascadeValidationSpec extends Specification {

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

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class BookControllerUnitSpec extends HibernateSpec implements ControllerUnitTest
params["title"] = 'The Stand'
}

@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.")
void "Test the index action returns the correct model"() {

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

@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.")
void "Test the save action correctly persists an instance"() {

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

@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.")
void "Test that the show action returns the correct model"() {
when:"The show action is executed with a null domain"
controller.show(null)
Expand Down Expand Up @@ -111,7 +108,6 @@ class BookControllerUnitSpec extends HibernateSpec implements ControllerUnitTest
model.book == book
}

@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.")
void "Test the update action performs an update on a valid domain instance"() {
when:"Update is called for a domain instance that doesn't exist"
request.contentType = FORM_CONTENT_TYPE
Expand Down Expand Up @@ -144,7 +140,6 @@ class BookControllerUnitSpec extends HibernateSpec implements ControllerUnitTest
flash.message != null
}

@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.")
void "Test that the delete action deletes an instance if it exists"() {
when:"The delete action is called for a null instance"
request.contentType = FORM_CONTENT_TYPE
Expand Down
27 changes: 1 addition & 26 deletions examples/grails-multiple-datasources/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,32 +24,7 @@ dependencies {

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

integrationTestImplementation "org.gebish:geb-spock:$gebVersion"
integrationTestRuntimeOnly "org.seleniumhq.selenium:selenium-chrome-driver:$seleniumVersion"
integrationTestRuntimeOnly "org.seleniumhq.selenium:selenium-firefox-driver:$seleniumVersion"
integrationTestRuntimeOnly "org.seleniumhq.selenium:selenium-safari-driver:$seleniumSafariDriverVersion"

integrationTestRuntimeOnly "org.seleniumhq.selenium:selenium-remote-driver:$seleniumVersion"
integrationTestRuntimeOnly "org.seleniumhq.selenium:selenium-api:$seleniumVersion"
integrationTestRuntimeOnly "org.seleniumhq.selenium:selenium-support:$seleniumVersion"
}

tasks.withType(Test) {
systemProperty "geb.env", System.getProperty('geb.env')
systemProperty "geb.build.reportsDir", reporting.file("geb/integrationTest")
if (!System.getenv().containsKey('CI')) {
systemProperty 'webdriver.chrome.driver', System.getProperty('webdriver.chrome.driver')
systemProperty 'webdriver.gecko.driver', System.getProperty('webdriver.gecko.driver')
} else {
systemProperty 'webdriver.chrome.driver', "${System.getenv('CHROMEWEBDRIVER')}/chromedriver"
systemProperty 'webdriver.gecko.driver', "${System.getenv('GECKOWEBDRIVER')}/geckodriver"
}
}

webdriverBinaries {
if (!System.getenv().containsKey('CI')) {
chromedriver "$chromeDriverVersion"
geckodriver "$geckodriverVersion"
}
integrationTestImplementation testFixtures("org.grails.plugins:geb:$gebPluginVersion")
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ class PartitionedMultiTenancySpec extends HibernateSpec {
System.setProperty(SystemPropertyTenantResolver.PROPERTY_NAME, "")
}


@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.")
void "Test should rollback changes in a previous test"() {
when: "When there is no tenant"
Book.count()
Expand All @@ -44,7 +42,6 @@ class PartitionedMultiTenancySpec extends HibernateSpec {
bookDataService.countBooks() == 1
}

@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.")
void 'Test database per tenant'() {
when: "When there is no tenant"
Book.count()
Expand Down
29 changes: 2 additions & 27 deletions examples/grails-schema-per-tenant/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,31 +23,6 @@ dependencies {
runtimeOnly "org.grails.plugins:scaffolding:$scaffoldingVersion"

testImplementation "org.grails:grails-gorm-testing-support:$testingSupportVersion"
integrationTestImplementation "org.gebish:geb-spock:$gebVersion"
integrationTestRuntimeOnly "org.seleniumhq.selenium:selenium-chrome-driver:$seleniumVersion"
integrationTestRuntimeOnly "org.seleniumhq.selenium:selenium-firefox-driver:$seleniumVersion"
integrationTestRuntimeOnly "org.seleniumhq.selenium:selenium-safari-driver:$seleniumSafariDriverVersion"

integrationTestRuntimeOnly "org.seleniumhq.selenium:selenium-remote-driver:$seleniumVersion"
integrationTestRuntimeOnly "org.seleniumhq.selenium:selenium-api:$seleniumVersion"
integrationTestRuntimeOnly "org.seleniumhq.selenium:selenium-support:$seleniumVersion"
}

tasks.withType(Test) {
systemProperty "geb.env", System.getProperty('geb.env')
systemProperty "geb.build.reportsDir", reporting.file("geb/integrationTest")
if (!System.getenv().containsKey('CI')) {
systemProperty 'webdriver.chrome.driver', System.getProperty('webdriver.chrome.driver')
systemProperty 'webdriver.gecko.driver', System.getProperty('webdriver.gecko.driver')
} else {
systemProperty 'webdriver.chrome.driver', "${System.getenv('CHROMEWEBDRIVER')}/chromedriver"
systemProperty 'webdriver.gecko.driver', "${System.getenv('GECKOWEBDRIVER')}/geckodriver"
}
}

webdriverBinaries {
if (!System.getenv().containsKey('CI')) {
chromedriver "$chromeDriverVersion"
geckodriver "$geckodriverVersion"
}
}
integrationTestImplementation testFixtures("org.grails.plugins:geb:$gebPluginVersion")
}

This file was deleted.

Loading

0 comments on commit 1419831

Please sign in to comment.