Hallo,
ich habe ein Problem bei Konfigurieren von Spring in Verbindung mit JUnit.
In der applicationContext.xml werden properties geladen, die Beim Test nicht gefunden werden.
<bean id="propertyConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>WEB-INF/conf/test/jdbc.properties</value>
<value>WEB-INF/conf/test/hibernate.properties</value>
<value>WEB-INF/conf/test/mail.properties</value>
</list>
</property>
</bean>
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations={"file:WebContent\\WEB-INF\\applicationContext.xml"})
public class TestCasesUserService {
//
}
Bekomme den Fehler:
Caused by: java.io.FileNotFoundException: class path resource [WEB-INF/conf/test/jdbc.properties] cannot be opened because it does not exist
Wie muss ich den Pfad zu den properties angeben?
Gruß
navino
ich habe ein Problem bei Konfigurieren von Spring in Verbindung mit JUnit.
In der applicationContext.xml werden properties geladen, die Beim Test nicht gefunden werden.
<bean id="propertyConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>WEB-INF/conf/test/jdbc.properties</value>
<value>WEB-INF/conf/test/hibernate.properties</value>
<value>WEB-INF/conf/test/mail.properties</value>
</list>
</property>
</bean>
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations={"file:WebContent\\WEB-INF\\applicationContext.xml"})
public class TestCasesUserService {
//
}
Bekomme den Fehler:
Caused by: java.io.FileNotFoundException: class path resource [WEB-INF/conf/test/jdbc.properties] cannot be opened because it does not exist
Wie muss ich den Pfad zu den properties angeben?
Gruß
navino