Permalink
Browse files

GRAILS-9674 Reapply Jeff fixes to upgrade Spring to 3.2.0.RELEASE

  • Loading branch information...
smaldini committed Jan 23, 2013
1 parent eef64f6 commit 39c5f49fd839c3e5b2338448cf0a98cf0c854050
View
442 LICENSE

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -42,7 +42,7 @@ ext {
spockVersion = '0.7-groovy-2.0'
springLoadedVersion = "1.1.1"
- springVersion = "3.1.2.RELEASE"
+ springVersion = "3.2.0.RELEASE"
springWebflowVersion= "2.0.8.RELEASE"
hibernateVersion = "3.6.10.Final"
ehcacheVersion = "2.4.6"
@@ -1,6 +1,7 @@
package org.codehaus.groovy.grails.cli.parsing
-import grails.util.Environment;
+import grails.util.Environment
+import spock.lang.Ignore;
import spock.lang.Shared;
import spock.lang.Specification
@@ -143,6 +144,7 @@ class CommandLineParserSpec extends Specification {
cl.optionValue('host') == "localhost"
}
+ @Ignore
void "Test help message with declared options"() {
when:
def parser = new CommandLineParser()
View
@@ -23,9 +23,6 @@ dependencies {
compile("org.springframework:spring-aspects:${springVersion}") {
exclude group: 'commons-logging', module:'commons-logging'
}
- compile("org.springframework:spring-asm:${springVersion}") {
- exclude group: 'commons-logging', module:'commons-logging'
- }
compile("org.springframework:spring-core:${springVersion}") {
exclude group: 'commons-logging', module:'commons-logging'
}
@@ -36,13 +36,7 @@
public GrailsEnvironment(GrailsApplication grailsApplication) {
this.grailsApplication = grailsApplication;
-
- }
-
- @Override
- protected void customizePropertySources(MutablePropertySources propertySources) {
- super.customizePropertySources(propertySources);
- getPropertySources().addFirst(new GrailsConfigPropertySource(grailsApplication));
+ getPropertySources().addFirst(new GrailsConfigPropertySource());
}
@Override
@@ -55,7 +49,7 @@ protected void customizePropertySources(MutablePropertySources propertySources)
private class GrailsConfigPropertySource extends PropertySource<GrailsApplication> {
- public GrailsConfigPropertySource(GrailsApplication grailsApplication) {
+ public GrailsConfigPropertySource() {
super(grailsApplication.getMetadata().getApplicationName(), grailsApplication);
}
@@ -107,6 +107,11 @@ public String getId() {
return "MockApplicationContext";
}
+ @Override
+ public String getApplicationName() {
+ return getId();
+ }
+
public String getDisplayName() {
return getId();
}
@@ -15,6 +15,7 @@
*/
package org.codehaus.groovy.grails.commons.test;
+import grails.util.Metadata;
import groovy.lang.ExpandoMetaClass;
import groovy.lang.GroovyClassLoader;
import groovy.util.GroovyTestCase;
@@ -59,6 +60,7 @@ protected final void setUp() throws Exception {
ctx.registerMockBean(GrailsRuntimeConfigurator.CLASS_LOADER_BEAN, gcl);
onSetUp();
ga = new DefaultGrailsApplication(gcl.getLoadedClasses(),gcl);
+ ga.getMetadata().put(Metadata.APPLICATION_NAME, getClass().getName());
ga.setApplicationContext(ctx);
ga.initialise();
@@ -1,5 +1,6 @@
package org.codehaus.groovy.grails.plugins.web
+import grails.util.Metadata
import grails.util.MockHttpServletResponse
import grails.web.CamelCaseUrlConverter
import grails.web.UrlConverter
@@ -48,6 +49,7 @@ abstract class AbstractGrailsPluginTests extends GroovyTestCase {
ctx = new MockApplicationContext()
onSetUp()
ga = new DefaultGrailsApplication(gcl.getLoadedClasses(),gcl)
+ ga.metadata[Metadata.APPLICATION_NAME] = getClass().name
def mainContext = new MockApplicationContext()
mainContext.registerMockBean UrlConverter.BEAN_NAME, new CamelCaseUrlConverter()
ga.mainContext = mainContext
@@ -2,6 +2,7 @@ package org.codehaus.groovy.grails.web.servlet.mvc
import grails.util.GrailsNameUtils
import grails.util.GrailsWebUtil
+import grails.util.Metadata
import grails.web.CamelCaseUrlConverter
import grails.web.UrlConverter
@@ -74,6 +75,7 @@ abstract class AbstractGrailsControllerTests extends GroovyTestCase {
ctx = new MockApplicationContext()
onSetUp()
ga = new DefaultGrailsApplication(gcl.getLoadedClasses(), gcl)
+ ga.metadata[Metadata.APPLICATION_NAME] = getClass().name
mockManager = new MockGrailsPluginManager(ga)
ctx.registerMockBean("manager", mockManager)
def dependantPluginClasses = []
@@ -1,6 +1,7 @@
package org.codehaus.groovy.grails.web.taglib
import grails.util.GrailsWebUtil
+import grails.util.Metadata
import grails.web.CamelCaseUrlConverter
import grails.web.UrlConverter
@@ -157,6 +158,7 @@ abstract class AbstractGrailsTagTests extends GroovyTestCase {
GroovySystem.metaClassRegistry.metaClassCreationHandle = new ExpandoMetaClassCreationHandle()
onSetUp()
grailsApplication = new DefaultGrailsApplication(gcl.loadedClasses, gcl)
+ grailsApplication.metadata[Metadata.APPLICATION_NAME] = getClass().name
ga = grailsApplication
def mainContext = new MockApplicationContext()
mainContext.registerMockBean UrlConverter.BEAN_NAME, new CamelCaseUrlConverter()
@@ -3,7 +3,7 @@ package org.codehaus.groovy.grails.orm.hibernate
import grails.util.GrailsNameUtils
import grails.util.GrailsUtil
import grails.util.GrailsWebUtil
-
+import grails.util.Metadata
import org.codehaus.groovy.grails.commons.AnnotationDomainClassArtefactHandler
import org.codehaus.groovy.grails.commons.DefaultGrailsApplication
import org.codehaus.groovy.grails.commons.GrailsApplication
@@ -70,6 +70,7 @@ abstract class AbstractGrailsHibernateTests extends GroovyTestCase {
onSetUp()
ga = new DefaultGrailsApplication(gcl.getLoadedClasses(), gcl)
+ ga.metadata[Metadata.APPLICATION_NAME] = getClass().name
grailsApplication = ga
def dependentPlugins = configurePlugins()
@@ -1,5 +1,6 @@
package org.codehaus.groovy.grails.orm.hibernate
+import grails.util.Metadata
import spock.lang.Specification
import org.springframework.util.Log4jConfigurer
import org.codehaus.groovy.grails.support.MockApplicationContext
@@ -53,6 +54,7 @@ abstract class GormSpec extends Specification {
parentCtx = new MockApplicationContext()
grailsApplication = new DefaultGrailsApplication(gcl.getLoadedClasses(), gcl)
+ grailsApplication.metadata[Metadata.APPLICATION_NAME] = getClass().name
def dependentPlugins = configurePlugins()
@@ -1,5 +1,6 @@
package org.codehaus.groovy.grails.commons.spring;
+import grails.util.Metadata;
import groovy.lang.ExpandoMetaClass;
import groovy.lang.GroovyClassLoader;
import groovy.lang.GroovyObject;
@@ -113,6 +114,7 @@ public void testConfigureScaffolding() {
Class<?> c = gcl.parseClass("class TestController { def scaffold = Test }");
GrailsApplication app = new DefaultGrailsApplication(new Class[]{dc,c}, gcl);
+ app.getMetadata().put(Metadata.APPLICATION_NAME, getClass().getName());
MockApplicationContext parent = new MockApplicationContext();
parent.registerMockBean(GrailsApplication.APPLICATION_ID, app);
@@ -177,6 +179,7 @@ public void testAliasRegistrationInResources() throws Exception {
"resources.groovy");
GrailsApplication app = new DefaultGrailsApplication(new Class[0], gcl);
+ app.getMetadata().put(Metadata.APPLICATION_NAME, getClass().getName());
MockApplicationContext parent = new MockApplicationContext();
parent.registerMockBean(GrailsApplication.APPLICATION_ID, app);
@@ -11,7 +11,7 @@ class I18nGrailsPluginTests extends AbstractGrailsMockTests {
void testI18nPlugin() {
- ga.@applicationMeta = ['grails.war.deployed':'true'] as Metadata
+ ga.@applicationMeta = ['grails.war.deployed':'true', (Metadata.APPLICATION_NAME): getClass().name ] as Metadata
ctx.registerMockResource("WEB-INF/grails-app/i18n/messages.properties")
ctx.registerMockResource("WEB-INF/grails-app/i18n/messages-site_en.properties")
ctx.registerMockResource("WEB-INF/grails-app/i18n/foo-site_en.properties")
@@ -1,6 +1,7 @@
package grails.test
import grails.util.GrailsWebUtil
+import grails.util.Metadata
import grails.web.CamelCaseUrlConverter
import grails.web.UrlConverter
import junit.framework.ComparisonFailure
@@ -40,6 +41,7 @@ class GrailsUrlMappingsTestCaseTests extends GrailsUnitTestCase {
def mainContext = new MockApplicationContext()
mainContext.registerMockBean UrlConverter.BEAN_NAME, new CamelCaseUrlConverter()
+ mockApplication.metadata[Metadata.APPLICATION_NAME] = getClass().name
mockApplication.mainContext= mainContext
mockApplication.initialise()
mockApplication.config.disableMultipart = true

0 comments on commit 39c5f49

Please sign in to comment.