Search in sources :

Example 1 with ComponentFeedbackResourceTestingPage

use of org.apache.wicket.util.tester.apps_8.ComponentFeedbackResourceTestingPage in project wicket by apache.

the class WicketTesterTest method renderComponentRelativeErrorMessage.

/**
 * https://issues.apache.org/jira/browse/WICKET-5128
 */
@Test
public void renderComponentRelativeErrorMessage() {
    tester.startPage(new ComponentFeedbackResourceTestingPage());
    Component label = tester.getComponentFromLastRenderedPage("label");
    tester.assertComponentFeedbackMessage(label, "error.msg", null, new ExactLevelFeedbackMessageFilter(FeedbackMessage.ERROR));
}
Also used : ComponentFeedbackResourceTestingPage(org.apache.wicket.util.tester.apps_8.ComponentFeedbackResourceTestingPage) Component(org.apache.wicket.Component) IRequestableComponent(org.apache.wicket.request.component.IRequestableComponent) MockPageWithOneComponent(org.apache.wicket.MockPageWithOneComponent) FormComponent(org.apache.wicket.markup.html.form.FormComponent) ExactLevelFeedbackMessageFilter(org.apache.wicket.feedback.ExactLevelFeedbackMessageFilter) Test(org.junit.Test)

Example 2 with ComponentFeedbackResourceTestingPage

use of org.apache.wicket.util.tester.apps_8.ComponentFeedbackResourceTestingPage in project wicket by apache.

the class WicketTesterTest method renderComponentRelativeInfoMessage.

/**
 * https://issues.apache.org/jira/browse/WICKET-5128
 */
@Test
public void renderComponentRelativeInfoMessage() {
    tester.startPage(new ComponentFeedbackResourceTestingPage());
    Component label = tester.getComponentFromLastRenderedPage("label");
    tester.assertComponentFeedbackMessage(label, "info.msg", null, new ExactLevelFeedbackMessageFilter(FeedbackMessage.INFO));
}
Also used : ComponentFeedbackResourceTestingPage(org.apache.wicket.util.tester.apps_8.ComponentFeedbackResourceTestingPage) Component(org.apache.wicket.Component) IRequestableComponent(org.apache.wicket.request.component.IRequestableComponent) MockPageWithOneComponent(org.apache.wicket.MockPageWithOneComponent) FormComponent(org.apache.wicket.markup.html.form.FormComponent) ExactLevelFeedbackMessageFilter(org.apache.wicket.feedback.ExactLevelFeedbackMessageFilter) Test(org.junit.Test)

Aggregations

Component (org.apache.wicket.Component)2 MockPageWithOneComponent (org.apache.wicket.MockPageWithOneComponent)2 ExactLevelFeedbackMessageFilter (org.apache.wicket.feedback.ExactLevelFeedbackMessageFilter)2 FormComponent (org.apache.wicket.markup.html.form.FormComponent)2 IRequestableComponent (org.apache.wicket.request.component.IRequestableComponent)2 ComponentFeedbackResourceTestingPage (org.apache.wicket.util.tester.apps_8.ComponentFeedbackResourceTestingPage)2 Test (org.junit.Test)2