@Test
    public void testProcessingUpdates() {
        DocumentType articleType = new DocumentType("article");
        Field bodyField = new Field("body", DataType.STRING);
        Field titleField = new Field("title", DataType.STRING);
        articleType.addField(bodyField);
        articleType.addField(titleField);
        dtm = new DocumentTypeManager();
        dtm.registerDocumentType(articleType);

        put = new DocumentPut(articleType, "id:banana:article::1");
        put.getDocument().setFieldValue("body", "this is the body of the article, blah blah blah");
        FieldUpdate upd = FieldUpdate.createAssign(articleType.getField("body"), new StringFieldValue("this is the updated body of the article, blahdi blahdi blahdi"));
        update = new DocumentUpdate(articleType, new DocumentId("id:grape:article::2"));
        update.addFieldUpdate(upd);

        DocprocService service = new DocprocService("update");
        DocumentProcessor firstP = new TitleDocumentProcessor();
        service.setCallStack(new CallStack().addLast(firstP));
        service.setInService(true);



        Processing p = new Processing();
        p.addDocumentOperation(put);
        p.addDocumentOperation(update);

        service.process(p);

        while (service.doWork()) {  }

        List<DocumentOperation> operations = p.getDocumentOperations();
        Document first = ((DocumentPut)operations.get(0)).getDocument();
        assertEquals(new StringFieldValue("this is the body of the article, blah blah blah"), first.getFieldValue("body"));
        assertEquals(new StringFieldValue("body blah blah blah "), first.getFieldValue("title"));

        DocumentUpdate second = (DocumentUpdate) operations.get(1);
        FieldUpdate firstUpd = second.getFieldUpdate(bodyField);
        assertEquals(ValueUpdate.ValueUpdateClassID.ASSIGN, firstUpd.getValueUpdate(0).getValueUpdateClassID());
        assertEquals(new StringFieldValue("this is the updated body of the article, blahdi blahdi blahdi"), firstUpd.getValueUpdate(0)
                                                                                              .getValue());

        FieldUpdate secondUpd = second.getFieldUpdate(titleField);
        assertEquals(ValueUpdate.ValueUpdateClassID.ASSIGN, secondUpd.getValueUpdate(0).getValueUpdateClassID());
        assertEquals(new StringFieldValue("body blahdi blahdi blahdi "), secondUpd.getValueUpdate(0).getValue());
    }
Simple test case for testing that processing of both documents and
document updates works.

@author Einar M R Rosenvinge
docproc/src/test/java/com/yahoo/docproc/ProcessingUpdateTestCase.java