vendredi 29 mai 2015

Minimal JUnit test code to test an AbstractHessianConnection

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:

  1. 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.
  2. 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.
  3. 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