Package com.calclab.emite.xep.dataforms

Examples of com.calclab.emite.xep.dataforms.Form.addField()


        form.addInstruction(fieldResults.getInstructions());
        for (final String fieldName : fieldResults.getFieldNames()) {
          final Field field = new Field();
          field.setType(Field.Type.TEXT_SINGLE);
          field.setVar(fieldName);
          form.addField(field);
        }
        listener.onSuccess(form);
      }

      @Override
View Full Code Here


  /**
   * Example 8 and 9 of XEP-0055
   */
  public void testSearchUsingForms() {
    final Form form = new Form(Form.Type.submit);
    form.addField(new Field(FieldType.HIDDEN).Var("FORM_TYPE").Value("jabber:iq:search"));
    form.addField(new Field().Var("x-gender").Value("male"));
    final ResultListener<Form> result = Mockito.mock(ResultListener.class);
    manager.search(form, result);

    session.verifyIQSent("<iq type='set' from='romeo@montague.net/home' to='search.service' xml:lang='en'>"
View Full Code Here

   * Example 8 and 9 of XEP-0055
   */
  public void testSearchUsingForms() {
    final Form form = new Form(Form.Type.submit);
    form.addField(new Field(FieldType.HIDDEN).Var("FORM_TYPE").Value("jabber:iq:search"));
    form.addField(new Field().Var("x-gender").Value("male"));
    final ResultListener<Form> result = Mockito.mock(ResultListener.class);
    manager.search(form, result);

    session.verifyIQSent("<iq type='set' from='romeo@montague.net/home' to='search.service' xml:lang='en'>"
        + "<query xmlns='jabber:iq:search'><x xmlns='jabber:x:data' type='submit'>"
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.