Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
updating test application to grails 2.3.8
  • Loading branch information
tednaleid committed Jul 11, 2014
1 parent 216365e commit 6918dd0
Show file tree
Hide file tree
Showing 14 changed files with 129 additions and 371 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -13,3 +13,4 @@ cobertura.ser
*.iml
*.ipr
*.iws
test/dummy/target
6 changes: 3 additions & 3 deletions test/dummy/application.properties
@@ -1,5 +1,5 @@
#Grails Metadata file
#Wed Jul 31 10:15:54 EDT 2013
app.grails.version=2.2.4
app.name=asset-test
#Thu Jul 10 19:58:00 CDT 2014
app.grails.version=2.3.8
app.name=dummy
app.version=0.1
32 changes: 12 additions & 20 deletions test/dummy/grails-app/conf/BuildConfig.groovy
@@ -1,16 +1,13 @@
grails.servlet.version = "2.5" // Change depending on target container compliance (2.5 or 3.0)
grails.servlet.version = "3.0" // Change depending on target container compliance (2.5 or 3.0)
grails.project.class.dir = "target/classes"
grails.project.test.class.dir = "target/test-classes"
grails.project.test.reports.dir = "target/test-reports"
grails.project.work.dir = "target/work"
grails.project.target.level = 1.6
grails.project.source.level = 1.6
//grails.project.war.file = "target/${appName}-${appVersion}.war"

// uncomment (and adjust settings) to fork the JVM to isolate classpaths
//grails.project.fork = [
// run: [maxMemory:1024, minMemory:64, debug:false, maxPerm:256]
//]

grails.project.dependency.resolver = "maven" // or ivy
grails.project.dependency.resolution = {
// inherit Grails' default dependencies
inherits("global") {
Expand All @@ -26,36 +23,31 @@ grails.project.dependency.resolution = {

grailsPlugins()
grailsHome()
grailsCentral()

mavenLocal()
grailsCentral()
mavenCentral()

// uncomment these (or add new ones) to enable remote dependency resolution from public Maven repositories
//mavenRepo "http://snapshots.repository.codehaus.org"
//mavenRepo "http://repository.codehaus.org"
//mavenRepo "http://download.java.net/maven/2/"
//mavenRepo "http://repository.jboss.com/maven2/"
}

dependencies {
// specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes e.g.
runtime 'org.mozilla:rhino:1.7R4'
// runtime 'mysql:mysql-connector-java:5.1.22'
// runtime 'mysql:mysql-connector-java:5.1.27'
// runtime 'org.postgresql:postgresql:9.3-1100-jdbc41'
}

plugins {
runtime ":hibernate:$grailsVersion"
runtime ":jquery:1.8.3"
runtime ":resources:1.1.6"

build ":tomcat:$grailsVersion"
build ":tomcat:7.0.52.1"

runtime ":database-migration:1.3.2"
// plugins for the compile step
compile ":scaffolding:2.0.3"
compile ':cache:1.1.2'

compile ':cache:1.0.1'
// plugins needed at runtime but not for compilation
runtime ":hibernate:3.6.10.13" // or ":hibernate4:4.3.5.1"
}
}

grails.plugin.location."asset-pipeline" = "../../"

50 changes: 39 additions & 11 deletions test/dummy/grails-app/conf/Config.groovy
Expand Up @@ -12,10 +12,11 @@
// }

grails.project.groupId = appName // change this to alter the default package name and Maven publishing destination
grails.mime.file.extensions = true // enables the parsing of file extensions from URLs into the request format
grails.mime.use.accept.header = false
grails.mime.types = [
all: '*/*',

// The ACCEPT header will not be used for content negotiation for user agents containing the following strings (defaults to the 4 major rendering engines)
grails.mime.disable.accept.header.userAgents = ['Gecko', 'WebKit', 'Presto', 'Trident']
grails.mime.types = [ // the first one is the default format
all: '*/*', // 'all' maps to '*' or the first available format in withFormat
atom: 'application/atom+xml',
css: 'text/css',
csv: 'text/csv',
Expand All @@ -26,21 +27,44 @@ grails.mime.types = [
multipartForm: 'multipart/form-data',
rss: 'application/rss+xml',
text: 'text/plain',
hal: ['application/hal+json','application/hal+xml'],
xml: ['text/xml', 'application/xml']
]

// URL Mapping Cache Max Size, defaults to 5000
//grails.urlmapping.cache.maxsize = 1000
// grails.assets.url = "/asset-test/assets/"

// What URL patterns should be processed by the resources plugin
grails.resources.adhoc.patterns = ['/images/*', '/css/*', '/js/*', '/plugins/*']
grails.resources.adhoc.includes = ['/images/**', '/css/**', '/js/**', '/plugins/**']

// Legacy setting for codec used to encode data with ${}
grails.views.default.codec = "html"

// The default scope for controllers. May be prototype, session or singleton.
// If unspecified, controllers are prototype scoped.
grails.controllers.defaultScope = 'singleton'

// GSP settings
grails {
views {
gsp {
encoding = 'UTF-8'
htmlcodec = 'xml' // use xml escaping instead of HTML4 escaping
codecs {
expression = 'html' // escapes values inside ${}
scriptlet = 'html' // 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'
}
}


// The default codec used to encode data with ${}
grails.views.default.codec = "none" // none, html, base64
grails.views.gsp.encoding = "UTF-8"
grails.converters.encoding = "UTF-8"
// enable Sitemesh preprocessing of GSP pages
grails.views.gsp.sitemesh.preprocess = true
// scaffolding templates configuration
grails.scaffolding.templates.domainSuffix = 'Instance'

Expand All @@ -59,7 +83,11 @@ grails.exceptionresolver.params.exclude = ['password']
// configure auto-caching of queries by default (if false you can cache individual queries with 'cache: true')
grails.hibernate.cache.queries = false


// configure passing transaction's read-only attribute to Hibernate session, queries and criterias
// set "singleSession = false" OSIV mode in hibernate configuration after enabling
grails.hibernate.pass.readonly = false
// configure passing read-only to OSIV session by default, requires "singleSession = false" OSIV mode
grails.hibernate.osiv.readonly = false

environments {
development {
Expand Down
39 changes: 26 additions & 13 deletions test/dummy/grails-app/conf/DataSource.groovy
@@ -1,42 +1,55 @@
dataSource {
pooled = true
jmxExport = true
driverClassName = "org.h2.Driver"
username = "sa"
password = ""
}
hibernate {
cache.use_second_level_cache = true
cache.use_query_cache = false
cache.region.factory_class = 'net.sf.ehcache.hibernate.EhCacheRegionFactory'
cache.region.factory_class = 'net.sf.ehcache.hibernate.EhCacheRegionFactory' // Hibernate 3
// cache.region.factory_class = 'org.hibernate.cache.ehcache.EhCacheRegionFactory' // Hibernate 4
singleSession = true // configure OSIV singleSession mode
}

// environment specific settings
environments {
development {
dataSource {
dbCreate = "create-drop" // one of 'create', 'create-drop', 'update', 'validate', ''
url = "jdbc:h2:mem:devDb;MVCC=TRUE;LOCK_TIMEOUT=10000"
url = "jdbc:h2:mem:devDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE"
}
}
test {
dataSource {
dbCreate = "update"
url = "jdbc:h2:mem:testDb;MVCC=TRUE;LOCK_TIMEOUT=10000"
url = "jdbc:h2:mem:testDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE"
}
}
production {
dataSource {
dbCreate = "update"
url = "jdbc:h2:prodDb;MVCC=TRUE;LOCK_TIMEOUT=10000"
pooled = true
url = "jdbc:h2:prodDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE"
properties {
maxActive = -1
minEvictableIdleTimeMillis=1800000
timeBetweenEvictionRunsMillis=1800000
numTestsPerEvictionRun=3
testOnBorrow=true
testWhileIdle=true
testOnReturn=true
validationQuery="SELECT 1"
// See http://grails.org/doc/latest/guide/conf.html#dataSource for documentation
jmxEnabled = true
initialSize = 5
maxActive = 50
minIdle = 5
maxIdle = 25
maxWait = 10000
maxAge = 10 * 60000
timeBetweenEvictionRunsMillis = 5000
minEvictableIdleTimeMillis = 60000
validationQuery = "SELECT 1"
validationQueryTimeout = 3
validationInterval = 15000
testOnBorrow = true
testWhileIdle = true
testOnReturn = false
jdbcInterceptors = "ConnectionState"
defaultTransactionIsolation = java.sql.Connection.TRANSACTION_READ_COMMITTED
}
}
}
Expand Down
15 changes: 7 additions & 8 deletions test/dummy/grails-app/conf/UrlMappings.groovy
@@ -1,14 +1,13 @@
class UrlMappings {

static mappings = {
"/$controller/$action?/$id?"{
constraints {
// apply constraints here
}
}
"/$controller/$action?/$id?(.$format)?"{
constraints {
// apply constraints here
}
}

"/"(view:"/index")
"/subtest/index"(view:"/index")
"500"(view:'/error')
"/"(view:"/index")
"500"(view:'/error')
}
}
37 changes: 36 additions & 1 deletion test/dummy/grails-app/views/index.gsp
Expand Up @@ -3,7 +3,6 @@
<head>
<meta name="layout" content="main"/>
<title>Welcome to Grails</title>
<asset:javascript src="application.js"/>
<style type="text/css" media="screen">
#status {
background-color: #eee;
Expand Down Expand Up @@ -82,6 +81,42 @@
</style>
</head>
<body>
<a href="#page-body" class="skip"><g:message code="default.link.skip.label" default="Skip to content&hellip;"/></a>
<div id="status" role="complementary">
<h1>Application Status</h1>
<ul>
<li>App version: <g:meta name="app.version"/></li>
<li>Grails version: <g:meta name="app.grails.version"/></li>
<li>Groovy version: ${GroovySystem.getVersion()}</li>
<li>JVM version: ${System.getProperty('java.version')}</li>
<li>Reloading active: ${grails.util.Environment.reloadingAgentEnabled}</li>
<li>Controllers: ${grailsApplication.controllerClasses.size()}</li>
<li>Domains: ${grailsApplication.domainClasses.size()}</li>
<li>Services: ${grailsApplication.serviceClasses.size()}</li>
<li>Tag Libraries: ${grailsApplication.tagLibClasses.size()}</li>
</ul>
<h1>Installed Plugins</h1>
<ul>
<g:each var="plugin" in="${applicationContext.getBean('pluginManager').allPlugins}">
<li>${plugin.name} - ${plugin.version}</li>
</g:each>
</ul>
</div>
<div id="page-body" role="main">
<h1>Welcome to Grails</h1>
<p>Congratulations, you have successfully started your first Grails application! At the moment
this is the default page, feel free to modify it to either redirect to a controller or display whatever
content you may choose. Below is a list of controllers that are currently deployed in this application,
click on each to execute its default action:</p>

<div id="controller-list" role="navigation">
<h2>Available Controllers:</h2>
<ul>
<g:each var="c" in="${grailsApplication.controllerClasses.sort { it.fullName } }">
<li class="controller"><g:link controller="${c.logicalPropertyName}">${c.fullName}</g:link></li>
</g:each>
</ul>
</div>
</div>
</body>
</html>
2 changes: 1 addition & 1 deletion test/dummy/grails-app/views/layouts/main.gsp
Expand Up @@ -15,14 +15,14 @@
<link rel="stylesheet" href="${resource(dir: 'css', file: 'main.css')}" type="text/css">
<link rel="stylesheet" href="${resource(dir: 'css', file: 'mobile.css')}" type="text/css">
<g:layoutHead/>
<g:javascript library="application"/>
<r:layoutResources />
</head>
<body>
<div id="grailsLogo" role="banner"><a href="http://grails.org"><img src="${resource(dir: 'images', file: 'grails_logo.png')}" alt="Grails"/></a></div>
<g:layoutBody/>
<div class="footer" role="contentinfo"></div>
<div id="spinner" class="spinner" style="display:none;"><g:message code="spinner.alt" default="Loading&hellip;"/></div>
<g:javascript library="application"/>
<r:layoutResources />
</body>
</html>
7 changes: 4 additions & 3 deletions test/dummy/web-app/WEB-INF/applicationContext.xml
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">

<bean id="grailsApplication" class="org.codehaus.groovy.grails.commons.GrailsApplicationFactoryBean">
<description>Grails application factory bean</description>
Expand Down Expand Up @@ -30,4 +29,6 @@ http://www.springframework.org/schema/beans http://www.springframework.org/schem
<value>utf-8</value>
</property>
</bean>

<bean id="conversionService" class="org.springframework.context.support.ConversionServiceFactoryBean" />
</beans>

0 comments on commit 6918dd0

Please sign in to comment.