@Test
    public void testDocInDoc() throws Exception {
        DocumentTypeManager m = new DocumentTypeManager();
        DocumentTypeManagerConfigurer
                .configure(m, "file:src/test/java/com/yahoo/document/documentmanager.docindoc.cfg");

        VespaXMLFeedReader parser = new VespaXMLFeedReader("src/test/vespaxmlparser/test_docindoc.xml", m);
        List<FeedOperation> ops = parser.readAll();

        assertEquals(1, ops.size());
        FeedOperation op = ops.get(0);
        System.err.println(op);

        assertEquals(FeedOperation.Type.DOCUMENT, op.getType());
        assertNull(op.getDocumentRemove());
        assertNull(op.getDocumentUpdate());
        assertNotNull(op.getDocumentPut().getDocument());

        Document doc = op.getDocumentPut().getDocument();

        assertEquals("outerdoc", doc.getDataType().getName());
        assertEquals("id:outer:outerdoc::this:is:outer:doc", doc.getId().toString());
        assertEquals(1, doc.getFieldCount());

        Array lst = (Array)doc.getFieldValue("innerdocuments");
        assertNotNull(lst);
        assertEquals(3, lst.size());

        Document child = (Document)lst.get(0);
        assertEquals(2, child.getFieldCount());
        assertEquals("Peter Sellers", child.getFieldValue("name").toString());
        assertEquals("Comedian", child.getFieldValue("content").toString());

        child = (Document)lst.get(1);
        assertEquals(2, child.getFieldCount());
        assertEquals("Ole Olsen", child.getFieldValue("name").toString());
        assertEquals("Common man", child.getFieldValue("content").toString());

        child = (Document)lst.get(2);
        assertEquals(2, child.getFieldCount());
        assertEquals("Stein Nilsen", child.getFieldValue("name").toString());
        assertEquals("Worker", child.getFieldValue("content").toString());
    }
Simple test case for Vespa XML parser.

@author sveina
document/src/test/java/com/yahoo/vespaxmlparser/VespaXMLReaderTestCase.java