I've completed the refactoring of all of the Resteasy tests to incoporate support for a configurable port number. The logic is encapsulated into org.jboss.resteasy.test.TestPortProvider. This class first looks for an environment variable named RESTEASY_PORT, then a system property named org.jboss.resteasy.port, and if neither exist or are unparseable, falls back to port 8081.
I created utility methods in TestPortProvider for all the cases I ran into (createGetMethod, createPostMethod, createURL, createURI, createProxy, etc. etc.).
Please let me know if you run into trouble.
VP, Platform Engineering
MTV Networks Digital