@Nullable public Object getProperty(String property) { if (containsBean(property)) { return getBean(property); } else if (this.contextWrapper.isReadableProperty(property)) { return this.contextWrapper.getPropertyValue(property); } throw new NoSuchBeanDefinitionException(property); }
@Nullable public Object getProperty(String property) { if (containsBean(property)) { return getBean(property); } else if (this.contextWrapper.isReadableProperty(property)) { return this.contextWrapper.getPropertyValue(property); } throw new NoSuchBeanDefinitionException(property); }
@Test 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 company = ctx.getBean("company"); assertNotNull("could not find company bean", company); assertEquals("SpringSource", company); }
@Test 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 company = ctx.getBean("company"); assertNotNull("could not find company bean", company); assertEquals("SpringSource", company); }
@Test public void testLoadingConfigFile() { GenericGroovyApplicationContext ctx = new GenericGroovyApplicationContext( "org/springframework/context/groovy/applicationContext.groovy"); Object framework = ctx.getBean("framework"); assertNotNull("could not find framework bean", framework); assertEquals("Grails", framework); }
@Nullable public Object getProperty(String property) { if (containsBean(property)) { return getBean(property); } else if (this.contextWrapper.isReadableProperty(property)) { return this.contextWrapper.getPropertyValue(property); } throw new NoSuchBeanDefinitionException(property); }