2

to test my program against webpages, which change quite often, I need to mock the answers. I've found FakeWeb for Ruby, which would be a good starting point. Unfortunately, there seems to be no library, which provides similar functionality for Java.

So, my question is: How can I "record" requests and response pairs and "replay" them later, so that my application always receives the same webpages. To make things even more difficult, it should work for PUT and GET methods too.

Thanks in advance for any answer.

Regards, Daniel

Daniel
  • 91
  • 2
  • 4
  • I don't get it - what is your application, and why you want to test it against something that is not up-to-date ? – Bozho Feb 23 '10 at 09:18
  • Why don't you test the parsing of the content in isolation of the retrieving of the content? That way you don't need some elaborate setup, but simply can feed your methods some hard-coded data (or maybe load it from files). – Joachim Sauer Feb 23 '10 at 09:28

2 Answers2

0

The great java alternative of FakeWeb is http://jadler.net. It is (imho) even more capable, e.g. it supports mocking based on different request bodies for the same url.

Juraj Martinka
  • 2,691
  • 2
  • 18
  • 20
-1

A common web application testing tool is JMeter

Bruno Grieder
  • 22,490
  • 7
  • 57
  • 88