Adam Hardy on 02/04/08 12:23, wrote:
Can I have a second struts.xml in my test directory, and if so, how do I configure it?

I'm testing some stuff using HttpUnit which launches the whole webapp in my tests. Having a test-only struts.xml will keep the test mappings out of the real webapp, allow me to drop stuff I don't need for the tests, and make the tests faster.

From the lack of replies, I assume the answer is 'No, you cannot have an alternative struts.xml'.

I was checking the low-down on the wiki, where I found that the struts configuration xml can be in multiple files listed by the property in the struts.properties:

### A list of configuration files automatically loaded by Struts
struts.configuration.files=struts-default.xml,struts-plugin.xml,struts.xml

Using this property, I can set up my maven environment to filter struts.properties as a resource and set that property explicitly, so in testing I can have 'struts-test.xml'

This works to a limited extent, i.e. one struts.xml for all testing, another for in-container deployment.

It's not quite ideal though, as I would prefer to choose the struts.xml on a per-test basis.

Does anyone know of something I've missed that allows this?

Thanks
Adam

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to