Permalink
Browse files

added code to load log4j.properties only if it exists, add ehcache as…

… testCompile time dependency, add support for generating IDEA project IPR
  • Loading branch information...
1 parent dbcdfa5 commit 620b89662fff45f4e69e720b73f9e6dc9f731a4f @graemerocher graemerocher committed Feb 24, 2011
View
@@ -1,3 +1,4 @@
+*.ipr
idea
/lib
/doc
View
@@ -8,6 +8,8 @@ buildscript {
}
+apply plugin: 'idea'
+
grailsVersion = '1.4.0.BUILD-SNAPSHOT'
antVersion = "1.7.1"
springVersion = "3.0.3.RELEASE"
@@ -1,5 +1,7 @@
dependencies {
+ testCompile 'net.sf.ehcache:ehcache-core:2.3.1'
+
testCompile project(':grails-test-suite-base'),
project(':grails-plugin-testing'),
project(':grails-plugin-datasource'),
@@ -1,7 +1,6 @@
package org.codehaus.groovy.grails.orm.hibernate
import grails.util.GrailsUtil
-import net.sf.ehcache.CacheManager
import org.codehaus.groovy.grails.commons.AnnotationDomainClassArtefactHandler
import org.codehaus.groovy.grails.commons.ApplicationHolder
@@ -25,6 +24,7 @@ import org.springframework.orm.hibernate3.SessionFactoryUtils
import org.springframework.orm.hibernate3.SessionHolder
import org.springframework.transaction.support.TransactionSynchronizationManager
import org.springframework.util.Log4jConfigurer
+import net.sf.ehcache.CacheManager
/**
* @author Graeme Rocher
@@ -49,7 +49,12 @@ abstract class AbstractGrailsHibernateTests extends GroovyTestCase {
protected void setUp() {
super.setUp()
- Log4jConfigurer.initLogging("src/test/groovy/log4j.properties")
+ if(new File("src/test/groovy/log4j.properties").exists())
+ Log4jConfigurer.initLogging("src/test/groovy/log4j.properties")
+ else if(new File("grails-test-suite-persistence/src/test/groovy/log4j.properties").exists()) {
+ Log4jConfigurer.initLogging("grails-test-suite-persistence/src/test/groovy/log4j.properties")
+ }
+
ExpandoMetaClass.enableGlobally()
GroovySystem.metaClassRegistry.metaClassCreationHandle = new ExpandoMetaClassCreationHandle()

0 comments on commit 620b896

Please sign in to comment.