[RESTORED] Spring Support: Implement Spring-specific references
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
// ELEMENT: singleton
|
||||
package test
|
||||
|
||||
import org.springframework.context.annotation.Scope
|
||||
|
||||
@Scope("<caret>")
|
||||
class ScopedBean
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// ELEMENT: singleton
|
||||
package test
|
||||
|
||||
import org.springframework.context.annotation.Scope
|
||||
|
||||
@Scope("singleton")
|
||||
class ScopedBean
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans>
|
||||
<bean id="fooBean" class="java.lang.String"/>
|
||||
<bean id="barBean" class="java.lang.String"/>
|
||||
<bean id="scopedBean" class="test.ScopedBean"/>
|
||||
</beans>
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// ELEMENT: fooBean
|
||||
// CHAR: \n
|
||||
import org.springframework.beans.factory.BeanFactory
|
||||
import org.springframework.beans.factory.xml.XmlBeanFactory
|
||||
import org.springframework.core.io.FileSystemResource
|
||||
import org.springframework.core.io.Resource
|
||||
|
||||
class FooBeanClass {
|
||||
init {
|
||||
val configFile = FileSystemResource("spring-config.xml")
|
||||
val factory = XmlBeanFactory(configFile)
|
||||
factory.getBean("fo<caret>o")
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// ELEMENT: fooBean
|
||||
// CHAR: \n
|
||||
import org.springframework.beans.factory.BeanFactory
|
||||
import org.springframework.beans.factory.xml.XmlBeanFactory
|
||||
import org.springframework.core.io.FileSystemResource
|
||||
import org.springframework.core.io.Resource
|
||||
|
||||
class FooBeanClass {
|
||||
init {
|
||||
val configFile = FileSystemResource("spring-config.xml")
|
||||
val factory = XmlBeanFactory(configFile)
|
||||
factory.getBean("fooBeano")
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// ELEMENT: fooBean
|
||||
// CHAR: \t
|
||||
import org.springframework.beans.factory.BeanFactory
|
||||
import org.springframework.beans.factory.xml.XmlBeanFactory
|
||||
import org.springframework.core.io.FileSystemResource
|
||||
import org.springframework.core.io.Resource
|
||||
|
||||
class FooBeanClass {
|
||||
init {
|
||||
val configFile = FileSystemResource("spring-config.xml")
|
||||
val factory = XmlBeanFactory(configFile)
|
||||
factory.getBean("fo<caret>o")
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// ELEMENT: fooBean
|
||||
// CHAR: \t
|
||||
import org.springframework.beans.factory.BeanFactory
|
||||
import org.springframework.beans.factory.xml.XmlBeanFactory
|
||||
import org.springframework.core.io.FileSystemResource
|
||||
import org.springframework.core.io.Resource
|
||||
|
||||
class FooBeanClass {
|
||||
init {
|
||||
val configFile = FileSystemResource("spring-config.xml")
|
||||
val factory = XmlBeanFactory(configFile)
|
||||
factory.getBean("fooBean")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// NUMBER: 2
|
||||
// EXIST: { lookupString:"singleton" }
|
||||
// EXIST: { lookupString:"prototype" }
|
||||
package test
|
||||
|
||||
import org.springframework.context.annotation.Scope
|
||||
|
||||
@Scope("<caret>")
|
||||
class ScopedBean
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans>
|
||||
<bean id="fooBean" class="java.lang.String"/>
|
||||
<bean id="fooBean2" class="java.lang.String"/>
|
||||
<bean id="barBean" class="java.lang.String"/>
|
||||
<bean id="scopedBean" class="test.ScopedBean"/>
|
||||
</beans>
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
// NUMBER: 2
|
||||
// EXIST: { lookupString:"fooBean" }
|
||||
// EXIST: { lookupString:"fooBean2" }
|
||||
import org.springframework.beans.factory.BeanFactory
|
||||
import org.springframework.beans.factory.xml.XmlBeanFactory
|
||||
import org.springframework.core.io.FileSystemResource
|
||||
import org.springframework.core.io.Resource
|
||||
|
||||
class FooBeanClass {
|
||||
init {
|
||||
val configFile = FileSystemResource("spring-config.xml")
|
||||
val factory = XmlBeanFactory(configFile)
|
||||
factory.getBean("fo<caret>o")
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// NO_XML_CONFIG
|
||||
// REF: /src.fileReferenceInClasspathResource.test.xml
|
||||
import org.springframework.core.io.ClassPathResource
|
||||
|
||||
class Bean {
|
||||
init {
|
||||
ClassPathResource("<caret>fileReferenceInClasspathResource.test.xml")
|
||||
}
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
<test>
|
||||
<foo/>
|
||||
</test>
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// NO_XML_CONFIG
|
||||
// REF: /src.fileReferenceInClasspathXmlContext.test.xml
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext
|
||||
|
||||
class Bean {
|
||||
init {
|
||||
ClassPathXmlApplicationContext("<caret>fileReferenceInClasspathXmlContext.test.xml")
|
||||
}
|
||||
}
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
<test>
|
||||
<foo/>
|
||||
</test>
|
||||
@@ -0,0 +1,7 @@
|
||||
// REF: singleton
|
||||
package test
|
||||
|
||||
import org.springframework.context.annotation.Scope
|
||||
|
||||
@Scope("<caret>singleton")
|
||||
class Bean
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans>
|
||||
<bean id="fooBean" class="test.Bean"/>
|
||||
</beans>
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// REF: <bean id="fooBean" class="java.lang.String"/>
|
||||
import org.springframework.beans.factory.BeanFactory
|
||||
import org.springframework.beans.factory.xml.XmlBeanFactory
|
||||
import org.springframework.core.io.FileSystemResource
|
||||
import org.springframework.core.io.Resource
|
||||
|
||||
class FooBeanClass {
|
||||
init {
|
||||
val configFile = FileSystemResource("spring-config.xml")
|
||||
val factory = XmlBeanFactory(configFile)
|
||||
if (factory.containsBean("<caret>fooBean")) println("FooBean")
|
||||
}
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans>
|
||||
<bean id="fooBean" class="java.lang.String"/>
|
||||
</beans>
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// REF: <bean id="fooBean" class="java.lang.String"/>
|
||||
import org.springframework.beans.factory.BeanFactory
|
||||
import org.springframework.beans.factory.xml.XmlBeanFactory
|
||||
import org.springframework.core.io.FileSystemResource
|
||||
import org.springframework.core.io.Resource
|
||||
|
||||
class FooBeanClass {
|
||||
init {
|
||||
val configFile = FileSystemResource("spring-config.xml")
|
||||
val factory = XmlBeanFactory(configFile)
|
||||
factory.getBean("<caret>fooBean")
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans>
|
||||
<bean id="fooBean" class="java.lang.String"/>
|
||||
</beans>
|
||||
@@ -0,0 +1,11 @@
|
||||
// JAVAX_ANNOTATION_RESOURCE
|
||||
// REF: <bean id="fooBean" class="test.Bean"/>
|
||||
package test
|
||||
|
||||
import javax.annotation.Resource
|
||||
|
||||
class Bean
|
||||
|
||||
class Test {
|
||||
@Resource(name= "<caret>fooBean") lateinit var name: String
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans>
|
||||
<bean id="fooBean" class="test.Bean"/>
|
||||
</beans>
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// JAVAX_ANNOTATION_RESOURCE
|
||||
// REF: <bean id="fooBean" class="test.Bean"/>
|
||||
package test
|
||||
|
||||
import javax.annotation.Resource
|
||||
|
||||
class Bean
|
||||
|
||||
class Test {
|
||||
@Resource(name= "<caret>&fooBean") lateinit var name: String
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans>
|
||||
<bean id="fooBean" class="test.Bean"/>
|
||||
</beans>
|
||||
Reference in New Issue
Block a user