matrei commented on code in PR #14876: URL: https://github.com/apache/grails-core/pull/14876#discussion_r2187545359
########## grails-test-examples/cache/src/integration-test/groovy/com/demo/CachingServiceIntegrationSpec.groovy: ########## Review Comment: - No need to use explicit `driver.`? - Align on parentheses for method calls? ########## grails-test-examples/app1/src/integration-test/groovy/functionaltests/layout/NoLayoutControllerSpec.groovy: ########## @@ -0,0 +1,43 @@ +/* + * 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 functionaltests.layout + + +import grails.plugin.geb.ContainerGebSpec +import grails.testing.mixin.integration.Integration + +@Integration +class NoLayoutControllerSpec extends ContainerGebSpec { + + def 'no layout'() { + when: + go('/noLayout/index') + + then: "The title is correct" + driver.pageSource == """<html><head> Review Comment: No need to use explicit `driver.` here? ########## grails-test-examples/cache/src/integration-test/groovy/com/demo/CacheTagIntegrationSpec.groovy: ########## Review Comment: - No need to use explicit `driver.`? - Align on parentheses for method calls? ########## grails-test-examples/gsp-layout/src/integration-test/groovy/GrailsLayoutSpec.groovy: ########## Review Comment: No need to use explicit `driver.`? ########## grails-gsp/plugin/src/main/groovy/org/grails/plugins/web/GroovyPagesGrailsPlugin.groovy: ########## @@ -97,183 +105,183 @@ class GroovyPagesGrailsPlugin extends Plugin { /** * Configures the various Spring beans required by GSP */ - Closure doWithSpring() {{-> - def application = grailsApplication - Config config = application.config - boolean developmentMode = isDevelopmentMode() - Environment env = Environment.current + Closure doWithSpring() { + { -> + def application = grailsApplication + Config config = application.config + boolean developmentMode = developmentMode + Environment env = Environment.current - boolean enableReload = env.isReloadEnabled() || - config.getProperty(GroovyPagesTemplateEngine.CONFIG_PROPERTY_GSP_ENABLE_RELOAD, Boolean, false) || - (developmentMode && env == Environment.DEVELOPMENT) + boolean enableReload = env.reloadEnabled || + config.getProperty(GroovyPagesTemplateEngine.CONFIG_PROPERTY_GSP_ENABLE_RELOAD, Boolean, false) || + (developmentMode && env == Environment.DEVELOPMENT) - boolean warDeployed = application.warDeployed - boolean warDeployedWithReload = warDeployed && enableReload + boolean warDeployed = application.warDeployed + boolean warDeployedWithReload = warDeployed && enableReload - long gspCacheTimeout = config.getProperty(GSP_RELOAD_INTERVAL, Long, (developmentMode && env == Environment.DEVELOPMENT) ? 0L : 5000L) - boolean enableCacheResources = !config.getProperty(GroovyPagesTemplateEngine.CONFIG_PROPERTY_DISABLE_CACHING_RESOURCES, Boolean, false) - String viewsDir = config.getProperty(GSP_VIEWS_DIR, '') + long gspCacheTimeout = config.getProperty(GSP_RELOAD_INTERVAL, Long, (developmentMode && env == Environment.DEVELOPMENT) ? 0L : 5000L) + boolean enableCacheResources = !config.getProperty(GroovyPagesTemplateEngine.CONFIG_PROPERTY_DISABLE_CACHING_RESOURCES, Boolean, false) + String viewsDir = config.getProperty(GSP_VIEWS_DIR, '') - RuntimeSpringConfiguration spring = springConfig + RuntimeSpringConfiguration spring = springConfig - // resolves JSP tag libraries - boolean resolveJspTagLibraries = ClassUtils.isPresent('org.grails.gsp.jsp.TagLibraryResolverImpl', application.classLoader) - if (resolveJspTagLibraries) { - jspTagLibraryResolver(TagLibraryResolverImpl) - } + // resolves JSP tag libraries + boolean resolveJspTagLibraries = ClassUtils.isPresent('org.grails.gsp.jsp.TagLibraryResolverImpl', application.classLoader) + if (resolveJspTagLibraries) { + jspTagLibraryResolver(TagLibraryResolverImpl) + } - // resolves GSP tag libraries - gspTagLibraryLookup(TagLibraryLookup) { bean -> - bean.lazyInit = true - } + // resolves GSP tag libraries + gspTagLibraryLookup(TagLibraryLookup) { bean -> + bean.lazyInit = true + } - boolean customResourceLoader = false - // If the development environment is used we need to load GSP files relative to the base directory - // as oppose to in WAR deployment where views are loaded from /WEB-INF + boolean customResourceLoader = false + // If the development environment is used we need to load GSP files relative to the base directory + // as oppose to in WAR deployment where views are loaded from /WEB-INF - if (viewsDir) { - log.info "Configuring GSP views directory as '${viewsDir}'" - customResourceLoader = true - groovyPageResourceLoader(GroovyPageResourceLoader) { - baseResource = "file:${viewsDir}" - } - } - else { - if (developmentMode) { + if (viewsDir) { + log.info("Configuring GSP views directory as '${}'", viewsDir) Review Comment: I'm not sure this was correctly converted from `GString` to lazy evaluated log message. ########## grails-test-examples/gsp-layout/src/integration-test/groovy/EndToEndSpec.groovy: ########## Review Comment: No need to use explicit `driver.`? -- 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]
