初めての Wicket コンポーネントを書きました :)ListView
いくつかのRadio
入力フィールドを持つ が含まれています。ここで、選択した値がモデルに到達するかどうかを単体テストしたいと思います。
フォームを期待するように、私はそのWicketTester.newFormTester("myForm")
場でフォームを作成しようとします:
public void testDataBinding()
{
Model model = ...
MyRadioComponent myRadioComponent = new MyRadioComponent (...);
Form form = new Form("myForm", ...);
form.add(myRadioComponent);
WicketTester wicketTester = new WicketTester();
wicketTester.startComponentInPage(form);
// FormTester formTester = wicketTester.newFormTester("myForm");
// ...
}
wicketTester.startComponentInPage(form)
結果は次のようになります。
Failed: Component [myForm] (path = [0:x]) must be applied to a tag of type [form],
not: '<span wicket:id="myForm" id="myForm3">'
これを修正する方法、および/またはそのような入力コンポーネントを正しい方法でテストする方法はありますか?