From: Vincent M. <vm...@oc...> - 2002-06-21 19:44:25
|
Hehe ... you guessed right Vincent! :-)=20 Trenton, there is a strategy complementary to mock objects when you need to test in a real container ... http://jakarta.apache.org/cactus See especially http://jakarta.apache.org/cactus/mockobjects.html which tries to compare mocks and in-container testing. -Vincent > -----Original Message----- > From: moc...@li... > [mailto:moc...@li...] On Behalf Of > Vincent Tenc=E9 > Sent: 21 June 2002 19:23 > To: 'Trenton Lipscomb'; 'MockObjects' > Subject: RE: [MO-java-dev] Common test cases >=20 > I don't know exactly what you are trying to test, but I know some guys out > there that will recommend you use Cactus ;-) if you end up having too much > functionality in your Mocks. >=20 > Vincent >=20 > > -----Original Message----- > > From: moc...@li... > > [mailto:moc...@li...]On Behalf Of > > Trenton Lipscomb > > Sent: Friday, June 21, 2002 13:35 > > To: 'Jeff Martin'; MockObjects > > Subject: RE: [MO-java-dev] Common test cases > > > > > > 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 =3D new MockHttpRequest(); > > protected final MockHttpResponse response =3D new = MockHttpResponse(); > > protected final MockServletContext context =3D 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 > > > > > > ------------------------------------------------------- > > Sponsored by: > > ThinkGeek at http://www.ThinkGeek.com/ > > _______________________________________________ > > Mockobjects-java-dev mailing list > > Moc...@li... > > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev >=20 >=20 >=20 > ------------------------------------------------------- > Sponsored by: > ThinkGeek at http://www.ThinkGeek.com/ > _______________________________________________ > Mockobjects-java-dev mailing list > Moc...@li... > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev |