public void setUpSertestDocType() {
        docMan = new DocumentTypeManager();

        DocumentType docInDocType = new DocumentType("docindoc");
        docInDocType.addField(new Field("tull", 2, DataType.STRING));

        docMan.registerDocumentType(docInDocType);

        DocumentType sertestDocType = new DocumentType("sertest");
        sertestDocType.addField(new Field("mailid", 2, DataType.STRING));
        sertestDocType.addField(new Field("date", 3, DataType.INT));
        sertestDocType.addField(new Field("from", 4, DataType.STRING));
        sertestDocType.addField(new Field("to", 6, DataType.STRING));
        sertestDocType.addField(new Field("subject", 9, DataType.STRING));
        sertestDocType.addField(new Field("body", 10, DataType.STRING));
        sertestDocType.addField(new Field("attachmentcount", 11, DataType.INT));
        sertestDocType.addField(new Field("attachments", 1081629685, DataType.getArray(DataType.STRING)));
        sertestDocType.addField(new Field("rawfield", 879, DataType.RAW));
        sertestDocType.addField(new Field("weightedfield", 880, DataType.getWeightedSet(DataType.STRING)));
        sertestDocType.addField(new Field("weightedfieldCreate", 881, DataType.getWeightedSet(DataType.STRING, true, false)));
        sertestDocType.addField(new Field("docindoc", 882, docInDocType));
        sertestDocType.addField(new Field("mapfield", 883, new MapDataType(DataType.STRING, DataType.STRING)));
        sertestDocType.addField(new Field("myposfield", 884, PositionDataType.INSTANCE));
        sertestDocType.addField(new Field("myboolfield", 885, DataType.BOOL));

        docMan.registerDocumentType(sertestDocType);
    }
Test for Document and all its features, including (de)serialization.

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