Package net.sourceforge.cardme.vcard.types

Examples of net.sourceforge.cardme.vcard.types.NoteType


    //NOTE
    {
      List<NoteType> it = vcard.getNotes();
      assertEquals(1, it.size());
     
      NoteType f = it.get(0);
      assertEquals("THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \\\"AS IS\\\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\nFavotire Color: Blue", f.getNote());
    }
   
    //URL
    {
      List<UrlType> it = vcard.getUrls();
      assertEquals(1, it.size());
     
      UrlType f = it.get(0);
      assertEquals("item4", f.getGroup());
      assertEquals("http://www.ibm.com", f.getRawUrl());
     
      List<UrlParamType> types = f.getParams();
      assertEquals(1, types.size());
      assertTrue(types.contains(UrlParamType.PREF));
    }
   
    //BDAY
    {
      BDayType f = vcard.getBDay();
      assertEquals(2012, f.getBirthday().get(Calendar.YEAR));
      assertEquals(Calendar.JUNE, f.getBirthday().get(Calendar.MONTH));
      assertEquals(6, f.getBirthday().get(Calendar.DAY_OF_MONTH));
      assertEquals(ISOFormat.ISO8601_DATE_EXTENDED, f.getISO8601Format());
    }
   
    //PHOTO
    {
      List<PhotoType> it = vcard.getPhotos();
      assertEquals(1, it.size());
     
      PhotoType f = it.get(0);
      assertEquals(EncodingType.BINARY, f.getEncodingType());
      assertEquals(null, f.getImageMediaType());
      assertEquals(18242, f.getPhoto().length);
    }
   
    //custom types
    {
      List<ExtendedType> it = vcard.getExtendedTypes();
      assertEquals(9, it.size());
     
      ExtendedType f = it.get(0);
      assertEquals("X-PHONETIC-FIRST-NAME", f.getExtendedName());
      assertEquals("Jon", f.getExtendedValue());
     
      f = it.get(1);
      assertEquals("X-PHONETIC-LAST-NAME", f.getExtendedName());
      assertEquals("Dow", f.getExtendedValue());
     
      f = it.get(2);
      assertEquals("item1", f.getGroup());
      assertEquals("X-ABLABEL", f.getExtendedName());
      assertEquals("AssistantPhone", f.getExtendedValue());

      f = it.get(3);
      assertEquals("item2", f.getGroup());
      assertEquals("X-ABADR", f.getExtendedName());
      assertEquals("Silicon Alley", f.getExtendedValue());
     
      f = it.get(4);
      assertEquals("item3", f.getGroup());
      assertEquals("X-ABADR", f.getExtendedName());
      assertEquals("Street 4, Building 6,\nFloor 8\nNew York\nUSA", f.getExtendedValue());
     
      f = it.get(5);
      assertEquals("item4", f.getGroup());
      assertEquals("X-ABLABEL", f.getExtendedName());
      assertEquals("_$!<HomePage>!$_", f.getExtendedValue());
     
      f = it.get(6);
      assertEquals("item5", f.getGroup());
      assertEquals("X-ABRELATEDNAMES", f.getExtendedName());
      assertEquals("Jenny", f.getExtendedValue());
     
      List<ExtendedParamType> xlist = f.getExtendedParams();
      assertEquals(1, xlist.size());
      assertEquals("TYPE", xlist.get(0).getTypeName());
      assertEquals("PREF", xlist.get(0).getTypeValue());
     
      f = it.get(7);
      assertEquals("item5", f.getGroup());
      assertEquals("X-ABLABEL", f.getExtendedName());
      assertEquals("Spouse", f.getExtendedValue());
     
      f = it.get(8);
      assertEquals("X-ABUID", f.getExtendedName());
      assertEquals("6B29A774-D124-4822-B8D0-2780EC117F60:ABPerson", f.getExtendedValue());
    }
   
    VCardImpl vcard2 = (VCardImpl)vcard;
   
    if(vcard2.hasErrors()) {
View Full Code Here

TOP

Related Classes of net.sourceforge.cardme.vcard.types.NoteType

Copyright © 2018 www.massapicom. 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.