use of org.apache.gora.persistency.impl.BeanFactoryImpl in project gora by apache.
the class MemStoreTest method testGetWithFields.
@Test
public void testGetWithFields() throws Exception {
DataStore<String, WebPage> store = new MemStore<>();
BeanFactory<String, WebPage> beanFactory = new BeanFactoryImpl<>(String.class, WebPage.class);
store.setBeanFactory(beanFactory);
WebPageDataCreator.createWebPageData(store);
String[] interestFields = new String[2];
interestFields[0] = "url";
interestFields[1] = "content";
WebPage page = store.get(URLS[1], interestFields);
assertNotNull(page);
assertNotNull(page.getUrl());
assertEquals(page.getUrl().toString(), URLS[1]);
assertNotNull(page.getContent());
assertEquals("Map of Outlinks should have a size of '0' as it is omitted at retrieval", 0, page.getOutlinks().size());
assertEquals("Map of Parsed Content should have a size of '0' as it is omitted at retrieval", 0, page.getParsedContent().size());
}
Aggregations