Dan Syrstad-2 wrote:
>
> Actually, Page.detach() is not callable from a JUnit test that uses
> WicketTester in 1.3.0beta3. It throws an exception:
>
I used your code and the test passed. Here is my test page:
<html>
<body>
test
</body>
</html>
public class Test extends WebPage {
public Test() {
ListView listView = new ListView("listView", Arrays
.asList(new String[] { "a", "b" })) {
protected void populateItem(final ListItem item) {
item.add(new Label("labelWithDetachableModel",
new
LoadableDetachableModel() {
protected Object load() {
return item.getModelObject();
}
}));
}
};
add(listView);
}
}
However, I really think your test case is broken. After startPage() returns,
the page has been detached. Why it passes on my computer is because
of your call to debugComponentTrees(). Therefore, you should really be
testing if the model is now detached. That's it. By checking the output
you can be sure that the model was once attached.
--
Kent Tong
Wicket tutorials freely available at http://www.agileskills2.org/EWDW
--
View this message in context:
http://www.nabble.com/Page.detachModels%28%29-not-working-like-it-used-to-tf4549247.html#a13057290
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]