@Override
        public void run() {
            CreateVisitorMessage msg = new CreateVisitorMessage("SomeLibrary", "myvisitor", "newyork", "london");
            msg.setDocumentSelection("true and false or true");
            msg.getParameters().put("myvar", Utf8.toBytes("somevalue"));
            msg.getParameters().put("anothervar", Utf8.toBytes("34"));
            msg.getBuckets().add(new BucketId(16, 1234));
            msg.setVisitRemoves(true);
            msg.setFieldSet("foo bar");
            msg.setMaxBucketsPerVisitor(2);
            msg.setBucketSpace(BUCKET_SPACE);
            assertEquals(BASE_MESSAGE_LENGTH + 178 + serializedLength(BUCKET_SPACE), serialize("CreateVisitorMessage", msg));

            for (Language lang : LANGUAGES) {
                msg = (CreateVisitorMessage)deserialize("CreateVisitorMessage", DocumentProtocol.MESSAGE_CREATEVISITOR, lang);
                assertEquals("SomeLibrary", msg.getLibraryName());
                assertEquals("myvisitor", msg.getInstanceId());
                assertEquals("newyork", msg.getControlDestination());
                assertEquals("london", msg.getDataDestination());
                assertEquals("true and false or true", msg.getDocumentSelection());
                assertEquals(8, msg.getMaxPendingReplyCount());
                assertEquals(true, msg.getVisitRemoves());
                assertEquals("foo bar", msg.getFieldSet());
                assertEquals(false, msg.getVisitInconsistentBuckets());
                assertEquals(1, msg.getBuckets().size());
                assertEquals(new BucketId(16, 1234), msg.getBuckets().iterator().next());
                assertEquals("somevalue", Utf8.toString(msg.getParameters().get("myvar")));
                assertEquals("34", Utf8.toString(msg.getParameters().get("anothervar")));
                assertEquals(2, msg.getMaxBucketsPerVisitor());
                assertEquals(BUCKET_SPACE, msg.getBucketSpace());
            }

            msg.getBuckets().clear();

            assertEquals("CreateVisitorMessage(" +
                            "No buckets, " +
                            "selection 'true and false or true', " +
                            "bucket space 'bjarne', " +
                            "library SomeLibrary, including removes, " +
                            "get fields: foo bar" +
                            ")",
                    msg.toString());

            msg.getBuckets().add(new BucketId(16, 1234));

            assertEquals("CreateVisitorMessage(" +
                            "Bucket BucketId(0x40000000000004d2), " +
                            "selection 'true and false or true', " +
                            "bucket space 'bjarne', " +
                            "library SomeLibrary, including removes, " +
                            "get fields: foo bar" +
                            ")",
                    msg.toString());

            msg.getBuckets().add(new BucketId(16, 1235));
            msg.getBuckets().add(new BucketId(16, 1236));
            msg.getBuckets().add(new BucketId(16, 1237));
            msg.getBuckets().add(new BucketId(16, 1238));
            msg.setFromTimestamp(10001);
            msg.setToTimestamp(20002);
            msg.setVisitInconsistentBuckets(true);
            assertEquals("CreateVisitorMessage(" +
                            "5 buckets: BucketId(0x40000000000004d2) BucketId(0x40000000000004d3) BucketId(0x40000000000004d4) ..., " +
                            "time 10001-20002, " +
                            "selection 'true and false or true', " +
                            "bucket space 'bjarne', " +
                            "library SomeLibrary, including removes, " +
                            "get fields: foo bar, " +
                            "visit inconsistent buckets" +
                            ")",
                    msg.toString());
        }
@author Simon Thoresen Hult
@author Vegard Sjonfjell
documentapi/src/test/java/com/yahoo/documentapi/messagebus/protocol/Messages60TestCase.java