SpringJUnit4ClassRunner findet die properties aus der applicationContext.xml nicht

navino

Mitglied
Hallo,

ich habe das Problem, das ich mit JUnit Tests nicht weiterkomme, da die properties aus der applicationContext.xml nicht gefunden werden.

So sieht die Testklasse aus:
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"file:C:\\eclipse\\workspace\\myProjekt\WebRoot\\WEB-INF\\applicationContext.xml"})
public class TestCase {
...

und so mache ich das mit den properties-Files in der applicationContext.xml:

<!-- For properties-settings -->
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>/WEB-INF/conf/test/db.properties</value>
<value>/WEB-INF/conf/test/mail.properties</value>
<value>/WEB-INF/conf/test/ldap.properties</value>
</list>
</property>
</bean>

Wie muss ich die Pfade der properties angeben damit die files auch über JUnit gefunden werden.

Viele Grüße
navino
 
Zuletzt bearbeitet:
Zurück