File tree Expand file tree Collapse file tree 4 files changed +34
-8
lines changed
java/org/codehaus/groovy/grails/web/json
test/org/codehaus/groovy/grails/web/json Expand file tree Collapse file tree 4 files changed +34
-8
lines changed Original file line number Diff line number Diff line change @@ -32,11 +32,7 @@ target ('default': "Load the Grails interactive Swing console") {
3232}
3333
3434target(console :" The console implementation target" ) {
35-
36- // classLoader = new URLClassLoader([classesDir.toURI().toURL()] as URL[], rootLoader)
37- // Thread.currentThread().setContextClassLoader(classLoader)
38- loadApp()
39- configureApp()
35+ depends(loadApp, configureApp)
4036
4137 try {
4238 def console = createConsole()
@@ -55,7 +51,7 @@ target(console:"The console implementation target") {
5551 println " Exiting console"
5652 console. exit()
5753 String scriptText = console. inputArea. text
58- createConsole()
54+ console = createConsole()
5955 println " Restarting console"
6056 console. run()
6157 console. inputArea. addFocusListener(new ConsoleFocusListener (text :scriptText))
Original file line number Diff line number Diff line change @@ -26,6 +26,8 @@ import org.springframework.core.io.FileSystemResourceLoader
2626import org.springframework.mock.web.MockServletContext
2727import org.springframework.web.context.WebApplicationContext
2828import org.springframework.mock.jndi.SimpleNamingContextBuilder
29+ import org.codehaus.groovy.grails.plugins.GrailsPluginManagerFactoryBean
30+ import org.springframework.core.io.FileSystemResource
2931
3032
3133/**
@@ -51,6 +53,12 @@ target(loadApp:"Loads the Grails application object") {
5153 grailsResourceHolder = resourceHolder
5254 }
5355 grailsApplication(org.codehaus.groovy.grails.commons.DefaultGrailsApplication , ref(" grailsResourceLoader" ))
56+
57+ // There is a pluginManager variable in the binding
58+ delegate. " pluginManager" (GrailsPluginManagerFactoryBean ) {
59+ application = grailsApplication
60+ grailsDescriptor = new FileSystemResource (" web-app/WEB-INF/grails.xml" )
61+ }
5462 }
5563 }
5664
Original file line number Diff line number Diff line change @@ -1157,11 +1157,11 @@ public boolean isEmpty() {
11571157 }
11581158
11591159 public boolean containsKey (Object o ) {
1160- return false ;
1160+ return myHashMap . containsKey ( o ) ;
11611161 }
11621162
11631163 public boolean containsValue (Object o ) {
1164- return this .myHashMap .containsKey (o );
1164+ return this .myHashMap .containsValue (o );
11651165 }
11661166
11671167 public Object get (Object o ) {
Original file line number Diff line number Diff line change 1+ package org.codehaus.groovy.grails.web.json
2+
3+ /**
4+ * @author Graeme Rocher
5+ * @since 1.0
6+ */
7+ class JSONObjectTests extends GroovyTestCase {
8+
9+
10+ void testContainsKey () {
11+ JSONObject j = new JSONObject ();
12+ j. put(' test' , 1 )
13+ assert j. containsKey(' test' )
14+ }
15+
16+ void testContainsValue () {
17+ JSONObject j = new JSONObject ();
18+ j. put(' test' , 1 )
19+ assert j. containsValue(1 )
20+
21+ }
22+ }
You can’t perform that action at this time.
0 commit comments