use of org.eclipse.scout.rt.client.ui.desktop.IDesktop in project scout.rt by eclipse.
the class JsonAdapterRegistryTest method testFormOpenedAndClosedInSameRequest.
public static void testFormOpenedAndClosedInSameRequest(UiSession uiSession) throws JSONException {
JsonDesktop<IDesktop> jsonDesktop = UiSessionTestUtility.newJsonAdapter(uiSession, uiSession.getClientSession().getDesktop(), null);
FormWithOneField form = new FormWithOneField();
form.start();
JsonForm formAdapter = (JsonForm) jsonDesktop.getAdapter(form);
assertNotNull(formAdapter);
form.doClose();
formAdapter = (JsonForm) jsonDesktop.getAdapter(form);
assertNull(formAdapter);
assertEquals(1, uiSession.currentJsonResponse().eventList().size());
assertEquals(uiSession.getUiSessionId(), uiSession.currentJsonResponse().eventList().get(0).getTarget());
assertEquals("disposeAdapter", uiSession.currentJsonResponse().eventList().get(0).getType());
assertEquals(0, uiSession.currentJsonResponse().adapterMap().size());
}
Aggregations