Hi all,
Following this ClientSession class I made this ServerSession.
I am not sure if this class can work since I am a newer on this kind
of development.
Would anyone please give me some suggestion on how to test this ServerSession class?
…
Peter Dimov wrote:
This patch updates the package Http. All files in the package now use Imports.h and Imports.cpp. I deleted the anyway empty classes Uploader and Downloader since they’d better be implemented in the Services layer.
New is the class ClientSession. It is thought to be used for performing HTTP requests. We’ll build on top of this class when implementing Gnutella and BitTorrent transfers. ClientSession uses HeaderReader and HeaderWriter to read/write the HTTP message header. BodyReader and BodyWriter (used to be called FileReader and FileWriter) are used to, logically, read/write the HTTP message body. I decided to rename them since it is not strictly necessary to transfer files only and bodies could be multipart messages. More importantly, I prefer to stick with the terminology used in RFC 2616 (HTTP/1.1): HTTP request/response message, message header, message body, etc.
Finally, I created a tiny test project (Http/HttpTester.pro), which I used to briefly test the current implementation. I consider it very important to start introducing per package functional testing. As the Calitko grows bigger, it would be much more difficult to develop and test new functionality directly in Calitko. We might not know how exactly to integrate a new part until that part works, to some extent at least.
I would like to soon start writing small test environments for each of the existing packages, and all new ones to be initially developed in such a test environment. I’d also like that we start writing unit tests using QtTestLib but I still haven’t figured out how to solve that whole projects mess, which would result from having a number of test projects per package.
