Examples of VCardEngine


Examples of net.sourceforge.cardme.engine.VCardEngine

    String vcardString = vcardWriter.buildVCardString();
   
    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.engine.VCardEngine

   
    assertNotNull(vcardString);
    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.engine.VCardEngine

    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);

View Full Code Here

Examples of net.sourceforge.cardme.engine.VCardEngine

 
  @Test
  public void testEvolutionVCard() throws IOException, VCardParseException {
    File evoCard = new File(System.getProperty("user.dir")+File.separator+"test"+File.separator+"vcards"+File.separator+"John_Doe_EVOLUTION.vcf");
   
    VCardEngine engine = new VCardEngine();
    engine.setCompatibilityMode(CompatibilityMode.EVOLUTION);
    VCard vcard = engine.parse(evoCard);
   
    //VERSION
    assertEquals(VCardVersion.V3_0, vcard.getVersion().getVersion());
   
    //URL
View Full Code Here

Examples of net.sourceforge.cardme.engine.VCardEngine

 
  @Test
  public void testGmailVCard() throws IOException, VCardParseException {
    File gmailCard = new File(System.getProperty("user.dir")+File.separator+"test"+File.separator+"vcards"+File.separator+"John_Doe_GMAIL.vcf");
   
    VCardEngine engine = new VCardEngine();
    engine.setCompatibilityMode(CompatibilityMode.GMAIL);
    VCard vcard = engine.parse(gmailCard);
   
    //VERSION
    assertEquals(VCardVersion.V3_0, vcard.getVersion().getVersion());
   
    //FN
View Full Code Here

Examples of net.sourceforge.cardme.engine.VCardEngine

 
  @Test
  public void testIPhoneVCard() throws IOException, VCardParseException {
    File iphoneCard = new File(System.getProperty("user.dir")+File.separator+"test"+File.separator+"vcards"+File.separator+"John_Doe_IPHONE.vcf");
   
    VCardEngine engine = new VCardEngine();
    engine.setCompatibilityMode(CompatibilityMode.I_PHONE);
    VCard vcard = engine.parse(iphoneCard);
   
    //VERSION
    assertEquals(VCardVersion.V3_0, vcard.getVersion().getVersion());
   
    //PRODID
View Full Code Here

Examples of net.sourceforge.cardme.engine.VCardEngine

    //3: NOTE and ADR are not folded but there is a space in the word "floor"
    //we need some more proper samples.
   
    File lotusNotesCard = new File(System.getProperty("user.dir")+File.separator+"test"+File.separator+"vcards"+File.separator+"John_Doe_LOTUS_NOTES.vcf");
   
    VCardEngine engine = new VCardEngine();
    engine.setCompatibilityMode(CompatibilityMode.MAC_ADDRESS_BOOK);
    VCard vcard = engine.parse(lotusNotesCard);
   
    //VERSION
    assertEquals(VCardVersion.V3_0, vcard.getVersion().getVersion());
   
    //PRODID
View Full Code Here

Examples of net.sourceforge.cardme.engine.VCardEngine

 
  @Test
  public void testMsOutlookVCard() throws IOException, VCardParseException {
    File msOutlookCard = new File(System.getProperty("user.dir")+File.separator+"test"+File.separator+"vcards"+File.separator+"John_Doe_MS_OUTLOOK.vcf");
   
    VCardEngine engine = new VCardEngine();
    engine.setCompatibilityMode(CompatibilityMode.MS_OUTLOOK);
    VCard vcard = engine.parse(msOutlookCard);
   
    //VERSION
    assertEquals(VCardVersion.V2_1, vcard.getVersion().getVersion());
   
    //N
View Full Code Here

Examples of net.sourceforge.cardme.engine.VCardEngine

 
  @Test
  public void testMacAddressBookVCard() throws IOException, VCardParseException {
    File macAddressBookCard = new File(System.getProperty("user.dir")+File.separator+"test"+File.separator+"vcards"+File.separator+"John_Doe_MAC_ADDRESS_BOOK.vcf");
   
    VCardEngine engine = new VCardEngine();
    engine.setCompatibilityMode(CompatibilityMode.MAC_ADDRESS_BOOK);
    VCard vcard = engine.parse(macAddressBookCard);
   
    //VERSION
    assertEquals(VCardVersion.V3_0, vcard.getVersion().getVersion());
   
    //N
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.