Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

some fixes to the tests, removed redundant IML file

  • Loading branch information...
commit c434df7033eb49cafa0fde34ffe0c82a79189d89 1 parent 3dd46d7
@graemerocher graemerocher authored
View
2  build.gradle
@@ -68,6 +68,8 @@ subprojects {
apply plugin: 'groovy'
apply plugin: 'eclipse'
apply plugin: 'maven'
+ apply plugin: 'idea'
+
manifest.mainAttributes(
"Built-By": System.properties['user.name'],
View
16 commons.iml
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<module version="4" relativePaths="true" type="JAVA_MODULE">
- <component name="ModuleRootManager" />
- <component name="NewModuleRootManager">
- <output url="file://$MODULE_DIR$/target/classes" />
- <exclude-output />
- <content url="file://$MODULE_DIR$/src/commons">
- <sourceFolder url="file://$MODULE_DIR$/src/commons" isTestSource="false" />
- </content>
- <orderEntry type="inheritedJdk" />
- <orderEntry type="sourceFolder" forTests="false" />
- <orderEntry type="library" name="Groovy from GroovyJ 0.1.6 (Irida)" level="application" />
- <orderEntryProperties />
- </component>
-</module>
-
View
24 ...lding/src/test/groovy/org/codehaus/groovy/grails/plugins/scaffolding/ScaffoldingGrailsPluginTests.groovy
@@ -1,10 +1,13 @@
package org.codehaus.groovy.grails.plugins.scaffolding;
-import org.codehaus.groovy.grails.commons.test.*
+import grails.util.GrailsUtil
+
import org.codehaus.groovy.grails.commons.*
import org.codehaus.groovy.grails.commons.spring.*
+import org.codehaus.groovy.grails.commons.test.*
import org.codehaus.groovy.grails.plugins.*
-import org.springframework.core.io.Resource
+import org.codehaus.groovy.grails.plugins.orm.hibernate.HibernatePluginSupport
+import org.springframework.core.io.Resource;
class ScaffoldingGrailsPluginTests extends AbstractGrailsMockTests {
@@ -55,7 +58,7 @@ class TestTagLib {
dependantPluginClasses << gcl.loadClass("org.codehaus.groovy.grails.plugins.web.GroovyPagesGrailsPlugin")
dependantPluginClasses << gcl.loadClass("org.codehaus.groovy.grails.plugins.i18n.I18nGrailsPlugin")
dependantPluginClasses << gcl.loadClass("org.codehaus.groovy.grails.plugins.DomainClassGrailsPlugin")
- dependantPluginClasses << gcl.loadClass("org.codehaus.groovy.grails.orm.hibernate.MockHibernateGrailsPlugin")
+ dependantPluginClasses << MockHibernateGrailsPlugin
def dependentPlugins = dependantPluginClasses.collect { new DefaultGrailsPlugin(it, ga)}
def springConfig = new WebRuntimeSpringConfiguration(ctx)
@@ -86,3 +89,18 @@ class TestTagLib {
gcl.getLoadedClasses().find { it.name.endsWith("TagLib") })
}
}
+
+class MockHibernateGrailsPlugin {
+
+ def version = GrailsUtil.grailsVersion
+ def dependsOn = [dataSource: version,
+ i18n: version,
+ core: version,
+ domainClass: version]
+
+ def artefacts = [new AnnotationDomainClassArtefactHandler()]
+ def loadAfter = ['controllers']
+ def doWithSpring = HibernatePluginSupport.doWithSpring
+ def doWithDynamicMethods = HibernatePluginSupport.doWithDynamicMethods
+}
+
View
4 ...olding/src/test/groovy/org/codehaus/groovy/grails/scaffolding/DefaultGrailsTemplateGeneratorTests.groovy
@@ -47,7 +47,7 @@ class ScaffoldingTest {
'''
void testGenerateDateSelect() {
- def templateGenerator = new DefaultGrailsTemplateGenerator()
+ def templateGenerator = new DefaultGrailsTemplateGenerator(basedir:"../grails-resources")
gcl.parseClass(testDomain)
def testClass = gcl.loadClass("ScaffoldingTest")
@@ -66,7 +66,7 @@ class ScaffoldingTest {
}
void testGenerateNumberSelect() {
- def templateGenerator = new DefaultGrailsTemplateGenerator()
+ def templateGenerator = new DefaultGrailsTemplateGenerator(basedir:"../grails-resources")
gcl.parseClass(testDomain)
def testClass = gcl.loadClass("ScaffoldingTest")
View
6 ...in-scaffolding/src/test/groovy/org/codehaus/groovy/grails/scaffolding/GrailsTemplateGeneratorsTests.java
@@ -54,11 +54,12 @@ protected void tearDown() {
}
public void testGenerateController() throws Exception {
- GrailsTemplateGenerator generator;
+ DefaultGrailsTemplateGenerator generator;
GroovyClassLoader gcl = new GroovyClassLoader(Thread.currentThread().getContextClassLoader());
generator = new DefaultGrailsTemplateGenerator();
+ generator.setBasedir("../grails-resources");
Class dc = gcl.parseClass("class Test { \n Long id;\n Long version; }");
GrailsDomainClass domainClass = new DefaultGrailsDomainClass(dc);
@@ -99,11 +100,12 @@ public void testGenerateController() throws Exception {
}
public void testGenerateViews() throws Exception {
- GrailsTemplateGenerator generator;
+ DefaultGrailsTemplateGenerator generator;
GroovyClassLoader gcl = new GroovyClassLoader(Thread.currentThread().getContextClassLoader());
generator = new DefaultGrailsTemplateGenerator();
+ generator.setBasedir("../grails-resources");
Class dc = gcl.parseClass(
"class Test { " +
Please sign in to comment.
Something went wrong with that request. Please try again.