我在test-appContext.xml文件中具有以下配置,以支持执行Spring集成测试。
<bean id="cacheManagerConfig" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
<property name="configLocation" value="file:/web/${websphere.env}/${websphere.Domain}/${websphere.Name}/myportal/config/ehcache.xml"/>
</bean>
我正在将带有弹簧4的junit 4.12用于MVC流的集成测试。在Spring集成测试中如何处理ehcache.xml文件路径。
谢谢:)
[我得到了解决方案,作为从系统属性中检索值的表达式,在Liberty服务器的情况下,该属性是jvm.options文件,因此我在测试用例类中使用了以下代码。
static {
System.setProperty("websphere.env", "test");
System.setProperty("websphere.Domain", "mytestdomain");
System.setProperty("websphere.Name", "mytestdomain");
}
工作正常。