From: Trenton L. <Tre...@cn...> - 2002-06-21 17:35:36
|
Basically, I think ServletContext and ServletConfig need some real functionality. Because of this, it precludes them from being a mock. They need real functionality because it's not sufficient to simply test that a servlet calls methods on a MockServletContext, or that it sets the proper attributes. I think you actually need real functionality here, in order to have the servlet progress far enough along its execution path to make testing useful. This is certainly true for anything we tried to do for ServletConfig. I frequtly do a lot of setup within my init(ServletConfig) method, and without a real ServletConfig, I can't get the servlet to a point where doing any tests on it are meaningful. I need a real config so that the servlet can init properly. Then, I can test it using MockServletRequests and Responses. *trenton -----Original Message----- From: Jeff Martin [mailto:je...@mk...] Sent: Friday, June 21, 2002 10:00 AM To: MockObjects Subject: RE: [MO-java-dev] Common test cases Sorry, not quite sure I understand. My intent for the standard test cases was just to start a by having a commonly use set of objects. e.g. protected final MockHttpRequest request = new MockHttpRequest(); protected final MockHttpResponse response = new MockHttpResponse(); protected final MockServletContext context = new MockServletContext(); ... protected void setUp(){ request.setupGetServletContext(context); } ... protected void verify(){ request.verify(); response.verify(); context.verify(); } That kinda thing. On Wed, 2002-06-19 at 22:18, Trenton Lipscomb wrote: > Yes, and just to be clear, these should be partial (or even full) implementations of the interfaces. These won't be mocks, since we'll actually need the classes to fill their role and relay configuration data to the servlet. > > *trenton > > -----Original Message----- > From: Vincent Massol [mailto:vm...@oc...] > Sent: Wednesday, June 19, 2002 12:33 PM > To: Moc...@li... > Subject: RE: [MO-java-dev] Common test cases > > > +1 > > We need to make sure they are still quite generic though. > > -Vincent > > > -----Original Message----- > > From: moc...@li... > > [mailto:moc...@li...] On Behalf Of > > Jeff Martin > > Sent: 19 June 2002 16:48 > > To: MockObjects > > Subject: [MO-java-dev] Common test cases > > > > I've been starting to thing that it might be nice to have some > abstract > > test cases which perform common and boring setup of mock objects. > > > > Like setting up servlet requests and all those context type stuff. > > > > Thoughts/objects? > > -- > > Jeff Martin > > > > Memetic Engineer > > > > http://www.custommonkey.org/ > > > > > > > ------------------------------------------------------------------------ > -- > > -- > > Bringing you mounds of caffeinated joy > > >>> http://thinkgeek.com/sf <<< > > > > _______________________________________________ > > Mockobjects-java-dev mailing list > > Moc...@li... > > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev > > > ---------------------------------------------------------------------------- > Bringing you mounds of caffeinated joy > >>> http://thinkgeek.com/sf <<< > > _______________________________________________ > Mockobjects-java-dev mailing list > Moc...@li... > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev > > ---------------------------------------------------------------------------- > Bringing you mounds of caffeinated joy > >>> http://thinkgeek.com/sf <<< > > _______________________________________________ > Mockobjects-java-dev mailing list > Moc...@li... > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev -- ------------------------------------------------------- Sponsored by: ThinkGeek at http://www.ThinkGeek.com/ _______________________________________________ Mockobjects-java-dev mailing list Moc...@li... https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev |