From: Jeff M. <je...@cu...> - 2003-08-27 12:12:27
|
You are correct, using mocks allows you to avoid in-container testing. Some people prefer to run tests in-container but personally I've always found it much easier just to use mocks and have not found any disadvantages in doing so. Some people argue that you need to test in container to verify that your code runs well in the container itself but again i've not had any major issues regarding this and this would probably be more along the lines of system tests rather than unit tests. You can read this page http://jakarta.apache.org/cactus/mock_vs_cactus.html which compares mocks against cactus, although is is quite old and somethings have changed since then http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/mockobjects/mockobjects-java/src/j2ee/1.3/com/mockobjects/helpers/ServletTestHelper.java?rev=HEAD&content-type=text/vnd.viewcvs-markup. Really it's about personal preference, the lightweight approach of mocks or the higher level in-container tests. On Wed, 2003-08-27 at 12:30, Guofeng Zhang wrote: > I am new to mock objects approach. > > I guess that if the classes that the tested unit depends on could be replaced by mock objects, I donot need to do the in-container test, that is, I can only use JUnit framework , and do not need to use Cactus, to do the unit test. > > Could anyone tell me if the decision is correct? Do anyone meet the situation that the Cactus is still required to test some units even if the mock object apprach is used or mock object approach cannot be used? > > thanks. > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Mockobjects-java-users mailing list > Moc...@li... > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-users -- Jeff Martin Memetic Engineer http://www.custommonkey.org/ |