" <CLASS><PUBLIC/></CLASS>\n" +
" </vCard>\n" +
"</iq>\n";
IQ iq = unmarshal(xml, IQ.class);
VCard vCard = iq.getExtension(VCard.class);
Assert.assertNotNull(vCard);
Assert.assertEquals(vCard.getFormattedName(), "Peter Saint-Andre");
Assert.assertNotNull(vCard.getName());
Assert.assertEquals(vCard.getName().getFamilyName(), "Saint-Andre");
Assert.assertEquals(vCard.getName().getGivenName(), "Peter");
Assert.assertEquals(vCard.getName().getMiddleName(), "");
Assert.assertEquals(vCard.getNickName(), "stpeter");
Assert.assertEquals(vCard.getUrl().toString(), new URL("http://www.xmpp.org/xsf/people/stpeter.shtml").toString());
Calendar calendar = new GregorianCalendar();
calendar.setTime(vCard.getBirthday());
Assert.assertEquals(calendar.get(Calendar.YEAR), 1966);
Assert.assertEquals(calendar.get(Calendar.MONTH), Calendar.AUGUST);
Assert.assertEquals(calendar.get(Calendar.DATE), 6);
Assert.assertNotNull(vCard.getOrganization());
Assert.assertEquals(vCard.getOrganization().getOrganizationName(), "XMPP Standards Foundation");
Assert.assertEquals(vCard.getOrganization().getOrgUnits().size(), 1);
Assert.assertEquals(vCard.getTitle(), "Executive Director");
Assert.assertEquals(vCard.getRole(), "Patron Saint");
Assert.assertEquals(vCard.getTelephoneNumbers().size(), 6);
Assert.assertEquals(vCard.getTelephoneNumbers().get(0).getNumber(), "303-308-3282");
Assert.assertTrue(vCard.getTelephoneNumbers().get(0).isVoice());
Assert.assertTrue(vCard.getTelephoneNumbers().get(0).isWork());
Assert.assertTrue(vCard.getTelephoneNumbers().get(1).isFax());
Assert.assertTrue(vCard.getTelephoneNumbers().get(1).isWork());
Assert.assertTrue(vCard.getTelephoneNumbers().get(2).isMsg());
Assert.assertTrue(vCard.getTelephoneNumbers().get(2).isWork());
Assert.assertEquals(vCard.getTelephoneNumbers().get(3).getNumber(), "303-555-1212");
Assert.assertTrue(vCard.getTelephoneNumbers().get(3).isVoice());
Assert.assertTrue(vCard.getTelephoneNumbers().get(3).isHome());
Assert.assertTrue(vCard.getTelephoneNumbers().get(4).isFax());
Assert.assertTrue(vCard.getTelephoneNumbers().get(4).isHome());
Assert.assertTrue(vCard.getTelephoneNumbers().get(5).isMsg());
Assert.assertTrue(vCard.getTelephoneNumbers().get(5).isHome());
Assert.assertTrue(vCard.getEmails().get(0).isPreferred());
Assert.assertTrue(vCard.getEmails().get(0).isInternet());
Assert.assertEquals(vCard.getEmails().get(0).getEmail(), "stpeter@jabber.org");
Assert.assertEquals(vCard.getJid(), Jid.valueOf("stpeter@jabber.org"));
Assert.assertEquals(vCard.getCategories().size(), 1);
Assert.assertEquals(vCard.getCategories().get(0), "test");
Assert.assertEquals(vCard.getDesc(), "\n" +
" More information about me is located on my \n" +
" personal website: http://www.saint-andre.com/\n" +
" ");
}