On 10/30/05, Iman RahmatiZadeh <[EMAIL PROTECTED]> wrote: > Argh ! Unit testing is way too hard in wicket. I'm using a custom > implementation of WebSession in my application. The problem arises when I > use the MockWebApplication class for testing, which creates and uses > WebSession for tests and my page classes which depend on my implementation > of WebSession cant work with it. I can't implement another > MockWebApplication, because getSession() in WebApplication has package > access, and it's critical for setting up the session. Has anybody solved > such problems ? Does anybody know the preferred way of unit testing (not > functional testing) the pages ?
Where does MockWebApplication create its own WebSession??? It uses WebApplication.getSessionFactory().newSession() which is Wickets standard means and works nicely in my unit tests. WicketTester is derived from MockWebApplication and provides some convience method. May be that is what your are looking for. What IMO would be nice if MockWebApplication would delegate to my application object instead of being derived from WebApplication. Reason: Today I basically have to copy MyApplication to MyMockApplication and changes the derived class to MockWebApplication. If MockWebApplication would delegate to an application object, there were no more need to do so. Juergen ------------------------------------------------------- This SF.Net email is sponsored by the JBoss Inc. Get Certified Today * Register for a JBoss Training Course Free Certification Exam for All Training Attendees Through End of 2005 Visit http://www.jboss.com/services/certification for more information _______________________________________________ Wicket-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-user
