Examples of VCard


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

  }

  @Test
  public void shouldSetOwnVCard() {
    final VCardResponseTestHandler handler = new VCardResponseTestHandler();
    final VCard vCard = new VCard();
    vCard.setDisplayName("Peter Saint-Andre");
    vCard.setFamilyName("Saint-Andre");
    vCard.setGivenName("Peter");
    vCard.setMiddleName("");
    vCard.setNickName("stpeter");
    manager.updateOwnVCard(vCard, handler);
    session.verifyIQSent(VCARD_SETTED);
  }
View Full Code Here

Examples of net.fortuna.ical4j.vcard.VCard

            while(nextRepresentation == null && (representations.hasNext() ||
                    vcards.hasNext() || files.hasNext())) {
                if(representations.hasNext()){ //if more representations
                    nextRepresentation = representations.next(); //set next
                } else { //else process the next vCard object
                    VCard nextVcard = null;
                    //Iterate while there are still more vCards or files
                    while(nextVcard == null && (vcards.hasNext() || files.hasNext())){
                        if(vcards.hasNext()){ //if there are more vCards               
                            nextVcard = vcards.next(); //get next
                        } else { //parse the next file
View Full Code Here

Examples of net.sourceforge.cardme.vcard.VCard

    vcard.addAllExtendedTypes(null);
  }
 
  @Test
  public void testEquals() throws Exception {
    VCard vcardCopy = getFullVCardNoErrors();
    assertEquals(vcardCopy, vcardFull);
  }
View Full Code Here

Examples of net.sourceforge.cardme.vcard.VCard

    assertEquals(vcardCopy, vcardFull);
  }
 
  @Test
  public void testHashcode() throws Exception {
    VCard vcardCopy = getFullVCardNoErrors();
   
    int h1 = vcardFull.hashCode();
    int h2 = vcardCopy.hashCode();
   
    assertEquals(h1, h2);
  }
View Full Code Here

Examples of net.sourceforge.cardme.vcard.VCard

    assertEquals(h1, h2);
  }
 
  @Test
  public void testClone() {
    VCard cloned = vcardFull.clone();
    assertEquals(vcardFull, cloned);
  }
View Full Code Here

Examples of net.sourceforge.cardme.vcard.VCard

    assertNotNull(vcardString);
    assertFalse(vcardWriter.hasErrors());
   
    VCardEngine vcardEngine = new VCardEngine();
    vcardEngine.setCompatibilityMode(CompatibilityMode.RFC2426);
    VCard _vcard = vcardEngine.parse(vcardString);
   
    assertNotNull(_vcard);
    assertFalse(((VCardErrorHandler)_vcard).hasErrors());
   
    //TODO the below tests fail.
View Full Code Here

Examples of net.sourceforge.cardme.vcard.VCard

    assertFalse(vcardWriter.hasErrors());
    assertTrue("Got " + vcardString, (vcardString.indexOf("D=C3=96e") != -1));
   
    VCardEngine vcardEngine = new VCardEngine();
    vcardEngine.setCompatibilityMode(CompatibilityMode.RFC2426);
    VCard _vcard = vcardEngine.parse(vcardString);
   
    assertEquals("DÖe", _vcard.getN().getFamilyName());
  }
View Full Code Here

Examples of net.sourceforge.cardme.vcard.VCard

  public void testUnfoldingSpaceBug() throws VCardBuildException, IOException, VCardParseException {
   
    /* This string will work just fine as the fold is in the middle of a word */
    final String correctNote = "Lines seem to be unfolded correctly if spaces aren't exactly on a folding boundary.";
   
    VCard vcard = new VCardImpl();
    vcard.setVersion(new VersionType(VCardVersion.V3_0));
    vcard.setName(new NameType("Some Name"));
    vcard.addNote(new NoteType(correctNote));

    VCardWriter writer = new VCardWriter();
    writer.setVCard(vcard);
    String vcardString = writer.buildVCardString();
   
    VCardEngine vcardEngine = new VCardEngine(CompatibilityMode.RFC2426);
    VCard parsedVcard = vcardEngine.parse(vcardString);
   
    assertNotNull(parsedVcard);
    assertTrue(parsedVcard.hasNotes());
    assertTrue(parsedVcard.getNotes().size() == 1);

    String parsedNote = parsedVcard.getNotes().get(0).getNote();
    assertEquals(correctNote, parsedNote);
   
    //------------------------------------------------------
   
    /* This string has the fold right at a space and the space is lost when retrieving it later */
    final String incorrectNote = "Lines seem to be unfolded incorrectly if spaces are just exactly on a folding boundary.";
   
    vcard = new VCardImpl();
    vcard.setVersion(new VersionType(VCardVersion.V3_0));
    vcard.setName(new NameType("Some Name"));
    vcard.addNote(new NoteType(incorrectNote));

    writer = new VCardWriter();
    writer.setVCard(vcard);
    vcardString = writer.buildVCardString();
   
    vcardEngine = new VCardEngine(CompatibilityMode.RFC2426);
    parsedVcard = vcardEngine.parse(vcardString);
   
    assertNotNull(parsedVcard);
    assertTrue(parsedVcard.hasNotes());
    assertTrue(parsedVcard.getNotes().size() == 1);

    parsedNote = parsedVcard.getNotes().get(0).getNote();
    assertEquals(incorrectNote, parsedNote);
  }
View Full Code Here

Examples of net.sourceforge.cardme.vcard.VCard

    assertEquals(VCardTypeName.AGENT.getType(), agentType.getVCardTypeName().getType());
  }
 
  @Test
  public void testEquals() {
    VCard agentVCard2 = new VCardImpl();
    agentVCard2.setN(new NType("Doe", "John"));
    agentVCard2.setFN(new FNType("John Doe"));
   
    AgentType agentType2 = new AgentType();
    agentType2.setAgent(agentVCard2);
   
    assertTrue(agentType.equals(agentType2));
View Full Code Here

Examples of net.sourceforge.cardme.vcard.VCard

    assertTrue(agentType.equals(agentType2));
  }
 
  @Test
  public void testHashcode() {
    VCard agentVCard2 = new VCardImpl();
    agentVCard2.setN(new NType("Doe", "John"));
    agentVCard2.setFN(new FNType("John Doe"));
   
    AgentType agentType2 = new AgentType();
    agentType2.setAgent(agentVCard2);
   
    int hcode1 = agentType.hashCode();
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.