See WicketTestCase. Most of our junit tests are based on that principle

        /**
         * Use <code>-Dwicket.replace.expected.results=true</code> to
         * automatically replace the expected output file.
         *
         * @param pageClass
         * @param filename
         * @throws Exception
         */
        protected void executeTest(final Class<? extends Page> pageClass,
final String filename)
                        throws Exception
        {
                System.out.println("=== " + pageClass.getName() + " ===");

                String document = accessPage(pageClass).getDocument();

                // Validate the document
                assertTrue(DiffUtil.validatePage(document, this.getClass(), 
filename));
        }

        /**
         * Simulates a bookmarkable page access from the browser
         *
         * @param pageClass
         * @return mock servlet response
         * @throws Exception
         */
        protected MockHttpServletResponse accessPage(final Class<? extends
Page> pageClass)
                        throws Exception
        {
                application.setHomePage(pageClass);

                // Do the processing
                application.setupRequestAndResponse();
                application.processRequestCycle();

                assertEquals(pageClass, 
application.getLastRenderedPage().getClass());
                return application.getServletResponse();
        }

Juergen

On 10/28/06, Otan <[EMAIL PROTECTED]> wrote:
> No, it's not for debugging purpose. Here is the use case: I'm building a
> wicket application which purpose is to be an engine that produces static
> HTMLs. These HTML files are actually static version of my dynamic and
> templated wicket pages, and they will sit in my website for the world to
> access, in place of dynamic wicket pages.
>
> But I have no idea how to get the HTML source that a wicket page renders.
>
>
> On 28/10/06, Juergen Donnerstag < [EMAIL PROTECTED]> wrote:
> > I guess you want it for debugging purpposes? There are lots of tools
> > out there which allow you to monitor the traffic. Fiddler e.g. is such
> > a tool (open source)
> >
> > Juergen
> >
> > On 10/28/06, Otan <[EMAIL PROTECTED]> wrote:
> > > I want to save into a file the wicket page's renderded markup before it
> > > respond to the user's request. Can someone give me a hint how to do
> this?
> > > Thanks.
> > >
> > >
> > >
> -------------------------------------------------------------------------
> > > Using Tomcat but need to do more? Need to support web services,
> security?
> > > Get stuff done quickly with pre-integrated technology to make your job
> > > easier
> > > Download IBM WebSphere Application Server v.1.0.1 based on Apache
> Geronimo
> > >
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> > >
> > > _______________________________________________
> > > Wicket-user mailing list
> > > [email protected]
> > >
> https://lists.sourceforge.net/lists/listinfo/wicket-user
> > >
> > >
> > >
> >
> >
> -------------------------------------------------------------------------
> > Using Tomcat but need to do more? Need to support web services, security?
> > Get stuff done quickly with pre-integrated technology to make your job
> easier
> > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> >
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> > _______________________________________________
> > Wicket-user mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/wicket-user
> >
>
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job
> easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>
> _______________________________________________
> Wicket-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>
>
>

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to