Polish GroovyBeanDefinitionReader formatting
Consistent use of tabs and remove trailing whitespace. Issue: SPR-7123
This commit is contained in:
@@ -23,27 +23,27 @@ import org.springframework.context.support.GenericGroovyApplicationContext
|
||||
* @author Jeff Brown
|
||||
*/
|
||||
class GroovyApplicationContextDynamicBeanPropertyTests extends GroovyTestCase {
|
||||
|
||||
void testAccessDynamicBeanProperties() {
|
||||
def ctx = new GenericGroovyApplicationContext();
|
||||
ctx.reader.loadBeanDefinitions("org/springframework/context/groovy/applicationContext.groovy");
|
||||
ctx.refresh()
|
||||
|
||||
def framework = ctx.framework
|
||||
assertNotNull 'could not find framework bean', framework
|
||||
assertEquals 'Grails', framework
|
||||
}
|
||||
|
||||
void testAccessingNonExistentBeanViaDynamicProperty() {
|
||||
void testAccessDynamicBeanProperties() {
|
||||
def ctx = new GenericGroovyApplicationContext();
|
||||
ctx.reader.loadBeanDefinitions("org/springframework/context/groovy/applicationContext.groovy");
|
||||
ctx.refresh()
|
||||
|
||||
def err = shouldFail(NoSuchBeanDefinitionException) {
|
||||
ctx.someNonExistentBean
|
||||
}
|
||||
|
||||
assertEquals "No bean named 'someNonExistentBean' is defined", err
|
||||
}
|
||||
def framework = ctx.framework
|
||||
assertNotNull 'could not find framework bean', framework
|
||||
assertEquals 'Grails', framework
|
||||
}
|
||||
|
||||
void testAccessingNonExistentBeanViaDynamicProperty() {
|
||||
def ctx = new GenericGroovyApplicationContext();
|
||||
ctx.reader.loadBeanDefinitions("org/springframework/context/groovy/applicationContext.groovy");
|
||||
ctx.refresh()
|
||||
|
||||
def err = shouldFail(NoSuchBeanDefinitionException) {
|
||||
ctx.someNonExistentBean
|
||||
}
|
||||
|
||||
assertEquals "No bean named 'someNonExistentBean' is defined", err
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -35,32 +35,32 @@ public class GroovyApplicationContextTests extends TestCase {
|
||||
assertEquals("Grails", framework);
|
||||
}
|
||||
|
||||
public void testLoadingMultipleConfigFiles() {
|
||||
public void testLoadingMultipleConfigFiles() {
|
||||
GenericGroovyApplicationContext ctx = new GenericGroovyApplicationContext(
|
||||
"org/springframework/context/groovy/applicationContext2.groovy",
|
||||
"org/springframework/context/groovy/applicationContext.groovy");
|
||||
|
||||
Object framework = ctx.getBean("framework");
|
||||
assertNotNull("could not find framework bean", framework);
|
||||
assertEquals("Grails", framework);
|
||||
Object framework = ctx.getBean("framework");
|
||||
assertNotNull("could not find framework bean", framework);
|
||||
assertEquals("Grails", framework);
|
||||
|
||||
Object company = ctx.getBean("company");
|
||||
assertNotNull("could not find company bean", company);
|
||||
assertEquals("SpringSource", company);
|
||||
}
|
||||
Object company = ctx.getBean("company");
|
||||
assertNotNull("could not find company bean", company);
|
||||
assertEquals("SpringSource", company);
|
||||
}
|
||||
|
||||
public void testLoadingMultipleConfigFilesWithRelativeClass() {
|
||||
public void testLoadingMultipleConfigFilesWithRelativeClass() {
|
||||
GenericGroovyApplicationContext ctx = new GenericGroovyApplicationContext();
|
||||
ctx.load(GroovyApplicationContextTests.class, "applicationContext2.groovy", "applicationContext.groovy");
|
||||
ctx.refresh();
|
||||
|
||||
Object framework = ctx.getBean("framework");
|
||||
assertNotNull("could not find framework bean", framework);
|
||||
assertEquals("Grails", framework);
|
||||
Object framework = ctx.getBean("framework");
|
||||
assertNotNull("could not find framework bean", framework);
|
||||
assertEquals("Grails", framework);
|
||||
|
||||
Object company = ctx.getBean("company");
|
||||
assertNotNull("could not find company bean", company);
|
||||
assertEquals("SpringSource", company);
|
||||
}
|
||||
Object company = ctx.getBean("company");
|
||||
assertNotNull("could not find company bean", company);
|
||||
assertEquals("SpringSource", company);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user