@Test public void testPersonToXml() throws Exception { String xml = beanXmlConverter.convertToString(johnDoe); Element element = XmlUtil.parse(xml); Node id = element.getElementsByTagName("id").item(0); assertEquals("urn:guid:" + johnDoe.getId(), id.getTextContent()); }
@Test public void testPersonToXml() throws Exception { String xml = beanXmlConverter.convertToString(johnDoe); Element element = XmlUtil.parse(xml); Node id = element.getElementsByTagName("id").item(0); assertEquals("urn:guid:" + johnDoe.getId(), id.getTextContent()); }
@Test public void testPersonToXml() throws Exception { String xml = beanXmlConverter.convertToString(johnDoe); Element element = XmlUtil.parse(xml); Node id = element.getElementsByTagName("id").item(0); assertEquals("urn:guid:" + johnDoe.getId(), id.getTextContent()); }
@Test public void testPersonToXml() throws Exception { String xml = XSDValidator.validateOpenSocial(beanXmlConverter.convertToString(johnDoe)); Element element = XmlUtil.parse(xml); Node id = element.getElementsByTagName("id").item(0); assertEquals(johnDoe.getId(), id.getTextContent()); }
@Test public void testPersonToXml() throws Exception { String xml = XSDValidator.validateOpenSocial(beanXmlConverter.convertToString(johnDoe)); Element element = XmlUtil.parse(xml); Node id = element.getElementsByTagName("id").item(0); assertEquals(johnDoe.getId(), id.getTextContent()); }
@Test public void testPersonToXml() throws Exception { String xml = XSDValidator.validateOpenSocial(beanXmlConverter.convertToString(johnDoe)); Element element = XmlUtil.parse(xml); Node id = element.getElementsByTagName("id").item(0); assertEquals(johnDoe.getId(), id.getTextContent()); }
@Test public void testGetPersonAllAppData() throws Exception { Person person = db .getPerson(CANON_USER, ImmutableSet.of("id", "appData"), token).get(); assertNotNull("Canonical user not found", person); assertEquals("Canonical user has wrong id", "canonical", person.getId()); assertEquals("Canonical user has wrong app data", ImmutableMap.of("count", "2", "size", "100"), person.getAppData()); }
@Test public void testGetPersonMultipleAppDataFields() throws Exception { Person person = db .getPerson(CANON_USER, ImmutableSet.of("id", "appData.size", "appData.count", "appData.bogus"), token).get(); assertNotNull("Canonical user not found", person); assertEquals("Canonical user has wrong id", "canonical", person.getId()); assertEquals("Canonical user has wrong app data", ImmutableMap.of("count", "2", "size", "100"), person.getAppData()); }
@Test public void testGetPersonAllAppData() throws Exception { Person person = db .getPerson(CANON_USER, ImmutableSet.of("id", "appData"), token).get(); assertNotNull("Canonical user not found", person); assertEquals("Canonical user has wrong id", "canonical", person.getId()); assertEquals("Canonical user has wrong app data", ImmutableMap.of("count", "2", "size", "100"), person.getAppData()); }
@Test public void testGetPersonAllAppData() throws Exception { Person person = db .getPerson(CANON_USER, ImmutableSet.of("id", "appData"), token).get(); assertNotNull("Canonical user not found", person); assertEquals("Canonical user has wrong id", "canonical", person.getId()); assertEquals("Canonical user has wrong app data", ImmutableMap.of("count", "2", "size", "100"), person.getAppData()); }
@Test public void testGetPersonOneAppDataField() throws Exception { Person person = db .getPerson(CANON_USER, ImmutableSet.of("id", "appData.size"), token).get(); assertNotNull("Canonical user not found", person); assertEquals("Canonical user has wrong id", "canonical", person.getId()); assertEquals("Canonical user has wrong app data", ImmutableMap.of("size", "100"), person.getAppData()); }
@Test public void testGetPersonMultipleAppDataFields() throws Exception { Person person = db .getPerson(CANON_USER, ImmutableSet.of("id", "appData.size", "appData.count", "appData.bogus"), token).get(); assertNotNull("Canonical user not found", person); assertEquals("Canonical user has wrong id", "canonical", person.getId()); assertEquals("Canonical user has wrong app data", ImmutableMap.of("count", "2", "size", "100"), person.getAppData()); }
@Test public void testGetPersonOneAppDataField() throws Exception { Person person = db .getPerson(CANON_USER, ImmutableSet.of("id", "appData.size"), token).get(); assertNotNull("Canonical user not found", person); assertEquals("Canonical user has wrong id", "canonical", person.getId()); assertEquals("Canonical user has wrong app data", ImmutableMap.of("size", "100"), person.getAppData()); }
@Test public void testGetPersonOneAppDataField() throws Exception { Person person = db .getPerson(CANON_USER, ImmutableSet.of("id", "appData.size"), token).get(); assertNotNull("Canonical user not found", person); assertEquals("Canonical user has wrong id", "canonical", person.getId()); assertEquals("Canonical user has wrong app data", ImmutableMap.of("size", "100"), person.getAppData()); }
@Test public void testGetPersonMultipleAppDataFields() throws Exception { Person person = db .getPerson(CANON_USER, ImmutableSet.of("id", "appData.size", "appData.count", "appData.bogus"), token).get(); assertNotNull("Canonical user not found", person); assertEquals("Canonical user has wrong id", "canonical", person.getId()); assertEquals("Canonical user has wrong app data", ImmutableMap.of("count", "2", "size", "100"), person.getAppData()); }
@Test public void testGetPersonDefaultFields() throws Exception { Person person = db .getPerson(CANON_USER, Person.Field.DEFAULT_FIELDS, token).get(); assertNotNull("Canonical user not found", person); assertNotNull("Canonical user has no id", person.getId()); assertNotNull("Canonical user has no name", person.getName()); assertNotNull("Canonical user has no thumbnail", person.getThumbnailUrl()); }
@Test public void testGetAnonymousUser() throws Exception { Person person = db.getPerson(ANONYMOUS, Person.Field.DEFAULT_FIELDS, token).get(); assertEquals("-1", person.getId()); assertEquals("Anonymous", person.getName().getFormatted()); assertEquals("Anonymous", person.getNickname()); }
@Test public void testGetPersonDefaultFields() throws Exception { Person person = db .getPerson(CANON_USER, Person.Field.DEFAULT_FIELDS, token).get(); assertNotNull("Canonical user not found", person); assertNotNull("Canonical user has no id", person.getId()); assertNotNull("Canonical user has no name", person.getName()); assertNotNull("Canonical user has no thumbnail", person.getThumbnailUrl()); }
@Test public void testGetAnonymousUser() throws Exception { Person person = db.getPerson(ANONYMOUS, Person.Field.DEFAULT_FIELDS, token).get(); assertEquals("-1", person.getId()); assertEquals("Anonymous", person.getName().getFormatted()); assertEquals("Anonymous", person.getNickname()); }
@Test public void testGetPersonDefaultFields() throws Exception { Person person = db .getPerson(CANON_USER, Person.Field.DEFAULT_FIELDS, token).get(); assertNotNull("Canonical user not found", person); assertNotNull("Canonical user has no id", person.getId()); assertNotNull("Canonical user has no name", person.getName()); assertNotNull("Canonical user has no thumbnail", person.getThumbnailUrl()); }