Search in sources :

Example 61 with IDesktop

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());
}
Also used : JsonForm(org.eclipse.scout.rt.ui.html.json.form.JsonForm) FormWithOneField(org.eclipse.scout.rt.ui.html.json.form.fixtures.FormWithOneField) IDesktop(org.eclipse.scout.rt.client.ui.desktop.IDesktop)

Aggregations

IDesktop (org.eclipse.scout.rt.client.ui.desktop.IDesktop)61 Test (org.junit.Test)36 IOutline (org.eclipse.scout.rt.client.ui.desktop.outline.IOutline)18 IRunnable (org.eclipse.scout.rt.platform.util.concurrent.IRunnable)7 JsonAdapterRegistryTest (org.eclipse.scout.rt.ui.html.json.JsonAdapterRegistryTest)7 IOutlineViewButton (org.eclipse.scout.rt.client.ui.desktop.outline.IOutlineViewButton)5 JsonEvent (org.eclipse.scout.rt.ui.html.json.JsonEvent)5 JsonForm (org.eclipse.scout.rt.ui.html.json.form.JsonForm)5 JSONObject (org.json.JSONObject)5 ITreeNode (org.eclipse.scout.rt.client.ui.basic.tree.ITreeNode)4 IClientSession (org.eclipse.scout.rt.client.IClientSession)3 ITree (org.eclipse.scout.rt.client.ui.basic.tree.ITree)3 IForm (org.eclipse.scout.rt.client.ui.form.IForm)3 DesktopWithOneOutline (org.eclipse.scout.rt.ui.html.json.desktop.fixtures.DesktopWithOneOutline)3 OutlineViewButton (org.eclipse.scout.rt.ui.html.json.desktop.fixtures.OutlineViewButton)3 OutlineWithOneNode (org.eclipse.scout.rt.ui.html.json.desktop.fixtures.OutlineWithOneNode)3 FormWithOneField (org.eclipse.scout.rt.ui.html.json.form.fixtures.FormWithOneField)3 PropertyChangeEvent (java.beans.PropertyChangeEvent)2 PropertyChangeListener (java.beans.PropertyChangeListener)2 Locale (java.util.Locale)2