@Test public void solrXmlLoaderTest() throws Exception { SolrXMLIngestMapper.SolrXMLLoader loader = new SolrXMLIngestMapper().createXmlLoader("foo", "id"); Collection<LWDocument> docs = loader .readDocs(new ByteArrayInputStream(TEST_XML_1.getBytes("UTF-8")), "junk"); assertNotNull("Didn't get docs", docs); Assert.assertEquals(3, docs.size()); for (LWDocument doc : docs) { assertNotNull("doc.id is null", doc.getId()); } docs = loader .readDocs(new ByteArrayInputStream("<foo>this is junk</foo>".getBytes("UTF-8")), "junk"); Assert.assertEquals(0, docs.size()); try { docs = loader .readDocs(new ByteArrayInputStream(TEST_XML_1.substring(0, 100).getBytes("UTF-8")), "junk"); fail(); } catch (XMLStreamException e) { } }
public SolrXMLLoader createXmlLoader(String collection, String idField) { return new SolrXMLLoader(collection, idField); }
SolrXMLIngestMapper extends AbstractIngestMapper<Writable, Text> { public SolrXMLLoader createXmlLoader(String collection, String idField) { return new SolrXMLLoader(collection, idField); } }
SolrXMLIngestMapper extends AbstractIngestMapper<Writable, Text> { public SolrXMLLoader createXmlLoader(String collection, String idField) { return new SolrXMLLoader(collection, idField); }  }
SolrXMLIngestMapper extends AbstractIngestMapper<Writable, Text> { public SolrXMLLoader createXmlLoader(String collection, String idField) { return new SolrXMLLoader(collection, idField); }  SolrXMLLoader createXmlLoader(String collection, String idField); @Override AbstractJobFixture getFixture(); @Override void configure(JobConf conf); }
SolrXMLIngestMapper extends AbstractIngestMapper<Writable, Text> { public SolrXMLLoader createXmlLoader(String collection, String idField) { return new SolrXMLLoader(collection, idField); }  SolrXMLLoader createXmlLoader(String collection, String idField); @Override AbstractJobFixture getFixture(); @Override void configure(JobConf conf);  }