Skip to content

Commit

Permalink
Upgraded to grails 2.3.5
Browse files Browse the repository at this point in the history
Refactored unit tests to use build in spock support
Refactored domain class constraint tests to reflect new grails binding logic of empty strings
Refactored geb tests to use phantomJS and the Page pattern
Changed travis config to use grails wrapper
  • Loading branch information
pschneider-manzell committed Feb 5, 2014
1 parent a8990b7 commit caa342e
Show file tree
Hide file tree
Showing 44 changed files with 4,192 additions and 12,329 deletions.
8 changes: 2 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,5 @@ language: java
jdk:
- oraclejdk7

before_install:
- sudo add-apt-repository -y ppa:groovy-dev/grails
- sudo apt-get update
- sudo apt-get install grails-2.2.0 # or the grails version.

script: grails test-app
script: ./grailsw refresh-dependencies
&& ./grailsw test-app
6 changes: 3 additions & 3 deletions application.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Grails Metadata file
#Mon Mar 25 08:57:44 CET 2013
app.grails.version=2.2.0
#Mon Feb 03 19:44:19 CET 2014
app.grails.version=2.3.5
app.name=grails-spock-examples
app.servlet.version=2.4
app.servlet.version=2.5
app.version=0.1
5 changes: 5 additions & 0 deletions grails-app/conf/ApplicationResources.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
modules = {
application {
resource url:'js/application.js'
}
}
61 changes: 48 additions & 13 deletions grails-app/conf/BuildConfig.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,86 @@ grails.project.class.dir = "target/classes"
grails.project.test.class.dir = "target/test-classes"
grails.project.test.reports.dir = "target/test-reports"
//grails.project.war.file = "target/${appName}-${appVersion}.war"
grails.project.target.level = 1.6
grails.project.source.level = 1.6

grails.project.fork = [
// configure settings for compilation JVM, note that if you alter the Groovy version forked compilation is required
// compile: [maxMemory: 256, minMemory: 64, debug: false, maxPerm: 256, daemon:true],

// configure settings for the test-app JVM, uses the daemon by default
test: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256, forkReserve:false],
// configure settings for the run-app JVM
run: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256, forkReserve:false],
// configure settings for the run-war JVM
war: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256, forkReserve:false],
// configure settings for the Console UI JVM
console: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256]
]


grails.project.dependency.resolution = {
// inherit Grails' default dependencies
inherits("global") {
// uncomment to disable ehcache
// excludes 'ehcache'
}
log "warn" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
log "error" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
checksums true // Whether to verify checksums on resolve
legacyResolve false // whether to do a secondary resolve on plugin installation, not advised and here for backwards compatibility



repositories {
inherits true // Whether to inherit repository definitions from plugins
grailsPlugins()
grailsHome()
grailsCentral()

// uncomment the below to enable remote dependency resolution
// from public Maven repositories
//mavenLocal()
mavenLocal()
mavenCentral()
//mavenRepo "http://snapshots.repository.codehaus.org"
//mavenRepo "http://repository.codehaus.org"
//mavenRepo "http://download.java.net/maven/2/"
//mavenRepo "http://repository.jboss.com/maven2/"
}

def seleniumVersion = "2.35.0"
def gebVersion = "0.9.2"

dependencies {

// specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg.

// runtime 'mysql:mysql-connector-java:5.1.13'
//test("org.seleniumhq.selenium:selenium-firefox-driver:latest.release")
test "org.spockframework:spock-grails-support:0.7-groovy-2.0"

//test "org.spockframework:spock-grails-support:0.7-groovy-2.0"
test "org.gebish:geb-spock:$gebVersion"
test("org.seleniumhq.selenium:selenium-chrome-driver:$seleniumVersion")
test("org.seleniumhq.selenium:selenium-firefox-driver:$seleniumVersion")

test( "com.github.detro.ghostdriver:phantomjsdriver:1.1.0" ) {
transitive = false
}

}
plugins {
runtime ":hibernate:$grailsVersion"

compile ":scaffolding:2.0.1"

build ':tomcat:7.0.50'
runtime ':hibernate:3.6.10.7'
runtime ":jquery:1.9.1"
runtime ":resources:1.1.6"
runtime ":resources:1.2.1"

// Uncomment these (or add new ones) to enable additional resources cap$
//runtime ":zipped-resources:1.0"
//runtime ":cached-resources:1.0"
//runtime ":yui-minify-resources:0.1.4"

build ":tomcat:$grailsVersion"

runtime ":database-migration:1.3.2"
test(":spock:0.7") {
exclude "spock-grails-support"
}
runtime ":database-migration:1.3.8"
test ":geb:$gebVersion"

}
}
24 changes: 24 additions & 0 deletions grails-app/conf/Config.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,27 @@ log4j = {

warn 'org.mortbay.log'
}

// Uncomment and edit the following lines to start using Grails encoding & escaping improvements

/* remove this line
// GSP settings
grails {
views {
gsp {
encoding = 'UTF-8'
htmlcodec = 'xml' // use xml escaping instead of HTML4 escaping
codecs {
expression = 'html' // escapes values inside null
scriptlet = 'none' // escapes output from scriptlets in GSPs
taglib = 'none' // escapes output from taglibs
staticparts = 'none' // escapes output from static template parts
}
}
// escapes all not-encoded output at final stage of outputting
filteringCodecForContentType {
//'text/html' = 'html'
}
}
}
remove this line */
2 changes: 1 addition & 1 deletion grails-app/conf/UrlMappings.groovy
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class UrlMappings {

static mappings = {
"/$controller/$action?/$id?"{
"/$controller/$action?/$id?(.$format)?"{
constraints {
// apply constraints here
}
Expand Down
68 changes: 16 additions & 52 deletions grails-app/views/error.gsp
Original file line number Diff line number Diff line change
@@ -1,54 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<title>Grails Runtime Exception</title>
<style type="text/css">
.message {
border: 1px solid black;
padding: 5px;
background-color:#E9E9E9;
}
.stack {
border: 1px solid black;
padding: 5px;
overflow:auto;
height: 300px;
}
.snippet {
padding: 5px;
background-color:white;
border:1px solid black;
margin:3px;
font-family:courier;
}
</style>
</head>

<body>
<h1>Grails Runtime Exception</h1>
<h2>Error Details</h2>

<div class="message">
<strong>Error ${request.'javax.servlet.error.status_code'}:</strong> ${request.'javax.servlet.error.message'.encodeAsHTML()}<br/>
<strong>Servlet:</strong> ${request.'javax.servlet.error.servlet_name'}<br/>
<strong>URI:</strong> ${request.'javax.servlet.error.request_uri'}<br/>
<g:if test="${exception}">
<strong>Exception Message:</strong> ${exception.message?.encodeAsHTML()} <br />
<strong>Caused by:</strong> ${exception.cause?.message?.encodeAsHTML()} <br />
<strong>Class:</strong> ${exception.className} <br />
<strong>At Line:</strong> [${exception.lineNumber}] <br />
<strong>Code Snippet:</strong><br />
<div class="snippet">
<g:each var="cs" in="${exception.codeSnippet}">
${cs?.encodeAsHTML()}<br />
</g:each>
</div>
<head>
<title><g:if env="development">Grails Runtime Exception</g:if><g:else>Error</g:else></title>
<meta name="layout" content="main">
<g:if env="development"><link rel="stylesheet" href="${resource(dir: 'css', file: 'errors.css')}" type="text/css"></g:if>
</head>
<body>
<g:if env="development">
<g:renderException exception="${exception}" />
</g:if>
</div>
<g:if test="${exception}">
<h2>Stack Trace</h2>
<div class="stack">
<pre><g:each in="${exception.stackTraceLines}">${it.encodeAsHTML()}<br/></g:each></pre>
</div>
</g:if>
</body>
</html>
<g:else>
<ul class="errors">
<li>An error has occurred</li>
</ul>
</g:else>
</body>
</html>
Loading

0 comments on commit caa342e

Please sign in to comment.