Search in sources :

Example 1 with DummyPage

use of org.apache.wicket.resource.DummyPage in project wicket by apache.

the class ListenerRequestHandlerTest method removedComponent.

/**
 * WICKET-5466
 */
@Test
public void removedComponent() {
    // non-existing component on fresh page is ignored
    PageAndComponentProvider freshPage = new PageAndComponentProvider(DummyPage.class, null, "foo");
    new ListenerRequestHandler(freshPage).respond(tester.getRequestCycle());
    // non-existing component on old page fails
    PageAndComponentProvider oldPage = new PageAndComponentProvider(new DummyPage(), "foo");
    try {
        new ListenerRequestHandler(oldPage).respond(tester.getRequestCycle());
        fail();
    } catch (WicketRuntimeException ex) {
        assertEquals("Component 'foo' has been removed from page.", ex.getMessage());
    }
}
Also used : WicketRuntimeException(org.apache.wicket.WicketRuntimeException) DummyPage(org.apache.wicket.resource.DummyPage) Test(org.junit.Test)

Aggregations

WicketRuntimeException (org.apache.wicket.WicketRuntimeException)1 DummyPage (org.apache.wicket.resource.DummyPage)1 Test (org.junit.Test)1