Scenario: Each time I run a Java batch job for testing all the configuration and bootstrap applications need to load. This includes logging, hibernate type registration, global properties etc. This can take up to 3 minutes and if I'm busy iterating different tests and run 10 batch jobs this can waste 30 minutes. Normally this is all contained within a Websphere server but that is way too heavy to restart and re-upload ears for testing purposes.
So far I've looked at Sockets and RMI as options to put the configuration in. For example an RMI server providing configuration as a singleton instance that my tests running in separate JVMs can access. I'm not convinced this is the best way as there is poor documentation on these methods and there seems to be problems getting all dependencies on the classpath for RMI (this application is broken into at least 20 projects).
Is there any best practices for making a configuration stack available to unit tests that can be accesses by separate JVMs? Each time you start a new jUnit test it is ran in a separate JVM and will normally have to create all the configuration every time, I want to run the configuration once and make it available to all unit tests.