Permalink
Browse files

restructure some things so we can more easily tun tests on 2.0 as wel…

…l just by changing the application.props version
  • Loading branch information...
Joshua Burnett Joshua Burnett
Joshua Burnett authored and Joshua Burnett committed Dec 31, 2011
1 parent 1370d0b commit 2b69acbbffd276539ec4c7f2929f2fbb3a23b1de
View
@@ -156,19 +156,23 @@ The goal is to keep it as simple as possible while making it friendly for Groovy
}
def doWithApplicationContext = {ctx ->
def doWithApplicationContext = { ctx ->
//assert ctx.quartzScheduler
application.jobClasses.each {jobClass ->
//println "** doWithApplicationContext adding methods to jobClass.getFullName()"
scheduleJob.delegate = delegate
scheduleJob(jobClass, ctx)
}
if(application.mergedConfig.grails.plugin.quartz2.autoStartup){
def builders = application.mergedConfig.grails.plugin.quartz2.jobSetup.flatten()
if(builders?.keySet()){
builders.each{key,clos->
clos(ctx.quartzScheduler,ctx)
def scheduler = ctx.getBean("quartzScheduler")
if (scheduler) {
if(application.mergedConfig.grails.plugin.quartz2.autoStartup){
def builders = application.mergedConfig.grails.plugin.quartz2.jobSetup.flatten()
if(builders?.keySet()){
builders.each{key,clos->
clos(scheduler,ctx)
}
}
}
}
View
@@ -1,6 +1,5 @@
#Grails Metadata file
#Wed Oct 05 15:46:15 CDT 2011
#Fri Dec 30 19:32:49 CST 2011
app.grails.version=1.3.7
app.name=quartz2
plugins.hibernate=1.3.7
plugins.tomcat=1.3.7
@@ -1,10 +1,12 @@
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.war.file = "target/${appName}-${appVersion}.war"
grails.project.dependency.resolution = {
// inherit Grails' default dependencies
inherits("global") {
excludes "xml-apis", "commons-digester"
// uncomment to disable ehcache
// excludes 'ehcache'
}
@@ -21,9 +23,18 @@ grails.project.dependency.resolution = {
excludes "slf4j-api", "c3p0","jta"
//excludes([ group: 'org.slf4j', name: 'slf4j-api', version: '1.6.1'])
}
if(grailsVersion != "2.0.0"){
runtime('com.h2database:h2:1.2.147'){ export = false }
}
// runtime 'mysql:mysql-connector-java:5.1.13'
}
plugins {
compile ':plugin-config:0.1.5'
build(":tomcat:$grailsVersion", ":release:1.0.0", ":hibernate:$grailsVersion") {
export = false
}
}
}
@@ -1,32 +1,41 @@
dataSource {
pooled = true
driverClassName = "org.hsqldb.jdbcDriver"
driverClassName = "org.h2.Driver"
username = "sa"
password = ""
}
hibernate {
cache.use_second_level_cache = true
cache.use_query_cache = true
cache.provider_class = 'net.sf.ehcache.hibernate.EhCacheProvider'
cache.use_second_level_cache = false
}
// environment specific settings
environments {
development {
dataSource {
dbCreate = "create-drop" // one of 'create', 'create-drop','update'
url = "jdbc:hsqldb:mem:devDB"
dbCreate = "create-drop" // one of 'create', 'create-drop', 'update', 'validate', ''
url = "jdbc:h2:mem:devDb;MVCC=TRUE"
}
}
test {
dataSource {
dbCreate = "update"
url = "jdbc:hsqldb:mem:testDb"
url = "jdbc:h2:mem:testDb;MVCC=TRUE"
}
}
production {
dataSource {
dbCreate = "update"
url = "jdbc:hsqldb:file:prodDb;shutdown=true"
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"
}
}
}
}
@@ -26,7 +26,7 @@ import org.quartz.JobExecutionException;
/**
* Quartz Job implementation that invokes a Groovy closure
*/
public static class ClosureJob implements Job {
public class ClosureJob implements Job {
private static Logger log = LoggerFactory.getLogger(ClosureJob.class);
Closure groovyClosure
@@ -27,7 +27,7 @@ import org.quartz.JobExecutionException;
* Quartz Job implementation that invokes a specified method of an object, or static if class is specified.
* this has the DisallowConcurrentExecution set to true
*/
public static class InvokeMethodJob implements Job {
public class InvokeMethodJob implements Job {
private static Logger log = LoggerFactory.getLogger(InvokeMethodJob.class);
Class targetClass //the class if this is a static
@@ -27,7 +27,7 @@ import org.quartz.JobExecutionException;
* Quartz Job implementation that invokes a specified method of an object, or static if class is specified.
* this has the DisallowConcurrentExecution set to true
*/
public static class SpringBeanJob implements Job {
public class SpringBeanJob implements Job {
private static Logger log = LoggerFactory.getLogger(SpringBeanJob.class);
def applicationContext
@@ -2,7 +2,5 @@
#Thu Oct 06 14:30:37 CDT 2011
app.grails.version=1.3.7
app.name=qkiss
app.servlet.version=2.4
app.version=0.1
plugins.hibernate=1.3.7
plugins.tomcat=1.3.7
@@ -1,32 +1,51 @@
grails.plugin.location.'quartz-scheduler' ="../../.."
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 "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
repositories {
inherits true // Whether to inherit repository definitions from plugins
grailsPlugins()
grailsHome()
grailsCentral()
mavenCentral()
// uncomment the below to enable remote dependency resolution
// from public Maven repositories
//mavenLocal()
// 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.
if(grailsVersion != "2.0.0"){
runtime('com.h2database:h2:1.2.147'){ export = false }
}
// runtime 'mysql:mysql-connector-java:5.1.16'
}
// runtime 'mysql:mysql-connector-java:5.1.13'
plugins {
runtime ":hibernate:$grailsVersion"
runtime ":jquery:1.7.1"
runtime ":resources:1.1.5"
build ":tomcat:$grailsVersion"
}
}
@@ -1,32 +1,41 @@
dataSource {
pooled = true
driverClassName = "org.hsqldb.jdbcDriver"
driverClassName = "org.h2.Driver"
username = "sa"
password = ""
}
hibernate {
cache.use_second_level_cache = true
cache.use_query_cache = true
cache.provider_class = 'net.sf.ehcache.hibernate.EhCacheProvider'
}
// environment specific settings
environments {
development {
dataSource {
dbCreate = "create-drop" // one of 'create', 'create-drop','update'
url = "jdbc:hsqldb:mem:devDB"
dbCreate = "create-drop" // one of 'create', 'create-drop', 'update', 'validate', ''
url = "jdbc:h2:mem:devDb;MVCC=TRUE"
}
}
test {
dataSource {
dbCreate = "update"
url = "jdbc:hsqldb:mem:testDb"
url = "jdbc:h2:mem:testDb;MVCC=TRUE"
}
}
production {
dataSource {
dbCreate = "update"
url = "jdbc:hsqldb:file:prodDb;shutdown=true"
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"
}
}
}
}

0 comments on commit 2b69acb

Please sign in to comment.