RESOLVED - issue SPR-4783: Add name attribute to all namespaces that use AbstractBeanDefinitionParser and declare name= attribute (includes <lang:groovy.../>).
This commit is contained in:
parent
1a9599c815
commit
dec2ca30c2
|
|
@ -87,6 +87,13 @@
|
||||||
]]></xsd:documentation>
|
]]></xsd:documentation>
|
||||||
</xsd:annotation>
|
</xsd:annotation>
|
||||||
</xsd:attribute>
|
</xsd:attribute>
|
||||||
|
<xsd:attribute name="name" type="xsd:string">
|
||||||
|
<xsd:annotation>
|
||||||
|
<xsd:documentation><![CDATA[
|
||||||
|
The name of this scripted bean as an alias or replacement for the id.
|
||||||
|
]]></xsd:documentation>
|
||||||
|
</xsd:annotation>
|
||||||
|
</xsd:attribute>
|
||||||
<xsd:attribute name="scope" type="xsd:string">
|
<xsd:attribute name="scope" type="xsd:string">
|
||||||
<xsd:annotation>
|
<xsd:annotation>
|
||||||
<xsd:documentation><![CDATA[
|
<xsd:documentation><![CDATA[
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Mark Fisher
|
* @author Mark Fisher
|
||||||
|
* @author Dave Syer
|
||||||
*/
|
*/
|
||||||
public class ScriptingDefaultsTests extends TestCase {
|
public class ScriptingDefaultsTests extends TestCase {
|
||||||
|
|
||||||
|
|
@ -51,6 +52,12 @@ public class ScriptingDefaultsTests extends TestCase {
|
||||||
assertTrue(testBean.isInitialized());
|
assertTrue(testBean.isInitialized());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testNameAsAlias() {
|
||||||
|
ApplicationContext context = new ClassPathXmlApplicationContext(CONFIG);
|
||||||
|
ITestBean testBean = (ITestBean) context.getBean("/url");
|
||||||
|
assertTrue(testBean.isInitialized());
|
||||||
|
}
|
||||||
|
|
||||||
public void testDefaultDestroyMethod() {
|
public void testDefaultDestroyMethod() {
|
||||||
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(CONFIG);
|
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(CONFIG);
|
||||||
ITestBean testBean = (ITestBean) context.getBean("nonRefreshableTestBean");
|
ITestBean testBean = (ITestBean) context.getBean("nonRefreshableTestBean");
|
||||||
|
|
|
||||||
|
|
@ -5,14 +5,14 @@
|
||||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||||
http://www.springframework.org/schema/beans/spring-beans.xsd
|
http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||||
http://www.springframework.org/schema/lang
|
http://www.springframework.org/schema/lang
|
||||||
http://www.springframework.org/schema/lang/spring-lang.xsd"
|
http://www.springframework.org/schema/lang/spring-lang-3.0.xsd"
|
||||||
default-autowire="byName"
|
default-autowire="byName"
|
||||||
default-init-method="startup"
|
default-init-method="startup"
|
||||||
default-destroy-method="shutdown">
|
default-destroy-method="shutdown">
|
||||||
|
|
||||||
<lang:defaults refresh-check-delay="5000"/>
|
<lang:defaults refresh-check-delay="5000"/>
|
||||||
|
|
||||||
<lang:groovy id="testBean" script-source="classpath:org/springframework/scripting/config/TestBean.groovy"/>
|
<lang:groovy id="testBean" name="/url" script-source="classpath:org/springframework/scripting/config/TestBean.groovy"/>
|
||||||
|
|
||||||
<lang:groovy id="nonRefreshableTestBean" refresh-check-delay="-1"
|
<lang:groovy id="nonRefreshableTestBean" refresh-check-delay="-1"
|
||||||
script-source="classpath:org/springframework/scripting/config/TestBean.groovy"/>
|
script-source="classpath:org/springframework/scripting/config/TestBean.groovy"/>
|
||||||
Loading…
Reference in New Issue