I'm experimenting with using the Cactus Jetty integration, as per http://jakarta.apache.org/cactus/integration/integration_jetty.html, to unit-test JSPs and JSP2 tag files. So far so good - works great, and about a hundred times quicker than my previous method of deploying a WAR and using HttpUnit. However, I have a some questions:
The way that the Jetty server is started and stopped is with a custom TestSuite (JettyTestSuite) - so I have to make a decision in my code about when I want the server started and stopped.
I can write a test suite that runs the entire set of JSP tests (starting Jetty once when the suite starts), or I can write a suite() method on each test class (starting Jetty once per class when I run all of them), or I can write intermediate-sized suites that run some, but not all, of my test classes.
But what I'd like to be able to do is have more dynamic control than this. For example,
- when I run the full suite and get 1 failure, I'd like to be able to run just that one individual test method without even the rest of it's class.
- I'd like to not have to remember to add a suite() method to every new JSP test class I write, or remember to have to add a reference to each new test class to an 'AllJSPTests' class
- when I run the full test suite I only want Jetty to start up once, but I'd still like to be able to run individual classes and have them start and stop Jetty for me.
I suppose that some of this functionality might be in the provided by the Eclipse plugin (I'm using 3.0 M8+) so perhaps one way to meet my needs would be for me to help fix that, but I wonder if this is a problem that anyone else has experienced and/or worked around, and that might have a solution which is not IDE-specific.
It seems to me that perhaps it would be possible to write a custom extension to TestCase, with a smart setUp/tearDown that could start/stop jetty only if necessary. Does that sound like it would work?
Thanks in advance
Chris
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
