Skip to content
Browse files

fix failing test

  • Loading branch information...
1 parent 8cd50d2 commit ba77c1be24538d86dc21aedd4d9e19373ed13ffc @graemerocher graemerocher committed May 9, 2012
Showing with 21 additions and 31 deletions.
  1. +21 −31 grails-test-suite-uber/src/test/groovy/grails/spring/BeanBuilderTests.groovy
View
52 grails-test-suite-uber/src/test/groovy/grails/spring/BeanBuilderTests.groovy
@@ -139,30 +139,28 @@ class BeanBuilderTests extends GroovyTestCase {
void testUseTwoSpringNamespaces() {
- SimpleNamingContextBuilder builder = new SimpleNamingContextBuilder()
- try {
-
- builder.bind("bar", "success")
- builder.activate()
TestScope scope = new TestScope()
GenericApplicationContext appCtx = bb.getSpringConfig().getUnrefreshedApplicationContext()
appCtx.getBeanFactory().registerScope("test", scope)
bb.beans {
xmlns aop:"http://www.springframework.org/schema/aop"
- xmlns jee:"http://www.springframework.org/schema/jee"
+ xmlns util:"http://www.springframework.org/schema/util"
scopedList(ArrayList) { bean ->
bean.scope = "test"
aop.'scoped-proxy'()
}
- jee.'jndi-lookup'(id:"foo", 'jndi-name':"bar")
+ util.list(id:"foo") {
+ value "one"
+ value "two"
+ }
}
appCtx = bb.createApplicationContext()
- assertEquals "success", appCtx.getBean("foo")
+ assert ['one', 'two'] == appCtx.getBean("foo")
assertNotNull appCtx.getBean("scopedList")
assertNotNull appCtx.getBean("scopedList").size()
@@ -177,29 +175,28 @@ class BeanBuilderTests extends GroovyTestCase {
appCtx.getBeanFactory().registerScope("test", scope)
bb.beans {
xmlns aop:"http://www.springframework.org/schema/aop",
- jee:"http://www.springframework.org/schema/jee"
+ util:"http://www.springframework.org/schema/util"
scopedList(ArrayList) { bean ->
bean.scope = "test"
aop.'scoped-proxy'()
}
- jee.'jndi-lookup'(id:"foo", 'jndi-name':"bar")
+ util.list(id:"foo") {
+ value "one"
+ value "two"
+ }
}
appCtx = bb.createApplicationContext()
- assertEquals "success", appCtx.getBean("foo")
+ assert ['one', 'two'] == appCtx.getBean("foo")
assertNotNull appCtx.getBean("scopedList")
assertNotNull appCtx.getBean("scopedList").size()
assertNotNull appCtx.getBean("scopedList").size()
// should only be true because bean not initialized until proxy called
assertEquals 4, scope.instanceCount
- }
- finally {
- builder.deactivate()
- }
}
void testSpringAOPSupport() {
@@ -256,25 +253,18 @@ class BeanBuilderTests extends GroovyTestCase {
}
void testSpringNamespaceBean() {
-
- SimpleNamingContextBuilder builder = new SimpleNamingContextBuilder()
- try {
-
- builder.bind("bar", "success")
- builder.activate()
-
- bb.beans {
- xmlns jee:"http://www.springframework.org/schema/jee"
- jee.'jndi-lookup'(id:"foo", 'jndi-name':"bar")
+ bb.beans {
+ xmlns util:"http://www.springframework.org/schema/util"
+ util.list(id:"foo") {
+ value "one"
+ value "two"
}
- ApplicationContext appCtx = bb.createApplicationContext()
-
- assertEquals "success", appCtx.getBean("foo")
- }
- finally {
- builder.deactivate()
}
+
+ ApplicationContext appCtx = bb.createApplicationContext()
+
+ assert ['one', 'two'] == appCtx.getBean("foo")
}
void testNamedArgumentConstructor() {

0 comments on commit ba77c1b

Please sign in to comment.
Something went wrong with that request. Please try again.