0 Replies Latest reply on Jun 15, 2005 9:22 PM by Derek Ealy

    JUnit testing of XMBeans, is it possible?

    Derek Ealy Newbie

      Hi,

      I'm working on a JMX service and have several XMBeans which work together and communicate with each other. I've decided that I'd like to write some unit tests for the underlying classes, but haven't been able to figure out how to accomplish this yet.

      Since I don't want to expose all of the internals of these XMBeans via JMX I thought it would be sufficient to create a standalone MBeanServer in my JUnit test app, and then create and register my XMBeans within that standalone server. But I am unable to do this because my XMBeans use the Delegating persistence manager. So when the MBeanServer tries to register them, an exception is thrown because there is no instance of the AttributePersistenceService running in my standalone MBeanServer.

      Is anyone creating unit tests for their XMBeans?

      Is there a way that I can programmatically have the XMBean disable persistence before I register with the MBeanServer?

      Any other suggestions?

      Thanks, Derek