开发者

Testing a http-client

This project uses http clilent libraries to poll a http server for an xml file containing data gathered from hardware. Polling happens relatively fast. The data changes with time. Only one xml file is polled ever.

Is there a testing method/tool that can be used as the http server and feed the client an xml file based on the time it is polled?

Basically, what I'm trying to do is send xml data that may change on each poll. Each version of data is pre-determined for testing.

An idea I've thought is having a log rotator script cron'ed at polling frequency to check out and replace each version of the data into /var/log/www and let apache handle the rest. However, this does not tightly control which version will be served when it is polled as network delay may cause files to be replaced before the data is served. 开发者_开发问答Each version of the data must be served and no versions may be skipped.

Any solutions/thoughts/methods/ideas will be appreciated.

Thanks


If you are attempting to perform Unit tests of specific functionality, I would suggest mocking the HTTP response and go from there. Relatively easy to setup and then very easy to modify.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜