Re: [Wicket-user] WicketTester broken on 1.2?
fixed it by creating a new cycle right before the page is created with newPage()On 6/8/06, Michael Day <[EMAIL PROTECTED] > wrote:I've tried that. It doesn't fix the problem. Also most tests inwicket 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.( Page.java:194)> at wicket.markup.html.WebPage.(WebPage.java:122)> at IndexedParamTest$Page1.(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 ch
Re: [Wicket-user] WicketTester broken on 1.2?
ahh the problem is that your HomePage is not directly rendered because you mount the homepagethen this code is encountered: BookmarkablePageRequestTarget homepageTarget = new BookmarkablePageRequestTarget( homePageClass, parameters); IRequestCodingStrategy requestCodingStrategy = requestCycle.getProcessor() .getRequestCodingStrategy(); CharSequence path = requestCodingStrategy.pathForTarget(homepageTarget); if (path != null) { // The home page was mounted at the given path. // Issue a redirect to that path requestCycle.setRedirect(true); }so a redirect is triggered. On 6/8/06, Michael Day < [EMAIL PROTECTED]> wrote: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.( Page.java:194)> at wicket.markup.html.WebPage.(WebPage.java:122)> at IndexedParamTest$Page1.(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()
Re: [Wicket-user] WicketTester broken on 1.2?
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.(Page.java:194) > at wicket.markup.html.WebPage.(WebPage.java:122) > at IndexedParamTest$Page1.(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 t
Re: [Wicket-user] WicketTester broken on 1.2?
you still need to create a request cycle:public WebRequestCycle createRequestCycle()right after you create the response/requests objects.jOn 6/8/06, Michael Day <[EMAIL PROTECTED]> wrote: I had created a bug report for it with a code sample, but I'll pasteanother 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 inDEVELOPMENT modewicket.WicketRuntimeException: Can not set the attribute. NoRequestCycle availableat 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.(Page.java:194)at wicket.markup.html.WebPage.(WebPage.java:122)at IndexedParamTest$Page1.(IndexedParamTest.java :41)at sun.reflect.NativeConstructorAccessorImpl.newInstance0(NativeMethod)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.
Re: [Wicket-user] WicketTester broken on 1.2?
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.(Page.java:194) at wicket.markup.html.WebPage.(WebPage.java:122) at IndexedParamTest$Page1.(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 A
Re: [Wicket-user] WicketTester broken on 1.2?
As I mentioned in the previous mail. You need to call public void init() { super.init(); configure(DEVELOPMENT); } I've created test case based on your code and it works. Juergen On 6/6/06, Michiel Trimpe <[EMAIL PROTECTED]> wrote: > Just did some testing further digging into the issue and it don't really > understand why it would work in the rest of Wicket, unless you test the > classes by startPage(Class) instead of startPage(Page). > > What the problem is, is that the tester tries to add the generated Page > to the session after processing the request, BUT the session uses the > RequestCycle in ThreadLocal, which is cleared when processing a request. > See: > WebRequestCycle(RequestCycle).threadDetach() line: 1079 > WebRequestCycle(RequestCycle).detach() line: 836 > WebRequestCycle(RequestCycle).steps() line: 1052 > WebRequestCycle(RequestCycle).request(IRequestTarget) line: 499 > WebRequestCycle(RequestCycle).request(Component) line: 477 > ConnectivityTester(MockWebApplication).processRequestCycle(Component) > line: 291 > > Anyone up for a quick fix? Please?? > > Michiel Trimpe| Java Developer| TomTom | [EMAIL PROTECTED] | +31 > (0)6 41482341mobile > > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Michael > Day > Sent: Tuesday, June 06, 2006 6:42 AM > To: wicket-user@lists.sourceforge.net > Subject: Re: [Wicket-user] WicketTester broken on 1.2? > > 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 >>
Re: [Wicket-user] WicketTester broken on 1.2?
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 > >>> > >>> > >> > >> > >> > >>
Re: [Wicket-user] WicketTester broken on 1.2?
Just did some testing further digging into the issue and it don't really understand why it would work in the rest of Wicket, unless you test the classes by startPage(Class) instead of startPage(Page). What the problem is, is that the tester tries to add the generated Page to the session after processing the request, BUT the session uses the RequestCycle in ThreadLocal, which is cleared when processing a request. See: WebRequestCycle(RequestCycle).threadDetach() line: 1079 WebRequestCycle(RequestCycle).detach() line: 836 WebRequestCycle(RequestCycle).steps() line: 1052 WebRequestCycle(RequestCycle).request(IRequestTarget) line: 499 WebRequestCycle(RequestCycle).request(Component) line: 477 ConnectivityTester(MockWebApplication).processRequestCycle(Component) line: 291 Anyone up for a quick fix? Please?? Michiel Trimpe| Java Developer| TomTom | [EMAIL PROTECTED] | +31 (0)6 41482341mobile -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Michael Day Sent: Tuesday, June 06, 2006 6:42 AM To: wicket-user@lists.sourceforge.net Subject: Re: [Wicket-user] WicketTester broken on 1.2? 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) >>>> >>>> >>>> >>>> >>>&
Re: [Wicket-user] WicketTester broken on 1.2?
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.n
Re: [Wicket-user] WicketTester broken on 1.2?
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
Re: [Wicket-user] WicketTester broken on 1.2?
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
Re: [Wicket-user] WicketTester broken on 1.2?
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
Re: [Wicket-user] WicketTester broken on 1.2?
plenty of our unit tests are based on WicketTester and they are still working properly. The change is not with WicketTester but with RequestCycle and the point in time it is available. May I suggest you check out the unit tests (WicketTestCase). Juergen On 5/30/06, Eelco Hillenius <[EMAIL PROTECTED]> wrote: MyMockApplication is WicketTester btw ( public class MyMockApplication extends WicketTester { /** * Constructor. */ public MyMockApplication() { } } ) On 5/30/06, Eelco Hillenius <[EMAIL PROTECTED]> 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
Re: [Wicket-user] WicketTester broken on 1.2?
MyMockApplication is WicketTester btw ( public class MyMockApplication extends WicketTester { /** * Constructor. */ public MyMockApplication() { } } ) On 5/30/06, Eelco Hillenius <[EMAIL PROTECTED]> 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
[Wicket-user] WicketTester broken on 1.2?
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.