测试Hessian remoting-servlet.xml [英] Testing Hessian remoting-servlet.xml

查看:281
本文介绍了测试Hessian remoting-servlet.xml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用Hessian进行富客户端和服务器之间的通信。

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

由于移动和重命名,它不时发生在远程处理中的条目 - servlet.xml与实际的类名不匹配。

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.

因此我正在寻找一种简单的方法来测试远程xml。

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

有没有一种简单的方法可以做到这一点?最好不要手动解析xml并尝试实例化那里提到的所有类。

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

推荐答案

我们现在在测试中创建一个Spring BeanFactory :

We now create a Spring BeanFactory in a test:

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

并尝试创建每个已配置的bean:

And try to create each configured bean:

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

工作不错

这篇关于测试Hessian remoting-servlet.xml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆