[Yanel-dev] more tests for YanelServlet

Guillaume Déflache guillaume.deflache at wyona.com
Wed Dec 3 12:28:09 CET 2008


Hi all!

I wrote (see patch) some basic tests for the global data served by the =

Yanel servlet, that is everything that lived under the reserved "yanel/" =

prefix, e.g. http://localhost:8080/yanel/yanel/data-repository-sitetree.html

I used HtmlUnit because it was just simpler than Canoo to set up, and as =

I think this code should be refactored to some other class, I really =

would not want to go into mocking all the servlet framework to be able =

to use JUnit here!

I had to extend the HtmlUnit tests' base abstract class a bit to test =

corner cases.
Other changes in the servlet class are minor: comment fixes and added a =

correct MIME-type header for the about page to be able to test it.


Next I plan to cleanup URL matching there a bit as the code is really =

difficult to follow, but I needed tests first!

Cheers,
   Guilaume
-------------- next part --------------
A non-text attachment was scrubbed...
Name: YanelServlet_global-data-tests.patch
Type: text/x-diff
Size: 8186 bytes
Desc: not available
Url : http://wyona.com/pipermail/yanel-development/attachments/20081203/bc3=
516a7/YanelServlet_global-data-tests.bin


More information about the Yanel-development mailing list