60% waste

2009-05-08 Thread Martin Makundi
Hi! I use TDD: I spend 60% of my time type-checking and path-checking my wicketTests and components. I always have the wrong path and I must prinDocument and iterate to get it right Anybody have the same experience? How about introducing type-safety and path-safety/identity into component h

Re: 60% waste

2009-05-08 Thread Martijn Dashorst
See jdave-wicket for better test support. Slated to come to you in Wicket 1.5 Martijn On Fri, May 8, 2009 at 5:48 PM, Martin Makundi wrote: > Hi! > > I use TDD: I spend 60% of my time type-checking and path-checking my > wicketTests and components. > > I always have the wrong path and I must pri

Re: 60% waste

2009-05-08 Thread Andrea Aime
Martin Makundi ha scritto: Hi! I use TDD: I spend 60% of my time type-checking and path-checking my wicketTests and components. I always have the wrong path and I must prinDocument and iterate to get it right I don't know if this is of any help, but I've written the attached utility class

Re: 60% waste

2009-05-08 Thread Martin Makundi
> I don't know if this is of any help, but I've written the attached > utility class that, given a component, can print its containment > structure, along with the eventual component classes and > model values (toString-ed). Well... printDoc and wicket getDebugSettings().setOutputComponentPath(tru

Re: 60% waste

2009-05-08 Thread Igor Vaynberg
you should really use visitors for this kind of thing...something like this may work very well for you TestUtils.attachTestId(Component c, String id) { if (application.get().getconfigurationtype()!=production) { c.setmatadata(testkey, id); } } then in your code Form form=new Form(..);

Re: 60% waste

2009-05-08 Thread Igor Vaynberg
you can also create a test panel that contains just your form and test that instead of creating the entire complex page just to test the form. break your tests into small units and test in isolaton. your test harness panel can have a getter that gives you direct access the the form you are testing.

Re: 60% waste

2009-05-08 Thread Per Lundholm
Well, strings all over the place, if I get what you mean. But I write the tests first and they define what the paths and ids should be and Wicket is really quick about discovering when the implementation doesn't follow spec (i.e. tests). Doing a small step at a time takes you there faster. "Let'

Re: 60% waste

2009-05-08 Thread Martin Makundi
> you should really use visitors for this kind of thing...something like > this may work very well for you I know that with more work I can make ... more work. What I am looking for is a solution that makes it possible to have intellisense while coding and compile-time type checking. Visitors etc

Re: 60% waste

2009-05-08 Thread James Carman
Use an IDE plugin? On Fri, May 8, 2009 at 2:39 PM, Martin Makundi wrote: >> you should really use visitors for this kind of thing...something like >> this may work very well for you > > I know that with more work I can make ... more work. > > What I am looking for is a solution that makes it poss

Re: 60% waste

2009-05-08 Thread Martin Makundi
> But I write the tests first and they define what the paths and ids > should be and Wicket is really quick about discovering when the > implementation doesn't follow spec (i.e. tests). I concentrate on coding.. sometimes I write the implementation, sometimes the tests, whichever goes faster until

Re: 60% waste

2009-05-08 Thread Martin Makundi
> Use an IDE plugin? That's a hack, not a design. ** Martin - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org

Re: 60% waste

2009-05-08 Thread Igor Vaynberg
so what you are saying is that adding one line of code to mark the component you want to test, and then being able to find that component easily in your test - independent of its place in hierarchy and without relying on strings - is more work? -igor On Fri, May 8, 2009 at 11:39 AM, Martin Makund

Re: 60% waste

2009-05-08 Thread Igor Vaynberg
wicket component hierarchy is dynamic, so there is no predicting it at compile time. this is one of the most powerful features of wicket. -igor On Fri, May 8, 2009 at 11:39 AM, Martin Makundi wrote: >> you should really use visitors for this kind of thing...something like >> this may work very w

Re: 60% waste

2009-05-08 Thread James Carman
What about introducing an xpath-ish like expression API that could help you search for components within the hierarchy? On Fri, May 8, 2009 at 3:07 PM, Igor Vaynberg wrote: > wicket component hierarchy is dynamic, so there is no predicting it at > compile time. this is one of the most powerful fe

Re: 60% waste

2009-05-08 Thread Christopher L Merrill
Martin Makundi wrote: Use an IDE plugin? That's a hack, not a design. Wow...I'm new to this list, but I doubt you can expect much help with that attitude. I suggest you request a refund for your Wicket license and support subscription and go find a tool that better fits your needs. Oh, wait

Re: 60% waste

2009-05-08 Thread Andrea Aime
Martin Makundi ha scritto: I don't know if this is of any help, but I've written the attached utility class that, given a component, can print its containment structure, along with the eventual component classes and model values (toString-ed). Well... printDoc and wicket getDebugSettings().setO

Re: 60% waste

2009-05-08 Thread Martin Makundi
> Interesting. I googled for "printDoc Wicket" but did not find anything. > Where is that utility? public void printDocument() { System.out.println(tester.getServletResponse().getDocument()); } ** Martin - To unsubscribe

Re: 60% waste

2009-05-08 Thread Martin Makundi
> wicket component hierarchy is dynamic, so there is no predicting it at > compile time. this is one of the most powerful features of wicket. Yes but each component is always fixed relative to its parent. The html markup fixes the hierarcy, so something might be devised here. > What about introdu

Re: 60% waste

2009-05-09 Thread Martin Makundi
Hi! What about if the MarkupContainer was used in a more bean-like manner: public abstract class ListItem extends WebMarkupContainer ... new ListView("id", ..., MyListItem.class); public class MyListItem extends ListItem { private TextField myTextField; public MyListItem(MyData myData) {

Re: 60% waste

2009-05-09 Thread Martin Makundi
Ofcourse I forgot the getter... public class MyListItem extends ListItem { private TextField myTextField; public MyListItem(MyData myData) { myTextField = TextField(...); } /** * @return the myTextField */ public TextField getMyTextField() { return myTextField; } } 20

Re: 60% waste

2009-05-09 Thread Per Newgro
Martin Makundi schrieb: Interesting. I googled for "printDoc Wicket" but did not find anything. Where is that utility? public void printDocument() { System.out.println(tester.getServletResponse().getDocument()); } ** Martin

Re: 60% waste

2009-05-09 Thread Marko Sibakov
Like Martijn said i also strongly recommend to take a look at the jdave-wicket's selectors (http://www.jdave.org/). examples => http://svn.laughingpanda.org/svn/jdave/trunk/jdave-wicket/src/test/jdave/wicket/PageWithItemsSpec.java with form tester it goes like this => form = wick

Re: 60% waste

2009-05-09 Thread Ben Tilford
Have you looked at selenium? Your not really "unit" testing here. On Sat, May 9, 2009 at 7:41 AM, Marko Sibakov wrote: > Like Martijn said i also strongly recommend to take a look at the > jdave-wicket's selectors (http://www.jdave.org/). > > examples => > http://svn.laughingpanda.org/svn/jdave/

Re: 60% waste

2009-05-09 Thread Martin Makundi
Hi! I have now better formalized my intentions (couldn't get sleep because of this ;). You can see the benefits for yourself. However, I found out that most of it can be done with existing wicket. Maybe some part of the philosophy could be adapted into wicket in general. I submitted a quickstart w

Re: 60% waste

2009-05-09 Thread Martin Makundi
Related wiki entry http://cwiki.apache.org/confluence/display/WICKET/Type-safe+testing+in+wicket ** Martin - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.or

Re: 60% waste

2009-05-10 Thread Marko Sibakov
Ben Tilford wrote: Have you looked at selenium? Your not really "unit" testing here. Hi Ben, What do you mean "Your not really "unit" testing here." ? MSi On Sat, May 9, 2009 at 7:41 AM, Marko Sibakov wrote: Like Martijn said i also strongly recommend to take a look at the jdave-wick

Re: 60% waste

2009-05-10 Thread Igor Vaynberg
unit testing is about testing small isolated bits of functionality in isolation lets say that you want to test foo(p) { return a(b(c(p))); } what martin is trying to do is to test that foo(q) yields the desired value w, what he should do instead is test a() in isolation to make sure it works tes

RE: 60% waste

2009-05-11 Thread Douglas Ferguson
On a side note, does Selenium even work with wicket? Douglas -Original Message- From: Igor Vaynberg [mailto:igor.vaynb...@gmail.com] Sent: Monday, May 11, 2009 12:13 AM To: users@wicket.apache.org Subject: Re: 60% waste unit testing is about testing small isolated bits of functionality

RE: 60% waste

2009-05-11 Thread Martin Grigorov
il.com] > Sent: Monday, May 11, 2009 12:13 AM > To: users@wicket.apache.org > Subject: Re: 60% waste > > unit testing is about testing small isolated bits of functionality in > isolation > > lets say that you want to test foo(p) { return a(b(c(p))); } > > what mar

Re: 60% waste

2009-05-11 Thread Krzysztof Jelski
Hi Martin! I also found using paths to identify components really cumbersome in test-driving wicket. I took a look at jdave-wicket and really liked its approach. However, I didn't want to use jdave libs with my current project. Inspired with this lib, I wrote this little snippet of code, which i f

Re: 60% waste

2009-05-11 Thread Martin Makundi
Tnx. But I am verry happy with my new beanz design ;) ** Martin 2009/5/11 Krzysztof Jelski : > Hi Martin! > > I also found using paths to identify components really cumbersome in > test-driving wicket. I took a look at jdave-wicket and really liked its > approach. However, I didn't want to use jd

RE: 60% waste

2009-05-11 Thread Douglas Ferguson
I thought there was a problem with wicket's random generation of ids. D./ -Original Message- From: Martin Grigorov [mailto:mcgreg...@e-card.bg] Sent: Monday, May 11, 2009 7:15 AM To: users@wicket.apache.org Subject: RE: 60% waste I'm using quite successfully WebDriver (a.k.a.

RE: 60% waste

2009-05-11 Thread Douglas Ferguson
Subject: RE: 60% waste I thought there was a problem with wicket's random generation of ids. D./ -Original Message- From: Martin Grigorov [mailto:mcgreg...@e-card.bg] Sent: Monday, May 11, 2009 7:15 AM To: users@wicket.apache.org Subject: RE: 60% waste I'm using quite successfully

Re: 60% waste

2009-05-11 Thread Martin Makundi
> I thought there was a problem with wicket's random generation of ids. The beanz overcomes that ;) ** Martin > > D./ > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@w

Re: 60% waste

2009-05-11 Thread John Krasnay
ems with wicket ids and using > Selenium? > Was this fixed in v2 (WebDriver)? > > D/ > > -Original Message- > From: Douglas Ferguson [mailto:doug...@douglasferguson.us] > Sent: Monday, May 11, 2009 9:38 AM > To: users@wicket.apache.org; mcgreg...@e-card.bg &

Re: 60% waste

2009-05-11 Thread Igor Vaynberg
9:38 AM >> To: users@wicket.apache.org; mcgreg...@e-card.bg >> Subject: RE: 60% waste >> >> I thought there was a problem with wicket's random generation of ids. >> >> D./ >> >> -Original Message- >> From: Martin Grigorov [mailto:mcg

Re: 60% waste

2009-05-11 Thread Marko Sibakov
or.vaynb...@gmail.com] Sent: Monday, May 11, 2009 12:13 AM To: users@wicket.apache.org Subject: Re: 60% waste unit testing is about testing small isolated bits of functionality in isolation lets say that you want to test foo(p) { return a(b(c(p))); } what martin is trying to do is to test that foo(q) yi

RE: 60% waste

2009-05-12 Thread Douglas Ferguson
://www.laughingpanda.org/~inhuman/wicket-bench/docs/features-0.5.html -Original Message- From: Marko Sibakov [mailto:marko.siba...@ri.fi] Sent: Monday, May 11, 2009 11:22 AM To: users@wicket.apache.org Subject: Re: 60% waste Martin Grigorov wrote: > I'm using quite successfully W