예제 #1
0
  @Test
  public void testRenderItems() throws IOException, JSONException {
    combo.setItems(new String[] {"a", "b", "c"});
    lca.renderChanges(combo);

    Message message = Fixture.getProtocolMessage();
    String expected = "[ \"a\", \"b\", \"c\" ]";
    JSONArray actual = (JSONArray) message.findSetProperty(combo, "items");
    assertTrue(ProtocolTestUtil.jsonEquals(expected, actual));
  }
예제 #2
0
  @Test
  public void testRenderSelection() throws IOException, JSONException {
    combo.setText("foo bar");

    combo.setSelection(new Point(1, 3));
    lca.renderChanges(combo);

    Message message = Fixture.getProtocolMessage();
    JSONArray actual = (JSONArray) message.findSetProperty(combo, "selection");
    assertTrue(ProtocolTestUtil.jsonEquals("[ 1, 3 ]", actual));
  }