- Last edited September 9, 1999 |
When you see this, you start to ask yourself how Sun tests their Servlets in a simple repeatable manner, when there is all this baggage that you have to implement even for the simplest HelloWorld? servlet?
It should be easy for me to write:
HttpServletRequest? r = new MockServletRequest?(). r.addParamater("name","Tim");I haven't encountered any examples of this level of test, however maybe someone can prove me wrong!
MockOutPutStream? out = new MockOutputStream?(); HttpServletResponse? s = new MockServletResponse?(out);
myServelet.doGet(r,s);
assert(out.toString().indexOf(TEST_RESULT) > -1);
In the meantime, Oli, Paul and I have been working around these difficulties to write useful tests. Some of this you can see in the RealCode, however there is more to come -- TimM
- Last edited September 9, 1999 |