Search code examples
javatestinghessian

Testing Hessian remoting-servlet.xml


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.


Solution

  • 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