I've tried that.  It doesn't fix the problem.  Also most tests in  
wicket core don't do that... Anyway, here is the code with that method:

public class IndexedParamTest extends TestCase {
     public IndexedParamTest(String name) {
         super(name);
     }

     public void testPage() throws Exception {
         WicketTester app = new WicketTester();
         // app.getMarkupSettings().setAutomaticLinking(true);
         // app.getMarkupSettings().setStripWicketTags(true);

         app.setHomePage(Page1.class);
         app.mountBookmarkablePage("/page1", Page1.class);

         // app.mount("/page1", new IndexedParamUrlCodingStrategy("/ 
page1", Page1.class));

         app.setupRequestAndResponse();
         app.createRequestCycle();

         app.startPage(Page1.class);
         // app.assertRenderedPage(Page1.class);
         // System.out.println(app.getPreviousRenderedPage 
().getResponse().getOutputStream().toString());
         //app.setParameterForNextRequest("0", "param0");
     }

     public static class Page1 extends WebPage {
         public Page1() {
         }
     }
}


On Jun 8, 2006, at 3:36 AM, Johan Compagner wrote:

> you still need to create a request cycle:
>
> public WebRequestCycle createRequestCycle()
>
> right after you create the response/requests objects.
>
> j
>
> On 6/8/06, Michael Day <[EMAIL PROTECTED]> wrote: I had  
> created a bug report for it with a code sample, but I'll paste
> another sample here:
>
> public class IndexedParamTest extends TestCase {
>      public IndexedParamTest(String name) {
>          super(name);
>      }
>
>      public void testPage() throws Exception {
>          WicketTester app = new WicketTester();
>          app.setHomePage(Page1.class);
>          app.mountBookmarkablePage("/page1", Page1.class );
>          app.setupRequestAndResponse();
>          app.startPage(Page1.class);
>      }
>
>      public static class Page1 extends WebPage {
>          public Page1() {
>          }
>      }
> }
>
>
> And here is the error:
>
> 2006-06-08 00:29:39,278 [main] INFO  wicket.Application - You are in
> DEVELOPMENT mode
>
> wicket.WicketRuntimeException: Can not set the attribute. No
> RequestCycle available
>         at wicket.Session.setAttribute(Session.java:918)
>         at wicket.Session.newPageMap(Session.java:590)
>         at wicket.Session.pageMapForName(Session.java:466)
>         at wicket.PageMap.forName(PageMap.java:166)
>         at wicket.Page.init(Page.java:1158)
>         at wicket.Page.<init>(Page.java:194)
>         at wicket.markup.html.WebPage.<init>(WebPage.java:122)
>         at IndexedParamTest$Page1.<init>(IndexedParamTest.java :41)
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance0 
> (Native
> Method)
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance
> (NativeConstructorAccessorImpl.java:39)
>         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance
> (DelegatingConstructorAccessorImpl.java:27)
>         at java.lang.reflect.Constructor.newInstance 
> (Constructor.java:274)
>         at java.lang.Class.newInstance0(Class.java:308)
>         at java.lang.Class.newInstance (Class.java:261)
>         at wicket.session.DefaultPageFactory.newPage 
> (DefaultPageFactory.java:
> 58)
>         at  
> wicket.protocol.http.MockWebApplication.generateLastRenderedPage
> (MockWebApplication.java:372)
>         at wicket.protocol.http.MockWebApplication.processRequestCycle
> (MockWebApplication.java:327)
>         at wicket.protocol.http.MockWebApplication.processRequestCycle
> (MockWebApplication.java:305)
>         at wicket.util.tester.WicketTester.startPage  
> (WicketTester.java:267)
>         at IndexedParamTest.testPage(IndexedParamTest.java:34)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke
> (NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke
> (DelegatingMethodAccessorImpl.java:25)
>         at com.intellij.rt.execution.junit2.JUnitStarter.main
> (JUnitStarter.java :32)
>
>
> On Jun 6, 2006, at 3:51 AM, Juergen Donnerstag wrote:
>
> > This thread has started with Michiel Trempe providing some pieces of
> > code which don't work One piece was a subclass of Application which
> > looked like
> >
> >   public void init()
> >        {
> >                configure(DEVELOPMENT);
> >        }
> >
> > and that doesn't work. You need to call Application.init().
> > Your problem obviously is a different one except that you get a
> > similar error message. I don't know what is wrong with your code,  
> but
> > I haven't seen it yet.
> >
> > Juergen
> >
> > On 6/6/06, Michael Day <[EMAIL PROTECTED] > wrote:
> >> Hrm?  I'm not extending WicketTester -- I'm extending TestCase.  It
> >> doesn't have an init() method.  I tried adding app.configure
> >> ("development"), but it didn't fix the issue.
> >>
> >> On Jun 4, 2006, at 4:33 AM, Juergen Donnerstag wrote:
> >>
> >>> You need to change init to call the super implementation
> >>>
> >>>       public void init()
> >>>       {
> >>>               super.init();
> >>>               configure(DEVELOPMENT);
> >>>       }
> >>>
> >>> Juergen
> >>>
> >>> On 5/31/06, Michael Day < [EMAIL PROTECTED]> wrote:
> >>>> I just noticed this thread after posting a bug report:
> >>>>
> >>>> http://sourceforge.net/tracker/index.php?
> >>>> func=detail&aid=1497866&group_id=119783&atid=684975
> >>>>
> >>>> I assume it is related since the exception is the same.
> >>>>
> >>>> Michael Day
> >>>>
> >>>> On May 30, 2006, at 1:46 PM, Eelco Hillenius wrote:
> >>>>
> >>>>> Test case  
> wicket.util.tester.WicketTesterTest#testPageConstructor
> >>>>> has:
> >>>>>
> >>>>>               MyMockApplication tester = new MyMockApplication 
> ();
> >>>>>               Book mockBook = new Book("xxId", "xxName");
> >>>>>               Page page = new ViewBook(mockBook);
> >>>>>               tester.startPage(page);
> >>>>>
> >>>>>               // assertion
> >>>>>               tester.assertRenderedPage(ViewBook.class);
> >>>>>               tester.clickLink("link");
> >>>>>               tester.assertRenderedPage(CreateBook.class);
> >>>>>
> >>>>> and that seems to work... not sure why that wouldn't work for  
> you?
> >>>>>
> >>>>> Eelco
> >>>>>
> >>>>>
> >>>>> On 5/30/06, Michiel Trimpe < [EMAIL PROTECTED]> wrote:
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> Hey everyone,
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> I just finished creating tests in rc2, but after upgrading to
> >>>>>> wicket
> >>>>>> 1.2-final the tests now fail.
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>>>>>>>>> AppTester.java >>>>>>>>
> >>>>>>
> >>>>>> public class AppTester extends WicketTester {
> >>>>>>
> >>>>>> public AppTester() {
> >>>>>>
> >>>>>>             super("/admin");
> >>>>>>
> >>>>>> }
> >>>>>>
> >>>>>> public void init() {
> >>>>>>
> >>>>>>             configure(DEVELOPMENT);
> >>>>>>
> >>>>>> }
> >>>>>>
> >>>>>> @Override
> >>>>>>
> >>>>>> public Class getHomePage() {
> >>>>>>
> >>>>>>             return ListPage.class;
> >>>>>>
> >>>>>> }
> >>>>>>
> >>>>>> }
> >>>>>>
> >>>>>>>>>>> TestList.java >>>>>>>
> >>>>>>  tester = new AppTester();
> >>>>>>
> >>>>>> tester.startPage(new ListPage());
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> And this returns the error:
> >>>>>>
> >>>>>> wicket.WicketRuntimeException: Can not set the attribute. No
> >>>>>> RequestCycle
> >>>>>> available
> >>>>>>
> >>>>>>             at wicket.Session.setAttribute(Session.java:918)
> >>>>>>
> >>>>>>             at wicket.PageMap.put(PageMap.java:519)
> >>>>>>
> >>>>>>             at wicket.Session.touch(Session.java:720)
> >>>>>>
> >>>>>>             at
> >>>>>> wicket.util.tester.WicketTester.startPage(WicketTester.java: 
> 248)
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> Is this because the tester is broken, or am I doing something
> >>>>>> wrong?
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>  - michiel
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> Michiel Trimpe| Java Developer| TomTom |
> >>>>>> [EMAIL PROTECTED]
> >>>>>> | +31
> >>>>>> (0)6 41482341mobile
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> ________________________________
> >>>>>>  This e-mail message contains information which is confidential
> >>>>>> and may be
> >>>>>> privileged. It is intended for use by the addressee only. If  
> you
> >>>>>> are not the
> >>>>>> intended addressee, we request that you notify the sender
> >>>>>> immediately and
> >>>>>> delete or destroy this e-mail message and any attachment(s),
> >>>>>> without
> >>>>>> copying, saving, forwarding, disclosing or using its  
> contents in
> >>>>>> any other
> >>>>>> way. TomTom N.V., TomTom International BV or any other company
> >>>>>> belonging to
> >>>>>> the TomTom group of companies will not be liable for damage
> >>>>>> relating to the
> >>>>>> communication by e-mail of data, documents or any other
> >>>>>> information.
> >>>>>>
> >>>>>>
> >>>>>
> >>>>>
> >>>>> -------------------------------------------------------
> >>>>> All the advantages of Linux Managed Hosting--Without the Cost  
> and
> >>>>> Risk!
> >>>>> Fully trained technicians. The highest number of Red Hat
> >>>>> certifications in
> >>>>> the hosting industry. Fanatical Support. Click to learn more
> >>>>> http://sel.as-us.falkag.net/sel?
> >>>>> cmd=lnk&kid=107521&bid=248729&dat=121642
> >>>>> _______________________________________________
> >>>>> Wicket-user mailing list
> >>>>> Wicket-user@lists.sourceforge.net
> >>>>> https://lists.sourceforge.net/lists/listinfo/wicket-user
> >>>>>
> >>>>>
> >>>>
> >>>>
> >>>>
> >>>> -------------------------------------------------------
> >>>> All the advantages of Linux Managed Hosting--Without the Cost and
> >>>> Risk!
> >>>> Fully trained technicians. The highest number of Red Hat
> >>>> certifications in
> >>>> the hosting industry. Fanatical Support. Click to learn more
> >>>> http://sel.as-us.falkag.net/sel?
> >>>> cmd=lnk&kid=107521&bid=248729&dat=121642
> >>>> _______________________________________________
> >>>> Wicket-user mailing list
> >>>> Wicket-user@lists.sourceforge.net
> >>>> https://lists.sourceforge.net/lists/listinfo/wicket-user
> >>>>
> >>>
> >>>
> >>> _______________________________________________
> >>> Wicket-user mailing list
> >>> Wicket-user@lists.sourceforge.net
> >>> https://lists.sourceforge.net/lists/listinfo/wicket-user
> >>>
> >>>
> >>
> >>
> >>
> >> _______________________________________________
> >> Wicket-user mailing list
> >> Wicket-user@lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/wicket-user
> >>
> >
> >
> > _______________________________________________
> > Wicket-user mailing list
> > Wicket-user@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/wicket-user
> >
> >
>
>
>
> _______________________________________________
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>
> _______________________________________________
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user



_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to