protected void assertProcessingWorks(DocprocService service) {
        // Create documents
        DocumentType type = new DocumentType("test");
        type.addField("test", DataType.STRING);
        DocumentPut put1 = new DocumentPut(type, new DocumentId("id:permanentfailure:test::1"));
        DocumentPut put2 = new DocumentPut(type, new DocumentId("id:permanentfailure:test::2"));
        DocumentPut put3 = new DocumentPut(type, new DocumentId("id:permanentfailure:test::3"));

        // Process them
        service.process(put1);
        service.process(put2);
        service.process(put3);
        while (service.doWork()) {}

        // Verify
        assertEquals(new StringFieldValue("done 3"), put1.getDocument().getFieldValue("test"));
        assertEquals(new StringFieldValue("done 2"), put2.getDocument().getFieldValue("test")); // Due to PERMANENT_FAILURE in 2
        assertNull(put3.getDocument().getFieldValue("test"));  //service is disabled now
        assertFalse(service.isInService());

        service.setInService(true);
        while (service.doWork()) {}

        assertEquals(new StringFieldValue("done 3"), put3.getDocument().getFieldValue("test"));
        assertTrue(service.isInService());
    }
Tests chaining of some processors, and execution of the processors
on some documents
docproc/src/test/java/com/yahoo/docproc/FailingPermanentlyDocumentProcessingTestCase.java