views:

32

answers:

2

We want to unit-test http-proxy related code. Is there a Java package which can simulate a http proxy?

+1  A: 

Unit tests should be as simple as possible. Instead of testing against a real proxy, record the data streams which you get against a real proxy. Save those in strings or files and then run your unit tests against those.

Aaron Digulla
+2  A: 

The JMeter Library has got a http proxy server you can use in several ways. We use it for exactly the same thing you want to do.

http://jakarta.apache.org/jmeter/

Ignore the graphical interface if you want to automate the test.

Regards.

Raul Lapeira Herrero