I think I encountered an error with the settings of my class.
I want to test an internationalized web application that has a message source like this:
<bean id="messageSource"
class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
<property name="basenames">
<list>
<value>/WEB-INF/i18n/errors</value>
<value>/WEB-INF/i18n/messages</value>
<value>/WEB-INF/i18n/links</value>
<value>/WEB-INF/i18n/forms</value>
<value>/WEB-INF/i18n/communication</value>
</list>
</property>
</bean>
Loading these values ββworks fine in a production environment. However, when running the Junit test, it cannot resolve these property files because they are not in the classpath.
However, I want them NOT to be in the classpath, because then I can use a function where I can change something in the property files, and this immediately reflected on the website: Since application servers typically cache all files loaded from the classpath, it is necessary to store resources somewhere else (for example, in the "WEB-INF" directory of a web app). Otherwise changes of files in the classpath will not be reflected in the application.
and uploaded to the Junit test with these annotations:
@https://stackoverflow.com/runWith(SpringJUnit4Classhttps://stackoverflow.com/runner.class)
@ContextConfiguration(locations = {"classpath:/spring/applicationContext.xml"})
How can I get Junit to pick up these non classpath resources? Property files are on/src/main/webapp/WEB-INF/i18n/*
Junit: 4.7.
Spring: 3.0.5.