Currently FormTester only does raw String on request parameters.
As http://www.wicket-wiki.org.uk/wiki/index.php/Testing states, selecting
value from Component such as RadioGroup, DropDownChoice... etc is pain:

form.setValue("offSiteAccessEnabled", "0:form:offSiteAccessEnabled:Yes");
In my team we define a new method like:

    select(String path, final int index)

This simplified selection to just an index. The method supports built-in component:
AbstractChoice, RadioGroup, and CheckGroup but the implementation rely on reflection heavily.

Further, it may require addtional methods such as:

    selectMulti(String path, final int[] indexes)  //for ListMultiChoice and CheckGroup

Though I'm not sure that just invoking select() multiple times is better.

I could donate the code if anyone interests this improvement.

--
Ingram Chen
Java [EMAIL PROTECTED]
Institue of BioMedical Sciences Academia Sinica Taiwan
blog: http://www.javaworld.com.tw/roller/page/ingramchen


Reply via email to