Skip to content

Commit 1b922af

Browse files
committed
fix failing tests
1 parent 898e5ee commit 1b922af

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
lines changed

grails-core/src/main/groovy/org/grails/plugins/AbstractGrailsPlugin.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,17 @@
2121
import grails.plugins.GrailsPluginManager;
2222
import grails.util.GrailsNameUtils;
2323
import groovy.lang.GroovyObjectSupport;
24-
import org.grails.config.CompositeConfig;
25-
import org.grails.config.PropertySourcesConfig;
2624
import org.grails.config.yaml.YamlPropertySourceLoader;
2725
import org.grails.core.AbstractGrailsClass;
2826
import org.grails.core.legacy.LegacyGrailsApplication;
2927
import org.grails.plugins.support.WatchPattern;
3028
import org.springframework.beans.BeansException;
3129
import org.springframework.context.ApplicationContext;
32-
import org.springframework.core.env.MutablePropertySources;
3330
import org.springframework.core.env.PropertySource;
34-
import org.springframework.core.env.PropertySources;
35-
import org.springframework.core.io.ClassPathResource;
36-
import org.springframework.core.io.FileSystemResource;
3731
import org.springframework.core.io.Resource;
3832
import org.springframework.core.io.UrlResource;
3933
import org.springframework.util.Assert;
4034

41-
import java.io.File;
4235
import java.io.IOException;
4336
import java.net.MalformedURLException;
4437
import java.net.URL;

grails-core/src/main/groovy/org/grails/plugins/DefaultGrailsPlugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ private void evaluateOnChangeListener() {
357357
}
358358

359359
final Metadata metadata = Metadata.getCurrent();
360-
final boolean warDeployed = !metadata.isDevelopmentEnvironmentAvailable();
360+
final boolean warDeployed = metadata.isWarDeployed();
361361
final boolean reloadEnabled = Environment.getCurrent().isReloadEnabled();
362362

363363
if (!((reloadEnabled || !warDeployed) && onChangeListener != null)) {

grails-plugin-gsp/src/main/groovy/org/grails/plugins/web/GroovyPagesGrailsPlugin.groovy

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class GroovyPagesGrailsPlugin extends Plugin {
101101
Closure doWithSpring() {{->
102102
def application = grailsApplication
103103
Config config = application.config
104-
boolean developmentMode = Metadata.getCurrent().isDevelopmentEnvironmentAvailable()
104+
boolean developmentMode = isDevelopmentMode()
105105
Environment env = Environment.current
106106

107107
boolean enableReload = env.isReloadEnabled() ||
@@ -270,6 +270,10 @@ class GroovyPagesGrailsPlugin extends Plugin {
270270
}
271271
}}
272272

273+
protected boolean isDevelopmentMode() {
274+
Metadata.getCurrent().isDevelopmentEnvironmentAvailable()
275+
}
276+
273277
static String transformToValidLocation(String location) {
274278
if (location == '.') return location
275279
if (!location.endsWith(File.separator)) return "${location}${File.separator}"

grails-test-suite-uber/src/test/groovy/org/grails/plugins/web/ControllersGrailsPluginTests.groovy

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,13 @@ class FormTagLib {
104104
void testBeansWhenNotWarDeployedAndDevelopmentEnv() {
105105
try {
106106
System.setProperty("grails.env", "development")
107-
def plugin = new GroovyPagesGrailsPlugin()
107+
def plugin = new GroovyPagesGrailsPlugin() {
108+
@Override
109+
protected boolean isDevelopmentMode() {
110+
return true
111+
}
112+
}
113+
108114
plugin.grailsApplication = new DefaultGrailsApplication() {
109115
@Override
110116
boolean isWarDeployed() {

0 commit comments

Comments
 (0)