Yay çatısı için yeni. Fasulyeleri yüklerken başvurulan xml dosyalarının listesini öğrenmeye çalışıyorum.İlkbahar projesinde bir fasulyenin yüklendiği kaynağı nasıl öğrenebilirim.
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:spring/sample-testcontext.xml")
public class SampleClass implements ApplicationContextAware {
@Autowired
ApplicationContext applicationContext;
@Test
public void testMethod() {
for (String beanName : applicationContext.getBeanDefinitionNames()) {
System.out.println("BeanName " + beanName);
}
}
}
Ama konfigürasyon fasulye yüklenir dosyaları hangi bilmek istiyorum: ApplicationContextAware olan bir sınıf yazarak
i ile fasulye listesini görmek mümkün.Say "örnek-testcontext.xml"
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd">
<beans:import resource="classpath*:spring/sample-testOneMorecontext.xml"/>
</beans:beans>
Ben fasulye "örnek-testOneMorecontext.xml" ve "örnek-testcontext.xml" olarak yüklenir hangi dosya adlarının listesini bilmek istiyorum içerir.