use of org.apache.wicket.mock.MockWebResponse in project wicket by apache.
the class XmlPartialPageUpdateTest method removedComponentAreNotWritten.
/**
* WICKET-6503 removed components are not written, but no exception raised either.
*/
@Test
public void removedComponentAreNotWritten() throws Exception {
PageForPartialUpdate page = new PageForPartialUpdate();
tester.startPage(page);
XmlPartialPageUpdate update = new XmlPartialPageUpdate(page);
update.add(new Label("notInPage"), "notInPage");
MockWebResponse response = new MockWebResponse();
update.writeTo(response, "UTF-8");
assertFalse("notInPage not written", response.getTextResponse().toString().contains("notInPage"));
}
use of org.apache.wicket.mock.MockWebResponse in project openmeetings by apache.
the class ApplicationHelper method ensureApplication.
public static IApplication ensureApplication(Long langId) {
IApplication a = ensureApplication();
if (ThreadContext.getRequestCycle() == null) {
ServletWebRequest req = new ServletWebRequest(new MockHttpServletRequest((Application) a, new MockHttpSession(a.getServletContext()), a.getServletContext()), "");
RequestCycleContext rctx = new RequestCycleContext(req, new MockWebResponse(), a.getRootRequestMapper(), a.getExceptionMapperProvider().get());
ThreadContext.setRequestCycle(new RequestCycle(rctx));
}
if (ThreadContext.getSession() == null) {
WebSession s = WebSession.get();
if (langId > 0) {
((IWebSession) s).setLanguage(langId);
}
}
return a;
}
Aggregations