Skip to content

Commit bd491e2

Browse files
committed
Fix tests / upgrade dependencies
1 parent 03746ee commit bd491e2

File tree

5 files changed

+29
-10
lines changed

5 files changed

+29
-10
lines changed

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ ext {
3434
commonsCollectionsVersion = "3.2.1"
3535
commonsIOVersion = "2.2"
3636
commonsLangVersion = "2.6"
37-
datastoreVersion = "6.0.8.BUILD-SNAPSHOT"
37+
datastoreVersion = "6.0.8.RELEASE"
3838
gdocEngineVersion = "1.0.1"
3939
groovyVersion = System.getenv('CI_GROOVY_VERSION') ?: "2.4.9"
4040
ivyVersion = "2.3.0"
@@ -49,7 +49,7 @@ ext {
4949
springBootVersion = "1.4.4.RELEASE"
5050
springLoadedVersion = "1.2.6.RELEASE"
5151
springLoadedCommonOptions = "-Xverify:none -Dspringloaded.synchronize=true -Djdk.reflect.allowGetCallerClass=true"
52-
springVersion = "4.3.6.RELEASE"
52+
springVersion = "4.3.7.RELEASE"
5353
ehcacheVersion = "2.4.6"
5454
junitVersion = "4.12"
5555
concurrentlinkedhashmapVersion = "1.4.2"

grails-bom/plugins.properties

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
hibernate4=6.0.8.BUILD-SNAPSHOT
2-
hibernate5=6.0.8.BUILD-SNAPSHOT
3-
mongodb=6.0.8.BUILD-SNAPSHOT
1+
hibernate4=6.0.8
2+
hibernate5=6.0.8
3+
mongodb=6.0.8
44
rx-gorm-rest-client=1.0.4.RELEASE
5-
rx-mongodb=6.0.8.BUILD-SNAPSHOT
6-
neo4j=6.0.8.BUILD-SNAPSHOT
5+
rx-mongodb=6.0.8
6+
neo4j=6.0.8
77
cache=3.0.3
88
asset-pipeline=3.2.1
99
asset-pipeline-grails=2.11.6
1010
scaffolding=3.2.1
1111
fields=2.1.3
1212
geb=1.0.2
13-
rxjava=1.0.1
13+
rxjava=1.1.0
1414
views-json=1.1.5
1515
views-json-templates=1.1.5
1616
views-markup=1.1.5

grails-bootstrap/src/main/groovy/grails/util/Environment.java

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,11 +260,20 @@ private void initialize() {
260260
* @return The current environment.
261261
*/
262262
public static Environment getCurrent() {
263+
String envName = System.getProperty(Environment.KEY);
264+
Environment env;
265+
if(!isBlank(envName)) {
266+
env = getEnvironment(envName);
267+
if(env != null) {
268+
return env;
269+
}
270+
}
271+
272+
263273
Environment current = cachedCurrentEnvironment.get();
264274
if (current != null) {
265275
return current;
266276
}
267-
268277
return cacheCurrentEnvironment();
269278
}
270279

@@ -311,6 +320,14 @@ public static Environment getCurrentEnvironment() {
311320
return getCurrent();
312321
}
313322

323+
/**
324+
* Reset the current environment
325+
*/
326+
public static void reset() {
327+
cachedCurrentEnvironment.set(null);
328+
Metadata.reset();
329+
}
330+
314331
/**
315332
* Returns true if the application is running in development mode (within grails run-app)
316333
*

grails-bootstrap/src/test/groovy/grails/util/EnvironmentTests.groovy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ class EnvironmentTests extends GroovyTestCase {
1212
System.setProperty(Environment.RELOAD_LOCATION, "")
1313

1414
Metadata.reset()
15+
Environment.reset()
1516
}
1617

1718
void testExecuteForEnvironment() {
@@ -176,6 +177,7 @@ grails:
176177
assertEquals Environment.PRODUCTION, Environment.getCurrent()
177178

178179
Metadata.getInstance(new ByteArrayInputStream(''.bytes))
180+
Environment.reset()
179181
assertEquals Environment.DEVELOPMENT, Environment.getCurrent()
180182
}
181183

grails-web-url-mappings/src/test/groovy/org/grails/web/mapping/mvc/UrlMappingsHandlerMappingSpec.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ class UrlMappingsHandlerMappingSpec extends AbstractUrlMappingsSpec {
158158
def result = handlerAdapter.handle(request, webRequest.response, handlerChain.handler)
159159

160160
then:"The model and view is correct"
161-
result.viewName == '/foo/fooBar'
161+
result.viewName == 'fooBar'
162162
!result.model
163163

164164
}

0 commit comments

Comments
 (0)