Java 类com.google.gwt.user.client.ui.MultiWordSuggestOracle.MultiWordSuggestion 实例源码

项目:RedQueryBuilder    文件:GwtTestBasics.java   
@Test
public void testAsyncOptionSelectedFromBootstrap() throws Exception {
    CapturingConfiguration config = new CapturingConfiguration();

    Session sess = createSession(config);

    List<Object> args = new ArrayList<Object>();
    args.add("M");
    CommandBuilder cb = new CommandBuilder(sess, "SELECT x.id FROM Person x WHERE sex = ?", args);
    RootPanel.get().add(cb);
    Select s = cb.getSelect();

    // only now give them the enumeration
    Collection<Suggestion> s2 = new ArrayList();
    s2.add(new MultiWordSuggestion("M", "M"));
    s2.add(new MultiWordSuggestion("F", "F"));

    config.getEnumerateCallback().onSuccess(new Response(s2));

    Comparison c = (Comparison) s.getCondition();
    Parameter p = (Parameter) c.getRight();
    SelectEditorWidget sew = (SelectEditorWidget) p.getEditorWidget();
    assertEquals("M", sew.getValue());
}