Skip to content

Commit

Permalink
ported codec test over to new functional test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
graemerocher committed Jan 20, 2012
1 parent c9ac511 commit 89b70a4
Show file tree
Hide file tree
Showing 25 changed files with 2,636 additions and 0 deletions.
14 changes: 14 additions & 0 deletions apps/html-default-codec/.classpath
@@ -0,0 +1,14 @@
<classpath>
<classpathentry kind="src" path="src/java"/>
<classpathentry kind="src" path="src/groovy"/>
<classpathentry kind="src" path="grails-app/conf"/>
<classpathentry kind="src" path="grails-app/controllers"/>
<classpathentry kind="src" path="grails-app/domain"/>
<classpathentry kind="src" path="grails-app/services"/>
<classpathentry kind="src" path="grails-app/taglib"/>
<classpathentry kind="src" path="test/integration"/>
<classpathentry kind="src" path="test/unit"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="com.springsource.sts.grails.core.CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="web-app/WEB-INF/classes"/>
</classpath>
19 changes: 19 additions & 0 deletions apps/html-default-codec/.project
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>html-default-codec</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.springsource.sts.grails.core.nature</nature>
<nature>org.eclipse.jdt.groovy.core.groovyNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
@@ -0,0 +1,3 @@
#Created by grails
eclipse.preferences.version=1
groovy.dont.generate.class.files=true
12 changes: 12 additions & 0 deletions apps/html-default-codec/application.properties
@@ -0,0 +1,12 @@
#Grails Metadata file
#Fri Jan 20 14:37:09 CET 2012
app.grails.version=2.0.1.BUILD-SNAPSHOT
app.name=html-default-codec
app.servlet.version=2.5
app.version=0.1
plugins.database-migration=1.0
plugins.hibernate=2.0.1.BUILD-SNAPSHOT
plugins.jquery=1.7
plugins.resources=1.1.2
plugins.tomcat=2.0.1.BUILD-SNAPSHOT
plugins.webxml=1.3.1
@@ -0,0 +1,5 @@
modules = {
application {
resource url:'js/application.js'
}
}
7 changes: 7 additions & 0 deletions apps/html-default-codec/grails-app/conf/BootStrap.groovy
@@ -0,0 +1,7 @@
class BootStrap {

def init = { servletContext ->
}
def destroy = {
}
}
48 changes: 48 additions & 0 deletions apps/html-default-codec/grails-app/conf/BuildConfig.groovy
@@ -0,0 +1,48 @@
grails.servlet.version = "2.5" // 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.target.level = 1.6
grails.project.source.level = 1.6
//grails.project.war.file = "target/${appName}-${appVersion}.war"

grails.project.dependency.resolution = {
// inherit Grails' default dependencies
inherits("global") {
// uncomment to disable ehcache
// excludes 'ehcache'
}
log "error" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
checksums true // Whether to verify checksums on resolve

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

// uncomment these to enable remote dependency resolution from public Maven repositories
//mavenCentral()
//mavenLocal()
//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 eg.

// runtime 'mysql:mysql-connector-java:5.1.16'
}

plugins {
compile ":hibernate:$grailsVersion"
compile ":jquery:1.7"
compile ":resources:1.1.2"

build ":tomcat:$grailsVersion"

runtime ":database-migration:1.0"
}
}
93 changes: 93 additions & 0 deletions apps/html-default-codec/grails-app/conf/Config.groovy
@@ -0,0 +1,93 @@
// locations to search for config files that get merged into the main config
// config files can either be Java properties files or ConfigSlurper scripts

// grails.config.locations = [ "classpath:${appName}-config.properties",
// "classpath:${appName}-config.groovy",
// "file:${userHome}/.grails/${appName}-config.properties",
// "file:${userHome}/.grails/${appName}-config.groovy"]

// if (System.properties["${appName}.config.location"]) {
// grails.config.locations << "file:" + System.properties["${appName}.config.location"]
// }


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 = [ html: ['text/html','application/xhtml+xml'],
xml: ['text/xml', 'application/xml'],
text: 'text/plain',
js: 'text/javascript',
rss: 'application/rss+xml',
atom: 'application/atom+xml',
css: 'text/css',
csv: 'text/csv',
all: '*/*',
json: ['application/json','text/json'],
form: 'application/x-www-form-urlencoded',
multipartForm: 'multipart/form-data'
]

// URL Mapping Cache Max Size, defaults to 5000
//grails.urlmapping.cache.maxsize = 1000

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


// The default codec used to encode data with ${}
grails.views.default.codec = "html" // 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'

// Set to false to use the new Grails 1.2 JSONBuilder in the render method
grails.json.legacy.builder = false
// enabled native2ascii conversion of i18n properties files
grails.enable.native2ascii = true
// packages to include in Spring bean scanning
grails.spring.bean.packages = []
// whether to disable processing of multi part requests
grails.web.disable.multipart=false

// request parameters to mask when logging exceptions
grails.exceptionresolver.params.exclude = ['password']

// enable query caching by default
grails.hibernate.cache.queries = true

// set per-environment serverURL stem for creating absolute links
environments {
development {
grails.logging.jul.usebridge = true
}
production {
grails.logging.jul.usebridge = false
// TODO: grails.serverURL = "http://www.changeme.com"
}
}

// log4j configuration
log4j = {
// Example of changing the log pattern for the default console
// appender:
//
//appenders {
// console name:'stdout', layout:pattern(conversionPattern: '%c{2} %m%n')
//}

error 'org.codehaus.groovy.grails.web.servlet', // controllers
'org.codehaus.groovy.grails.web.pages', // GSP
'org.codehaus.groovy.grails.web.sitemesh', // layouts
'org.codehaus.groovy.grails.web.mapping.filter', // URL mapping
'org.codehaus.groovy.grails.web.mapping', // URL mapping
'org.codehaus.groovy.grails.commons', // core / classloading
'org.codehaus.groovy.grails.plugins', // plugins
'org.codehaus.groovy.grails.orm.hibernate', // hibernate integration
'org.springframework',
'org.hibernate',
'net.sf.ehcache.hibernate'
}
43 changes: 43 additions & 0 deletions apps/html-default-codec/grails-app/conf/DataSource.groovy
@@ -0,0 +1,43 @@
dataSource {
pooled = true
driverClassName = "org.h2.Driver"
username = "sa"
password = ""
}
hibernate {
cache.use_second_level_cache = true
cache.use_query_cache = true
cache.region.factory_class = 'net.sf.ehcache.hibernate.EhCacheRegionFactory'
}
// environment specific settings
environments {
development {
dataSource {
dbCreate = "create-drop" // one of 'create', 'create-drop', 'update', 'validate', ''
url = "jdbc:h2:mem:devDb;MVCC=TRUE"
}
}
test {
dataSource {
dbCreate = "update"
url = "jdbc:h2:mem:testDb;MVCC=TRUE"
}
}
production {
dataSource {
dbCreate = "update"
url = "jdbc:h2:prodDb;MVCC=TRUE"
pooled = true
properties {
maxActive = -1
minEvictableIdleTimeMillis=1800000
timeBetweenEvictionRunsMillis=1800000
numTestsPerEvictionRun=3
testOnBorrow=true
testWhileIdle=true
testOnReturn=true
validationQuery="SELECT 1"
}
}
}
}
13 changes: 13 additions & 0 deletions apps/html-default-codec/grails-app/conf/UrlMappings.groovy
@@ -0,0 +1,13 @@
class UrlMappings {

static mappings = {
"/$controller/$action?/$id?"{
constraints {
// apply constraints here
}
}

"/"(view:"/index")
"500"(view:'/error')
}
}
48 changes: 48 additions & 0 deletions apps/html-default-codec/grails-app/conf/WebXmlConfig.groovy
@@ -0,0 +1,48 @@
/**
* Application configuration file for WebXml plugin.
*/
webxml {
//========================================
// Delegating Filter Chain
//========================================
//
// Add a 'filter chain proxy' delegater as a Filter. This will allow the application
// to define a FilterChainProxy bean that can add additional filters, such as
// an instance of org.springframework.security.web.FilterChainProxy.

// Set to true to add a filter chain delegator.
//filterChainProxyDelegator.add = true

// The name of the delegate FilterChainProxy bean. You must ensure you have added a bean
// with this name that implements FilterChainProxy to
// YOUR-APP/grails-app/conf/spring/resources.groovy.
//filterChainProxyDelegator.targetBeanName = "filterChainProxyDelegate"

// The URL pattern to which the filter will apply. Usually set to '/*' to cover all URLs.
//filterChainProxyDelegator.urlPattern = "/*"

// Set to true to add Listeners
//listener.add = true
//listener.classNames = ["org.springframework.web.context.request.RequestContextListener"]

//-------------------------------------------------
// These settings usually do not need to be changed
//-------------------------------------------------

// The name of the delegating filter.
//filterChainProxyDelegator.filterName = "filterChainProxyDelegator"

// The delegating filter proxy class.
//filterChainProxyDelegator.className = "org.springframework.web.filter.DelegatingFilterProxy"

// ------------------------------------------------
// Example for context aparameters
// ------------------------------------------------
// this example will create the following XML part
// contextparams = [port: '6001']
//
// <context-param>
// <param-name>port</param-name>
// <param-value>6001</param-value>
// </context-param>
}
@@ -0,0 +1,3 @@
// Place your Spring DSL code here
beans = {
}
@@ -0,0 +1,3 @@
class DemoController {
def index() {}
}
Empty file.
8 changes: 8 additions & 0 deletions apps/html-default-codec/grails-app/views/demo/index.gsp
@@ -0,0 +1,8 @@
<html>
<head>
<link rel="apple-touch-icon" href="${resource(dir: 'images', file: 'apple-touch-icon.png')}">
</head>
<body>
Image: <img src="${resource(dir: 'images', file: 'grails_logo.png')}" alt="Grails"/>
</body>
</html>
11 changes: 11 additions & 0 deletions apps/html-default-codec/grails-app/views/error.gsp
@@ -0,0 +1,11 @@
<!doctype html>
<html>
<head>
<title>Grails Runtime Exception</title>
<meta name="layout" content="main">
<link rel="stylesheet" href="${resource(dir: 'css', file: 'errors.css')}" type="text/css">
</head>
<body>
<g:renderException exception="${exception}" />
</body>
</html>

0 comments on commit 89b70a4

Please sign in to comment.