From: <joh...@sa...> - 2003-07-01 14:11:26
|
Hi everyone. I just started playing around with the new DynamicMockObjects in version 0.09. I litereally copied and pasted the example on this page: http://www.mockobjects.com/wiki/SimpleServletTest And then wrote an implementation of SimpleCalcServlet. I kept the implementation very simple, and this is what it looks like: private void process(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { Integer a = Integer.decode(request.getParameter("a")); Integer b = Integer.decode(request.getParameter("b")); int result = a.intValue() + b.intValue(); response.setContentType("text/html"); PrintWriter out = response.getWriter(); out.print("Result = " + result); } Now the test runs, verify works just fine. But the assertEquals() call in the SimpleServletTest fails with this message: Output should be an addition expected:<Result = 7> but was:<java.io.PrintWriter@fa7e74> Now it's obvious what the problem is. The question is, is it something I am doing wrong or a bug? Many thanks, John ------------------------------------------------- "Modernizing Business Processes Through Proven IT Solutions" http://www.sapiens.com/ |