I am endeavouring to write a unit test to (a) prove a theory of a recent outage; and (b) regression test the fix. What this requires me to do a is create a JUnit class that:
- Instantiates a trivial HTTP server (within the same JVM as the JUnit test case is running) which simply returns "403 Forbidden" responses accompanied by a simple error message string.
- Instantiates a trivial Hessian service proxy to "talk" to the HTTP server (the service interface is irrelevant since the server is just going to respond to all requests with 403s.
- Calls the Hessian service proxy repeatedly.
How can I do this in a relatively small number of lines of code? Examples appreciated!
Aucun commentaire:
Enregistrer un commentaire