Skip to content

Commit

Permalink
test: cleanup test application
Browse files Browse the repository at this point in the history
- Remove `@PluginSource` from the `Application` class as it is no longer part of a plugin.
- Add `@CompileStatic` to the `Application` class.
- Remove unused configuration from `application.yml`
  • Loading branch information
matrei committed Jan 13, 2025
1 parent 4fdec3b commit 124129f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 33 deletions.
27 changes: 3 additions & 24 deletions examples/sitemesh3/grails-app/conf/application.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,10 @@
server:
port: 8081
info:
app:
name: sitemesh3
version: '0.1'
grailsVersion: 6.0.0
dataSource:
url: jdbc:h2:mem:devDb;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
driverClassName: org.h2.Driver
username: sa
password: ''
pooled: true
jmxExport: true
name: '@info.app.name@'
version: '@info.app.version@'
grailsVersion: '@info.app.grailsVersion@'
grails:
profile: web
gorm:
reactor:
events: false
mime:
disable:
accept:
Expand Down Expand Up @@ -60,12 +48,3 @@ grails:
staticparts: none
default:
codec: html

hibernate:
hbm2ddl:
auto: update
cache:
queries: false
use_second_level_cache: false
use_query_cache: false

Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ package org.sitemesh.grails.plugins.sitemesh3
import grails.boot.GrailsApp
import grails.boot.config.GrailsAutoConfiguration
import groovy.transform.CompileStatic
import grails.plugins.metadata.*

@PluginSource
@CompileStatic
class Application extends GrailsAutoConfiguration {
static void main(String[] args) {
GrailsApp.run(Application, args)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,37 +1,34 @@

import grails.plugin.geb.ContainerGebConfiguration
import grails.plugin.geb.ContainerGebSpec
import grails.testing.mixin.integration.Integration

@Integration
@ContainerGebConfiguration
class SitemeshSpec extends ContainerGebSpec {

void "forced layout"() {
when:
browser.go 'demo/index'

then:
browser.driver.pageSource.contains('''Do you like BootStrap?''')
browser.driver.pageSource.contains('Do you like BootStrap?')
}

void "decorator chaining"() {
when:
browser.go 'demo/chaining'

then:
browser.driver.pageSource.contains('''This is so cool.''')
browser.driver.pageSource.contains('This is so cool.')
}

void "jsp demo"() {
when:
browser.go 'demo/jsp'

then:
def container = $('div.container')
def container = browser.$('div.container')
container

browser.driver.pageSource.contains('''Hello World, I am a JSP page!''')
browser.driver.pageSource.contains('Hello World, I am a JSP page!')
}

void "text"() {
Expand Down

0 comments on commit 124129f

Please sign in to comment.