@Test
    public void testDeserialize() {
        setUpSertestDocType();

        BufferSerializer buf = new BufferSerializer();
        try {
            new Document(DocumentDeserializerFactory.createHead(docMan, buf.getBuf()));
            fail();
        } catch (Exception e) {
            assertTrue(true);
        }

        buf = BufferSerializer.wrap("Hello world".getBytes());
        try {
            new Document(DocumentDeserializerFactory.createHead(docMan, buf.getBuf()));
            fail();
        } catch (Exception e) {
            assertTrue(true);
        }
    }
Test for Document and all its features, including (de)serialization.

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