From 02d50b60e6d982d8ffe4968e1dabc96684b708c4 Mon Sep 17 00:00:00 2001 From: Brian Koehmstedt <1261658+bkoehm@users.noreply.github.com> Date: Tue, 12 Nov 2024 13:41:57 -0800 Subject: [PATCH] Grails 7: further work, including getting tests working --- build.gradle | 18 +- functional-test-app/build.gradle | 44 ++- functional-test-app/gradle.properties | 5 - .../gradle/wrapper/gradle-wrapper.jar | Bin 61624 -> 0 bytes .../gradle/wrapper/gradle-wrapper.properties | 6 - functional-test-app/gradlew | 244 --------------- functional-test-app/gradlew.bat | 92 ------ .../grails-app/conf/application.yml | 194 ++++-------- .../grails-app/conf/logback.groovy | 37 --- .../grails-app/conf/logback.xml | 19 ++ .../grails-app/conf/spring/resources.groovy | 17 +- .../grails-app/domain/com/test/User.groovy | 4 + .../domain/com/test/UserRole.groovy | 2 +- functional-test-app/settings.gradle | 0 .../resources/GebConfig.groovy | 31 +- .../server/TransientGrailsLdapServer.groovy | 280 ++++++++++++++++++ gradle.properties | 8 +- gradle/groovy-config.gradle | 8 - gradle/testVerbose.gradle | 3 +- gradle/wrapper/gradle-wrapper.jar | Bin 61624 -> 43583 bytes gradle/wrapper/gradle-wrapper.properties | 3 +- gradlew | 34 ++- gradlew.bat | 22 +- grails-app/conf/logback.groovy | 31 -- grails-app/conf/logback.xml | 19 ++ .../build.gradle | 40 ++- .../gradle.properties | 5 - .../gradle/wrapper/gradle-wrapper.jar | Bin 61624 -> 0 bytes .../gradle/wrapper/gradle-wrapper.properties | 6 - .../gradlew | 244 --------------- .../gradlew.bat | 92 ------ .../grails-app/conf/application.yml | 195 ++++-------- .../grails-app/conf/logback.groovy | 37 --- .../grails-app/conf/logback.xml | 19 ++ .../grails-app/domain/com/test/User.groovy | 4 + .../domain/com/test/UserRole.groovy | 2 +- .../grails-wrapper.jar | Bin 4821 -> 0 bytes .../grailsw | 152 ---------- .../grailsw.bat | 89 ------ .../settings.gradle | 0 .../resources/GebConfig.groovy | 31 +- .../retrieve-db-roles/build.gradle | 41 ++- .../retrieve-db-roles/gradle.properties | 5 - .../gradle/wrapper/gradle-wrapper.jar | Bin 61624 -> 0 bytes .../gradle/wrapper/gradle-wrapper.properties | 6 - .../retrieve-db-roles/gradlew | 244 --------------- .../retrieve-db-roles/gradlew.bat | 92 ------ .../grails-app/conf/application.yml | 195 ++++-------- .../grails-app/conf/logback.groovy | 37 --- .../grails-app/conf/logback.xml | 19 ++ .../grails-app/domain/com/test/User.groovy | 4 + .../domain/com/test/UserRole.groovy | 2 +- .../retrieve-db-roles/grails-wrapper.jar | Bin 4821 -> 0 bytes .../retrieve-db-roles/grailsw | 152 ---------- .../retrieve-db-roles/grailsw.bat | 89 ------ .../retrieve-db-roles/settings.gradle | 0 .../resources/GebConfig.groovy | 31 +- .../retrieve-group-rules/build.gradle | 43 ++- .../retrieve-group-rules/gradle.properties | 5 - .../gradle/wrapper/gradle-wrapper.jar | Bin 61624 -> 0 bytes .../gradle/wrapper/gradle-wrapper.properties | 6 - .../retrieve-group-rules/gradlew | 244 --------------- .../retrieve-group-rules/gradlew.bat | 92 ------ .../grails-app/conf/application.yml | 195 ++++-------- .../grails-app/conf/logback.groovy | 37 --- .../grails-app/conf/logback.xml | 19 ++ .../grails-app/domain/com/test/User.groovy | 4 + .../domain/com/test/UserRole.groovy | 2 +- .../retrieve-group-rules/grails-wrapper.jar | Bin 4821 -> 0 bytes .../retrieve-group-rules/grailsw | 152 ---------- .../retrieve-group-rules/grailsw.bat | 89 ------ .../retrieve-group-rules/settings.gradle | 0 .../resources/GebConfig.groovy | 31 +- settings.gradle | 10 + travis-build.sh | 126 -------- version.txt | 1 - 76 files changed, 852 insertions(+), 3158 deletions(-) delete mode 100644 functional-test-app/gradle.properties delete mode 100644 functional-test-app/gradle/wrapper/gradle-wrapper.jar delete mode 100644 functional-test-app/gradle/wrapper/gradle-wrapper.properties delete mode 100755 functional-test-app/gradlew delete mode 100644 functional-test-app/gradlew.bat delete mode 100644 functional-test-app/grails-app/conf/logback.groovy create mode 100644 functional-test-app/grails-app/conf/logback.xml delete mode 100644 functional-test-app/settings.gradle create mode 100644 functional-test-app/src/main/groovy/grails/ldap/server/TransientGrailsLdapServer.groovy delete mode 100644 gradle/groovy-config.gradle delete mode 100644 grails-app/conf/logback.groovy create mode 100644 grails-app/conf/logback.xml delete mode 100644 misc-functional-test-app/custom_user_details_context_mapper/gradle.properties delete mode 100644 misc-functional-test-app/custom_user_details_context_mapper/gradle/wrapper/gradle-wrapper.jar delete mode 100644 misc-functional-test-app/custom_user_details_context_mapper/gradle/wrapper/gradle-wrapper.properties delete mode 100755 misc-functional-test-app/custom_user_details_context_mapper/gradlew delete mode 100644 misc-functional-test-app/custom_user_details_context_mapper/gradlew.bat delete mode 100644 misc-functional-test-app/custom_user_details_context_mapper/grails-app/conf/logback.groovy create mode 100644 misc-functional-test-app/custom_user_details_context_mapper/grails-app/conf/logback.xml delete mode 100644 misc-functional-test-app/custom_user_details_context_mapper/grails-wrapper.jar delete mode 100755 misc-functional-test-app/custom_user_details_context_mapper/grailsw delete mode 100755 misc-functional-test-app/custom_user_details_context_mapper/grailsw.bat delete mode 100644 misc-functional-test-app/custom_user_details_context_mapper/settings.gradle delete mode 100644 misc-functional-test-app/retrieve-db-roles/gradle.properties delete mode 100644 misc-functional-test-app/retrieve-db-roles/gradle/wrapper/gradle-wrapper.jar delete mode 100644 misc-functional-test-app/retrieve-db-roles/gradle/wrapper/gradle-wrapper.properties delete mode 100755 misc-functional-test-app/retrieve-db-roles/gradlew delete mode 100644 misc-functional-test-app/retrieve-db-roles/gradlew.bat delete mode 100644 misc-functional-test-app/retrieve-db-roles/grails-app/conf/logback.groovy create mode 100644 misc-functional-test-app/retrieve-db-roles/grails-app/conf/logback.xml delete mode 100644 misc-functional-test-app/retrieve-db-roles/grails-wrapper.jar delete mode 100755 misc-functional-test-app/retrieve-db-roles/grailsw delete mode 100755 misc-functional-test-app/retrieve-db-roles/grailsw.bat delete mode 100644 misc-functional-test-app/retrieve-db-roles/settings.gradle delete mode 100644 misc-functional-test-app/retrieve-group-rules/gradle.properties delete mode 100644 misc-functional-test-app/retrieve-group-rules/gradle/wrapper/gradle-wrapper.jar delete mode 100644 misc-functional-test-app/retrieve-group-rules/gradle/wrapper/gradle-wrapper.properties delete mode 100755 misc-functional-test-app/retrieve-group-rules/gradlew delete mode 100644 misc-functional-test-app/retrieve-group-rules/gradlew.bat delete mode 100644 misc-functional-test-app/retrieve-group-rules/grails-app/conf/logback.groovy create mode 100644 misc-functional-test-app/retrieve-group-rules/grails-app/conf/logback.xml delete mode 100644 misc-functional-test-app/retrieve-group-rules/grails-wrapper.jar delete mode 100755 misc-functional-test-app/retrieve-group-rules/grailsw delete mode 100755 misc-functional-test-app/retrieve-group-rules/grailsw.bat delete mode 100644 misc-functional-test-app/retrieve-group-rules/settings.gradle delete mode 100755 travis-build.sh delete mode 100644 version.txt diff --git a/build.gradle b/build.gradle index 6316f90..44d571a 100644 --- a/build.gradle +++ b/build.gradle @@ -22,7 +22,7 @@ plugins { id 'java-library' } -version = file('version.txt').text.trim() +version = projectVersion group 'org.grails.plugins' apply plugin: 'org.grails.grails-plugin' @@ -44,17 +44,22 @@ repositories { maven { url 'https://repo.grails.org/grails/core' } } -configurations { - all { - exclude group: 'javax.servlet' +subprojects { + configurations { + all { + resolutionStrategy.eachDependency { DependencyResolveDetails details-> + if (details.requested.group == 'org.seleniumhq.selenium') { + details.useVersion(seleniumVersion) + } + } + } } } dependencies { - runtimeOnly 'org.grails:grails-web-boot' - api 'org.grails.plugins:spring-security-core:7.0.0-SNAPSHOT' + api "org.grails.plugins:spring-security-core:$grailsSpringSecurityCoreVersion" api "org.springframework.security:spring-security-ldap:$springSecurityVersion", { ['apacheds-core', 'apacheds-core-entry', 'apacheds-protocol-ldap', 'apacheds-protocol-shared', @@ -76,7 +81,6 @@ dependencies { } apply from: "${rootProject.projectDir}/gradle/testVerbose.gradle" -apply from: "${rootProject.projectDir}/gradle/groovy-config.gradle" asciidoctor { sources { diff --git a/functional-test-app/build.gradle b/functional-test-app/build.gradle index a7e8fe4..aa4e405 100644 --- a/functional-test-app/build.gradle +++ b/functional-test-app/build.gradle @@ -4,7 +4,7 @@ buildscript { } dependencies { classpath "org.grails:grails-gradle-plugin:$grailsVersion" - classpath "gradle.plugin.com.github.erdi.webdriver-binaries:webdriver-binaries-gradle-plugin:2.2" + classpath "com.github.erdi:webdriver-binaries-gradle-plugin:3.2" classpath "org.grails.plugins:hibernate5:9.0.0-SNAPSHOT" classpath "com.bertramlabs.plugins:asset-pipeline-gradle:5.0.1" } @@ -49,10 +49,11 @@ dependencies { implementation "org.hibernate:hibernate-core-jakarta:5.6.15.Final" implementation "org.grails.plugins:gsp" - implementation "org.grails.plugins:spring-security-ldap:${file('../version.txt').text.trim()}" - implementation 'org.grails.plugins:ldap-server:1.0.0' + implementation project(":") + + implementation 'org.apache.directory.server:apacheds-core:1.5.4' + implementation 'org.apache.directory.server:apacheds-protocol-ldap:1.5.4' - compileOnly "io.micronaut:micronaut-inject-groovy" console "org.grails:grails-console" profile "org.grails.profiles:web" runtimeOnly "com.h2database:h2" @@ -62,17 +63,19 @@ dependencies { testImplementation "org.mockito:mockito-core" testImplementation "org.grails:grails-web-testing-support" testImplementation "org.grails.plugins:geb" - testImplementation "org.seleniumhq.selenium:selenium-remote-driver:3.141.59" - testImplementation "org.seleniumhq.selenium:selenium-api:3.141.59" - testImplementation "org.seleniumhq.selenium:selenium-support:3.141.59" - testRuntimeOnly "org.seleniumhq.selenium:selenium-chrome-driver:3.141.59" - testRuntimeOnly "org.seleniumhq.selenium:selenium-firefox-driver:3.141.59" - testImplementation "org.seleniumhq.selenium:htmlunit-driver:2.35.1" - testRuntimeOnly 'net.sourceforge.htmlunit:htmlunit:2.35.0' + testImplementation "org.gebish:geb-core:7.0" + testImplementation "org.gebish:geb-spock:7.0" + testImplementation "org.seleniumhq.selenium:selenium-remote-driver:$seleniumVersion" + testImplementation "org.seleniumhq.selenium:selenium-api:$seleniumVersion" + testImplementation "org.seleniumhq.selenium:selenium-support:$seleniumVersion" + testImplementation "org.spockframework:spock-core" + testRuntimeOnly "org.seleniumhq.selenium:selenium-chrome-driver:$seleniumVersion" + testRuntimeOnly "org.seleniumhq.selenium:selenium-firefox-driver:$seleniumVersion" + testRuntimeOnly "org.seleniumhq.selenium:selenium-safari-driver:$seleniumVersion" + runtimeOnly "org.fusesource.jansi:jansi:1.18" } apply from: "../gradle/testVerbose.gradle" -apply from: "../gradle/groovy-config.gradle" tasks.withType(GroovyCompile) { configure(groovyOptions) { @@ -80,22 +83,17 @@ tasks.withType(GroovyCompile) { } } -webdriverBinaries { - chromedriver { - version = '80.0.3987.16' - } - geckodriver { - version = '0.26.0' - } -} tasks.withType(Test) { systemProperty "geb.env", System.getProperty('geb.env') systemProperty "geb.build.reportsDir", reporting.file("geb/integrationTest") - systemProperty "webdriver.chrome.driver", System.getProperty('webdriver.chrome.driver') - systemProperty "webdriver.gecko.driver", System.getProperty('webdriver.gecko.driver') + if (System.getenv('CHROMEWEBDRIVER')) { + systemProperty 'webdriver.chrome.driver', "${System.getenv('CHROMEWEBDRIVER')}/chromedriver" + } + if (System.getenv('GECKOWEBDRIVER')) { + systemProperty 'webdriver.gecko.driver', "${System.getenv('GECKOWEBDRIVER')}/geckodriver" + } } - assets { minifyJs = true minifyCss = true diff --git a/functional-test-app/gradle.properties b/functional-test-app/gradle.properties deleted file mode 100644 index a4eb242..0000000 --- a/functional-test-app/gradle.properties +++ /dev/null @@ -1,5 +0,0 @@ -grailsVersion=7.0.0-SNAPSHOT -gorm.version=9.0.0-SNAPSHOT -org.gradle.daemon=true -org.gradle.parallel=true -org.gradle.jvmargs=-Dfile.encoding=UTF-8 -Xmx1024M diff --git a/functional-test-app/gradle/wrapper/gradle-wrapper.jar b/functional-test-app/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index afba109285af78dbd2a1d187e33ac4f87c76e392..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 61624 zcmb6AV{~QRwml9f72CFLyJFk6ZKq;e729@pY}>YNR8p1vbMJH7ubt
YH!Z*ZaR%>WTVy8-(^h5J^1%NZ$@&_ZQ)3AeHlhL~=X9=fKPzFbZ;~cS**=W-LF1
z5 Tiw!%~BbKaQ-CH-WP{;L@H#X67rg0#de7L) o#dZ2x)FIpgN1_;Qkub&0t{cSRAUztxc6NH>Nwm4yR{(T>0x9%%VeU&<&n6^vFvZ{>V3RYJ_kC9zN(M(`
zp?1PHN>f!-aLgvsbIp*oTZv4yWsXM2Q=C}>t7V(iX*N8{aoWphUJ^(n3k`pncUt&`
ze+sYjo)>>=I?>X}1B*ZrxYu`|WD0J&RIb
pn%E-l3(CQVEaOaFyA;NaMgh54a(U#BohL*&j1%qNO-i{cIoc
zuH3AmH+>Qr__0U2f~HQ0C|zq9S9un
JHY6p(JVd4y?Pd9J5Ga7a{PYLR95ow
zm?GnAxhr8H+qG_2xB3ZIFl4Hm&RCud(4esNgT!cOiJZz*Tbr=enkZ~eP3#=Ktv21f
zX``RkOCJX_f5eyL!!_6!oNR_;3NzSC6Z^2St?xNG)wwO!v11Gwcw^;-mZ34k2|9$_
zj}wJK9BRu`X2nWY5pp+@@zpx7bN>@fHi#5tQRGz6p;wW^k-P7