Examples of VCardResponse


Examples of com.calclab.emite.xep.vcard.VCardResponse

  @Test
  public void shouldParseEmptyVCard() {
    final String VCARD_EMPTY = "<iq id='v1' to='stpeter@jabber.org/roundabout' type='result'>\n" + "<vCard xmlns='vcard-temp' /></iq>";
    final XMLPacket result = XMLBuilder.fromXML(VCARD_EMPTY);
    final VCardResponse response = new VCardResponse(result);
    assertEquals(IQ.Type.result, response.getType());
    assertFalse(response.hasVCard());
    assertNull(response.getVCard());
  }
View Full Code Here

Examples of com.calclab.emite.xep.vcard.VCardResponse

  @Test
  public void shouldParseItemNotFound() {
    final String ITEM_NOT_FOUND = "<iq id='v1'\n" + "    to='stpeter@jabber.org/roundabout'\n" + "    type='error'>\n" + "  <vCard xmlns='vcard-temp'/>\n"
        + "  <error type='cancel'>\n" + "    <item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>\n" + "  </error>\n" + "</iq>";
    final XMLPacket result = XMLBuilder.fromXML(ITEM_NOT_FOUND);
    final VCardResponse response = new VCardResponse(result);
    assertEquals(IQ.Type.error, response.getType());
    assertTrue(response.isError());
  }
View Full Code Here

Examples of com.calclab.emite.xep.vcard.VCardResponse

  @Test
  public void shouldParseReturnsVCard() {
    final String VCARD_RESPONSE = "<iq id='v1' to='stpeter@jabber.org/roundabout' type='result'>\n"
        + "<vCard xmlns='vcard-temp'><FN>Peter Saint-Andre</FN></vCard></iq>";
    final XMLPacket result = XMLBuilder.fromXML(VCARD_RESPONSE);
    final VCardResponse response = new VCardResponse(result);
    assertEquals(IQ.Type.result, response.getType());
    assertTrue(response.isSuccess());
    assertTrue(response.hasVCard());
    assertNotNull(response.getVCard());
  }
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.