Testing Hessian remoting-servlet.xml

大兔子大兔子 提交于 2019-12-07 08:13:23

问题


We are using Hessian for communication between a rich client and a server.

Due to moving and renaming it happens from time to time that the entries in the remoting-servlet.xml don't match the actual class names.

Therefor I'm looking for an easy way to test the remoting xml.

Is there an easy way to do that? Preferable without manually parsing the xml and trying to instantiate all classes mentioned in there.


回答1:


We now create a Spring BeanFactory in a test:

private final BeanFactory factory =
        new XmlBeanFactory(new FileSystemResource("remoting-servlet.xml"));

And try to create each configured bean:

assertNotNull(factory.getBean("beanName"));

Works nice



来源:https://stackoverflow.com/questions/4783411/testing-hessian-remoting-servlet-xml

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!