@Override
        public void run() {
            PutDocumentMessage msg = new PutDocumentMessage(new DocumentPut(new Document(protocol.getDocumentTypeManager().getDocumentType("testdoc"), "id:ns:testdoc::")));

            msg.setTimestamp(666);
            msg.setCondition(new TestAndSetCondition(CONDITION_STRING));

            int size_of_create_if_non_existent_flag = 1;
            int expected_serialized_size = BASE_MESSAGE_LENGTH + 45 + serializedLength(msg.getCondition().getSelection()) + size_of_create_if_non_existent_flag;
            assertEquals(expected_serialized_size, serialize("PutDocumentMessage", msg));

            for (Language lang : LANGUAGES) {
                final PutDocumentMessage deserializedMsg = (PutDocumentMessage)deserialize("PutDocumentMessage", DocumentProtocol.MESSAGE_PUTDOCUMENT, lang);
                assertEquals(msg.getDocumentPut().getDocument().getDataType().getName(), deserializedMsg.getDocumentPut().getDocument().getDataType().getName());
                assertEquals(msg.getDocumentPut().getDocument().getId().toString(), deserializedMsg.getDocumentPut().getDocument().getId().toString());
                assertEquals(msg.getTimestamp(), deserializedMsg.getTimestamp());
                assertEquals(msg.getCondition().getSelection(), deserializedMsg.getCondition().getSelection());
                assertEquals(false, deserializedMsg.getCreateIfNonExistent());
            }
            verifyCreateIfNonExistentFlag();
        }
@author Simon Thoresen Hult
@author Vegard Sjonfjell
documentapi/src/test/java/com/yahoo/documentapi/messagebus/protocol/Messages60TestCase.java