@Test
    @SuppressWarnings("deprecation")
    public void testDelegatedDocumentToXml() {
        Document doc = new Document(docMan.getDocumentType("testdoc"), new DocumentId("id:ns:testdoc::xmltest"));
        doc.setFieldValue("stringattr", new StringFieldValue("hello universe"));
        // Should just delegate to toXML
        assertEquals(
                "<document documenttype=\"testdoc\" documentid=\"id:ns:testdoc::xmltest\">\n" +
                "  <stringattr>hello universe</stringattr>\n" +
                "</document>\n",
                doc.toXml());
    }
Test for Document and all its features, including (de)serialization.

@author Thomas Gundersen
@author bratseth
document/src/test/java/com/yahoo/document/DocumentTestCase.java