I am trying to write a test case for my listView that contains some links.
When the user clicks on 
a link, a certain action should be performed, and it is for this action that
I wish to write a test case for. 

I can get a handle on the ListView by using the
wicketTester.getLastRenderedPage().get("pathToListView");, 
but the problem then is that the listView isn't populated. I thought about
extracting the above method call, 
into a variable, so that the listView is returned, i.e. 

----
MyListView listView =
(MyListView)wicketTester.getLastRenderedPage().get("pathToListView");

// Populate the listView with a model object so that it will populate the
ListView
listView.setModelObject(new ModelObject());

// Create a new ListItem so that the listView can be populated
ListItem listItem = new ListItem(0, listView.getModel());

// Populate the listView with the listItem
listView.populateItem(listItem);

// Execute ajax event
wicketTester.executeAjaxEvent("pathToLinkOnListView","onclick");
----

Would be greatful if somebody could advise me on how to proceed. 

Thanks, 

-- pokkie






-- 
View this message in context: 
http://www.nabble.com/Unit-testing-ListView-tf4427848.html#a12631265
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to