Re: WicketTester and Palette component
Hi Loic, If you use wicket page test (http://wicketpagetest.sourceforge.net), you can test it like: DefaultSelenium selenium = WebPageTestContext.getSelenium(); WicketSelenium ws = new WicketSelenium(selenium); ws.openBookmarkablePage(PalettePage.class); String[] allProducts = selenium.getSelectOptions("wicket=//choices"); assert allProducts.length == 3; assert allProducts[0].equals("ball pen"); assert allProducts[1].equals("eraser"); assert allProducts[2].equals("paper clip"); selenium.select("wicket=//choices", "eraser"); selenium.click("wicket=//addButton"); ... There is a full example at http://wicketpagetest.sourceforge.net/examples.html - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Disabling serialization in wicket tester....
> I would like very much to disable serialization in wicket tester. I > am using pages with mockito mocks that are not serializable (and why > should they in a unit test). I am using workarounds now. You can take a look at http://wicketpagetest.sourceforge.net which allows you to inject non-serializable mocks into your pages. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Closing of tags
I'm controlling the content of my tags with an AttributeAppender and in my markup they are closed with /> WebComponent keywords = new WebComponent("metaKeywords"); StringResourceModel keyModel = new StringResourceModel("meta.standard-keywords", this, new Model(this)); keywords.add(new AttributeAppender("content", keyModel, " ")); add(keywords); On output the tags are getting closed with Is there any way to prevent the separate closing tag and just keep the /> ? Try it another way. WebComponent keywords = new WebComponent("metaKeywords"); String keyModel="Resource Key'svalue"; keywords.add(new SimpleAttributeModifier ("content",keyModel)); add(keywords); -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Closing-of-meta-tags-tp2305127p2309024.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Disabling serialization in wicket tester....
Will mockito let you mock more than one class at once? If so, you can add Serializable to the list. On Jul 31, 2010 5:40 PM, "Erik Brakkee" wrote: > That my tests will not be equivalent is no big problem. In this case I am > really unit testing the pages while mocking the backend. That allows me to > also test anomalous behavior of the backend. > > In addition, I am also doing unit integration testing with rendering wicket > pages with an actual JPA backend with a relatively complete environment > including transactions and JPA. So, overall my unit tests cover the > functionality quite well. > > The trick I am doing now is storing the mock in a static variable of the > test class and then creating a serializable proxy using LookupProxyFactory ( > http://utils.wamblee.org/support/general/apidocs/org/wamblee/general/LookupProxyFactory.html ) > to lookup the mock dynamically. I guess this is screaming again for another > test utility on top of mockito for creating serializable mocks (if I cannot > solve it in wicket). > > Any suggestions on how to disable serialization in wicket tester?
Re: Disabling serialization in wicket tester....
That my tests will not be equivalent is no big problem. In this case I am really unit testing the pages while mocking the backend. That allows me to also test anomalous behavior of the backend. In addition, I am also doing unit integration testing with rendering wicket pages with an actual JPA backend with a relatively complete environment including transactions and JPA. So, overall my unit tests cover the functionality quite well. The trick I am doing now is storing the mock in a static variable of the test class and then creating a serializable proxy using LookupProxyFactory ( http://utils.wamblee.org/support/general/apidocs/org/wamblee/general/LookupProxyFactory.html) to lookup the mock dynamically. I guess this is screaming again for another test utility on top of mockito for creating serializable mocks (if I cannot solve it in wicket). Any suggestions on how to disable serialization in wicket tester?
Re: Disabling serialization in wicket tester....
Your tests will not be equivalent .. ** Martin 2010/8/1 Erik Brakkee : > Hi, > > > I would like very much to disable serialization in wicket tester. I am using > pages with mockito mocks that are not serializable (and why should they in a > unit test). I am using workarounds now. > > Is there an easy way in wicket tester to disable the serializations that > occur? > > Cheers > Erik > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Disabling serialization in wicket tester....
Hi, I would like very much to disable serialization in wicket tester. I am using pages with mockito mocks that are not serializable (and why should they in a unit test). I am using workarounds now. Is there an easy way in wicket tester to disable the serializations that occur? Cheers Erik
Re: DateField throwing runtime error in IE only
I went with catrina84's solution by using a date text field out of the form, and a related hidden text in the form. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/DateField-throwing-runtime-error-in-IE-only-tp1872555p2309086.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: FileUploadException wrapped in wiketRuntime exception, why? is that a good practice?
its checked because it came from commons-upload, we didnt write it. open a jira to create a runtime version of it and wrap it in that. -igor On Sat, Jul 31, 2010 at 5:48 AM, nicolas melendez wrote: > Hi there, i have a question about FileUploadException. > > In line 80 of MultipartServletWebRequest, the constructor throws > FileUploadException which is checked, and then in line 500 of > ServletWebRequest, it was wrapped to a wickerRuntimeException, > > �...@override > public WebRequest newMultipartWebRequest(Bytes maxsize) > { > try > { > MultipartServletWebRequest multipart = new > MultipartServletWebRequest( > httpServletRequest, maxsize); > multipart.setRequestParameters(getRequestParameters()); > return multipart; > } > catch (FileUploadException e) > { > throw new WicketRuntimeException(e); > } > } > > > is that a good practice?, why FileUploadException is a checked exception? > because it could be runtime exception because then it is wrapped anyway. > does anybody knows? > > Thanks > NM > > > -- > Nicolás Meléndez > Java Software Developer > > 1) Google App Engine works: > > 1.a) http://www.clasificad.com.ar (Local free classifieds for housing, > sale, services, local community, curses,jobs, and events - GAE/J + Wicket + > YUI) > > 1.b) http://www.chessk.com (Massive multiplayer chess online GAE/J + > Applets + Wicket) > > 2) Linkedin: http://ar.linkedin.com/in/nicolasmelendez > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket and JEE6
It appears that I ran into an existing Glassfish V3 issue. The same issue occurs with passivation of regular EJBs that have an entitymanager injected. See https://glassfish.dev.java.net/issues/show_bug.cgi?id=11356
FileUploadException wrapped in wiketRuntime exception, why? is that a good practice?
Hi there, i have a question about FileUploadException. In line 80 of MultipartServletWebRequest, the constructor throws FileUploadException which is checked, and then in line 500 of ServletWebRequest, it was wrapped to a wickerRuntimeException, @Override public WebRequest newMultipartWebRequest(Bytes maxsize) { try { MultipartServletWebRequest multipart = new MultipartServletWebRequest( httpServletRequest, maxsize); multipart.setRequestParameters(getRequestParameters()); return multipart; } catch (FileUploadException e) { throw new WicketRuntimeException(e); } } is that a good practice?, why FileUploadException is a checked exception? because it could be runtime exception because then it is wrapped anyway. does anybody knows? Thanks NM -- Nicolás Meléndez Java Software Developer 1) Google App Engine works: 1.a) http://www.clasificad.com.ar (Local free classifieds for housing, sale, services, local community, curses,jobs, and events - GAE/J + Wicket + YUI) 1.b) http://www.chessk.com (Massive multiplayer chess online GAE/J + Applets + Wicket) 2) Linkedin: http://ar.linkedin.com/in/nicolasmelendez
Re: Trouble creating a behaviour that adds JS and also a Body onLoad event
Wicket is wicked ;) ** Martin 2010/7/31 Mark Doyle : > Yeah, I actually messed up the behaviour because I never noticed the > rendOnLoad method. > > I've done as you suggested in the behaviour and then simply added that to > the component. It works perfectly, thanks Martin. > > > The progression to more advanced Wicket certainly requires more web specific > knowledge that Wicket has shielded me from in the past :) > > > On Sat, Jul 31, 2010 at 12:48 PM, Martin Makundi < > martin.maku...@koodaripalvelut.com> wrote: > >> Headercontribution can be added to many things ... >> >> 2010/7/31 Mark Doyle : >> > Ah ok, I'll test that. I never thought of just adding it to the Page. >> > >> > >> > What, if any, is the difference between this and adding the behaviour to >> the >> > WebPage which is a kind of Component? >> > >> > >> > On Fri, Jul 30, 2010 at 7:03 PM, Martin Makundi < >> > martin.maku...@koodaripalvelut.com> wrote: >> > >> >> Hi! >> >> >> >> You could try this: >> >> >> >> public class HomePage extends WebPage implements IHeaderContributor { >> >> �...@override >> >> public void renderHead(IHeaderResponse response) { >> >> response.renderOnLoadJavascript(javascript) >> >> } >> >> >> >> >> >> ** >> >> Martin >> >> >> >> 2010/7/30 Mark Doyle : >> >> > Firstly, I'm having some trouble finding a decent behaviour tutorial. >> If >> >> > anybody knows of one post a link up. >> >> > >> >> > Now, the problem I am having is creating a behaviour that adds some JS >> to >> >> > the head and sets an onLoad method. The JS project instructs users to >> >> add: >> >> > >> >> > >> >> > >> >> > but I'm not sure how Wicket supports this. >> >> > >> >> > Any ideas? >> >> > >> >> > Cheers >> >> > >> >> >> >> - >> >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> >> >> >> > >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Trouble creating a behaviour that adds JS and also a Body onLoad event
Yeah, I actually messed up the behaviour because I never noticed the rendOnLoad method. I've done as you suggested in the behaviour and then simply added that to the component. It works perfectly, thanks Martin. The progression to more advanced Wicket certainly requires more web specific knowledge that Wicket has shielded me from in the past :) On Sat, Jul 31, 2010 at 12:48 PM, Martin Makundi < martin.maku...@koodaripalvelut.com> wrote: > Headercontribution can be added to many things ... > > 2010/7/31 Mark Doyle : > > Ah ok, I'll test that. I never thought of just adding it to the Page. > > > > > > What, if any, is the difference between this and adding the behaviour to > the > > WebPage which is a kind of Component? > > > > > > On Fri, Jul 30, 2010 at 7:03 PM, Martin Makundi < > > martin.maku...@koodaripalvelut.com> wrote: > > > >> Hi! > >> > >> You could try this: > >> > >> public class HomePage extends WebPage implements IHeaderContributor { > >> @Override > >> public void renderHead(IHeaderResponse response) { > >>response.renderOnLoadJavascript(javascript) > >> } > >> > >> > >> ** > >> Martin > >> > >> 2010/7/30 Mark Doyle : > >> > Firstly, I'm having some trouble finding a decent behaviour tutorial. > If > >> > anybody knows of one post a link up. > >> > > >> > Now, the problem I am having is creating a behaviour that adds some JS > to > >> > the head and sets an onLoad method. The JS project instructs users to > >> add: > >> > > >> > > >> > > >> > but I'm not sure how Wicket supports this. > >> > > >> > Any ideas? > >> > > >> > Cheers > >> > > >> > >> - > >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > >> For additional commands, e-mail: users-h...@wicket.apache.org > >> > >> > > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
wicketstuff-push
I'm interested in implementing an authentication feature with wicketstuff-push (1.4.9.2), and it works with slight modifications. I share what I did. I basically implements written at http://cometd.org/documentation/howtos/authentication. What I change is two methods. (1) CometdAbstractBehavior#getInitCometdScript() I added the client side javascript code to send some extension parameters to the server: return "dojox.cometd.init('" + cometdServletPath + "', {ext: {auth: { some parametes you want to add }}})\n"; (2) CometdService#initBayeux() I added BayeuxAuthenticator authenticator = new BayeuxAuthenticator(); bayeux.setSecurityPolicy(authenticator); bayeux.addExtension(authenticator); - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Trouble creating a behaviour that adds JS and also a Body onLoad event
Headercontribution can be added to many things ... 2010/7/31 Mark Doyle : > Ah ok, I'll test that. I never thought of just adding it to the Page. > > > What, if any, is the difference between this and adding the behaviour to the > WebPage which is a kind of Component? > > > On Fri, Jul 30, 2010 at 7:03 PM, Martin Makundi < > martin.maku...@koodaripalvelut.com> wrote: > >> Hi! >> >> You could try this: >> >> public class HomePage extends WebPage implements IHeaderContributor { >> �...@override >> public void renderHead(IHeaderResponse response) { >> response.renderOnLoadJavascript(javascript) >> } >> >> >> ** >> Martin >> >> 2010/7/30 Mark Doyle : >> > Firstly, I'm having some trouble finding a decent behaviour tutorial. If >> > anybody knows of one post a link up. >> > >> > Now, the problem I am having is creating a behaviour that adds some JS to >> > the head and sets an onLoad method. The JS project instructs users to >> add: >> > >> > >> > >> > but I'm not sure how Wicket supports this. >> > >> > Any ideas? >> > >> > Cheers >> > >> >> - >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Trouble creating a behaviour that adds JS and also a Body onLoad event
Ah ok, I'll test that. I never thought of just adding it to the Page. What, if any, is the difference between this and adding the behaviour to the WebPage which is a kind of Component? On Fri, Jul 30, 2010 at 7:03 PM, Martin Makundi < martin.maku...@koodaripalvelut.com> wrote: > Hi! > > You could try this: > > public class HomePage extends WebPage implements IHeaderContributor { > @Override > public void renderHead(IHeaderResponse response) { >response.renderOnLoadJavascript(javascript) > } > > > ** > Martin > > 2010/7/30 Mark Doyle : > > Firstly, I'm having some trouble finding a decent behaviour tutorial. If > > anybody knows of one post a link up. > > > > Now, the problem I am having is creating a behaviour that adds some JS to > > the head and sets an onLoad method. The JS project instructs users to > add: > > > > > > > > but I'm not sure how Wicket supports this. > > > > Any ideas? > > > > Cheers > > > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >