[REVERTED] 0a71eb7 Alexey Sedunov on 2/25/2016 at 14:02 (committed on 3/24/2016 at 18:42)

Spring Support: Implement Spring-specific references
This commit is contained in:
Alexey Sedunov
2016-03-29 17:17:56 +03:00
parent 95f6acdddf
commit ed9b1ac151
45 changed files with 80 additions and 906 deletions
@@ -1,7 +0,0 @@
// ELEMENT: singleton
package test
import org.springframework.context.annotation.Scope
@Scope("<caret>")
class ScopedBean
@@ -1,7 +0,0 @@
// ELEMENT: singleton
package test
import org.springframework.context.annotation.Scope
@Scope("singleton")
class ScopedBean
@@ -1,7 +0,0 @@
<?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>
@@ -1,14 +0,0 @@
// 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")
}
}
@@ -1,14 +0,0 @@
// 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")
}
}
@@ -1,14 +0,0 @@
// 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")
}
}
@@ -1,14 +0,0 @@
// 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")
}
}
@@ -1,9 +0,0 @@
// NUMBER: 2
// EXIST: { lookupString:"singleton" }
// EXIST: { lookupString:"prototype" }
package test
import org.springframework.context.annotation.Scope
@Scope("<caret>")
class ScopedBean
@@ -1,8 +0,0 @@
<?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>
@@ -1,15 +0,0 @@
// 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")
}
}
@@ -1,9 +0,0 @@
// NO_XML_CONFIG
// REF: /src.fileReferenceInClasspathResource.test.xml
import org.springframework.core.io.ClassPathResource
class Bean {
init {
ClassPathResource("<caret>fileReferenceInClasspathResource.test.xml")
}
}
@@ -1,3 +0,0 @@
<test>
<foo/>
</test>
@@ -1,9 +0,0 @@
// NO_XML_CONFIG
// REF: /src.fileReferenceInClasspathXmlContext.test.xml
import org.springframework.context.support.ClassPathXmlApplicationContext
class Bean {
init {
ClassPathXmlApplicationContext("<caret>fileReferenceInClasspathXmlContext.test.xml")
}
}
@@ -1,3 +0,0 @@
<test>
<foo/>
</test>
@@ -1,7 +0,0 @@
// REF: singleton
package test
import org.springframework.context.annotation.Scope
@Scope("<caret>singleton")
class Bean
@@ -1,5 +0,0 @@
<?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>
@@ -1,13 +0,0 @@
// 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")
}
}
@@ -1,5 +0,0 @@
<?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>
@@ -1,13 +0,0 @@
// 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")
}
}
@@ -1,5 +0,0 @@
<?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>
@@ -1,11 +0,0 @@
// 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
}
@@ -1,5 +0,0 @@
<?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>
@@ -1,11 +0,0 @@
// 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
}
@@ -1,5 +0,0 @@
<?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>