Re: PageState in unit testing
Vadim Nasardinov <[email protected]>
| Newsgroups | gmane.linux.redhat.ccm.general |
|---|---|
| Organization | Red Hat / Westford |
| Message-ID | <[email protected]> |
On Monday 29 March 2004 08:32, Emmanuel Gaillot wrote: > Any suggestion would be much appreciated... I don't believe we've made any serious use of mock objects, although I know people've looked at this framework. We also mocked up a couple of servlet interfaces back in the early days. Take a look at test/src/com/arsdigita/util/HttpServletDummyRequest.java and test/src/com/arsdigita/util/HttpServletDummyResponse.java You'd probably be better off using MockObjects rather than these two classes. In theory, Bebop should not depend on persistence. You shouldn't be forced to deal with the problem you've run into. In practice, the dependency is there and you have to satisfy it. The simplest way to do this is to do what our unit tests do. For example, take a look at test/src/com/arsdigita/bebop/FormDataTest.java and notice that it extends com.arsdigita.tools.junit.framework.BaseTestCase. The latter is responsible for setting up a transaction context for you. If you extend BaseTestCase, your error should go away. Hope this helps. Vadim -- Redhat-ccm-list mailing list [email protected] https://www.redhat.com/mailman/listinfo/redhat-ccm-list Archives: https://www.redhat.com/pipermail/redhat-ccm-list/