*
*/
public void test1()
{
tester.setupRequestAndResponse();
WebRequestCycle cycle = tester.createRequestCycle();
cycle.getSession().setLocale(Locale.ENGLISH);
// test English/ default
TestPage page = new TestPage();
Form form = (Form)page.get("form1");
assertNotNull(form);
page.getText1().setInput("");
page.getText1().validateRequired();
page.getText2().setInput("");
page.getText2().validateRequired();
page.getText3().setInput("");
page.getText3().validateRequired();
page.getText4().setInput("");
page.getText4().validateRequired();
page.getText5().setInput("");
page.getText5().validateRequired();
page.getText6().setInput("");
page.getText6().validateRequired();
page.getText7().setInput("");
page.getText7().validateRequired();
page.getText8().setInput("");
page.getText8().validateRequired();
page.getText9().setInput("");
page.getText9().validateRequired();
page.getText10().setInput("");
page.getText10().validateRequired();
page.getText11().setInput("");
page.getText11().validateRequired();
page.getText12().setInput("");
page.getText12().validateRequired();
assertEquals("text1label is required", page.getText1()
.getFeedbackMessage()
.getMessage()
.toString());
assertEquals("text2 is required", page.getText2()
.getFeedbackMessage()
.getMessage()
.toString());
assertEquals("ok: text3333 is missing", page.getText3()
.getFeedbackMessage()
.getMessage()
.toString());
assertEquals("ok: Text4Label is missing", page.getText4()
.getFeedbackMessage()
.getMessage()
.toString());
assertEquals("ok: text is missing", page.getText5()
.getFeedbackMessage()
.getMessage()
.toString());
assertEquals("Default message: text6 required", page.getText6()
.getFeedbackMessage()
.getMessage()
.toString());
assertEquals("input for text7-Label is missing", page.getText7()
.getFeedbackMessage()
.getMessage()
.toString());
assertEquals("Default message: text8-Label required", page.getText8()
.getFeedbackMessage()
.getMessage()
.toString());
assertEquals("found it in panel", page.getText9()
.getFeedbackMessage()
.getMessage()
.toString());
assertEquals("found it in form", page.getText10()
.getFeedbackMessage()
.getMessage()
.toString());
assertEquals("found it in page", page.getText11()
.getFeedbackMessage()
.getMessage()
.toString());
assertEquals("found it in page", page.getText12()
.getFeedbackMessage()
.getMessage()
.toString());
// Test caching
assertEquals("Default message: text8-Label required", page.getText8()
.getFeedbackMessage()
.getMessage()
.toString());
// now test Dutch
cycle.getSession().setLocale(new Locale("nl"));
page = new TestPage();
form = (Form)page.get("form1");
assertNotNull(form);
page.getText1().setInput("");