@Test
    void testCommandLineLongOptions() throws Exception {
        // short options testing (for options that do not collide with each other)
        String[] args = new String[]{
                "--datahandler", "foo.remote",
                "--selection", "'id.user=1234'",
                "--from", "5678",
                "--to", "9012",
                "--fieldset", "foodoc.bar,foodoc.baz",
                "--maxpending", "6000",
                "--maxbuckets", "5",
                "--progress", "foo-progress.txt",
                "--maxpendingsuperbuckets", "3",
                "--buckettimeout", "123456789",
                "--cluster", "kittens",
                "--visitinconsistentbuckets",
                "--visitlibrary", "fnord",
                "--libraryparam", "asdf", "rargh",
                "--libraryparam", "pinkie", "pie",
                "--processtime", "555",
                "--maxtotalhits", "2002",
                "--tracelevel", "8",
                "--priority", "NORMAL_1",
                "--skipbucketsonfatalerrors",
                "--abortonclusterdown",
                "--visitremoves",
                "--bucketspace", "outerspace",
                "--shorttensors",
                "--slices", "16",
                "--sliceid", "5"
        };
        VdsVisit.ArgumentParser parser = createMockArgumentParser();
        VdsVisit.VdsVisitParameters allParams = parser.parse(args);
        assertNotNull(allParams);

        VisitorParameters params = allParams.getVisitorParameters();
        assertNotNull(params);

        assertEquals("foo.remote", params.getRemoteDataHandler());
        assertEquals("'id.user=1234'", params.getDocumentSelection());
        assertEquals(5678, params.getFromTimestamp());
        assertEquals(9012, params.getToTimestamp());
        assertEquals("foodoc.bar,foodoc.baz", params.getFieldSet());
        assertEquals(6000, params.getMaxPending());
        assertEquals(5, params.getMaxBucketsPerVisitor());
        assertEquals("foo-progress.txt", params.getResumeFileName());
        assertEquals(123456789, params.getTimeoutMs());
        assertEquals(7 * 24 * 60 * 60 * 1000, allParams.getFullTimeout());
        assertEquals("kittens", allParams.getCluster());
        assertTrue(allParams.tensorShortForm());

        assertTrue(params.getThrottlePolicy() instanceof StaticThrottlePolicy);
        assertEquals(3, ((StaticThrottlePolicy) params.getThrottlePolicy()).getMaxPendingCount());

        assertTrue(params.visitInconsistentBuckets());
        assertEquals("fnord", params.getVisitorLibrary());
        // TODO: FIXME? multiple library params doesn't work
        assertArrayEquals("rargh".getBytes(), params.getLibraryParameters().get("asdf"));
        //assertTrue(Arrays.equals("pie".getBytes(), params.getLibraryParameters().get("pinkie")));
        assertEquals(555, allParams.getProcessTime());
        assertEquals(2002, params.getMaxTotalHits());
        assertEquals(8, params.getTraceLevel());
        assertEquals(DocumentProtocol.Priority.NORMAL_1, params.getPriority());
        assertTrue(allParams.getAbortOnClusterDown());
        assertTrue(params.visitRemoves());

        assertEquals(16, params.getSlices());
        assertEquals(5, params.getSliceId());

        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
        PrintStream printStream = new PrintStream(outputStream);
        VdsVisit.verbosePrintParameters(allParams, printStream);
        printStream.flush();
        String nl = System.getProperty("line.separator"); // the joys of running tests on windows
        assertEquals(joinLines(
                "Time out visitor after 123456789 ms.",
                "Visiting documents matching: 'id.user=1234'",
                "Visiting bucket space: outerspace",
                "Visiting in the inclusive timestamp range 5678 - 9012.",
                "Visiting field set foodoc.bar,foodoc.baz.",
                "Visiting inconsistent buckets.",
                "Including remove entries.",
                "Tracking progress in file: foo-progress.txt",
                "Let visitor have maximum 6000 replies pending on data handlers per storage node visitor.",
                "Visit maximum 5 buckets per visitor.",
                "Sending data to data handler at: foo.remote",
                "Using visitor library 'fnord'.",
                "Adding the following library specific parameters:",
                "  asdf = rargh",
                "Visitor priority NORMAL_1",
                "Skip visiting super buckets with fatal errors.",
                "Visiting slice 5 out of 16 slices"),
                outputStream.toString(StandardCharsets.UTF_8));
    }
Test the parameters that could not be used in conjunction with
those in the first parameter test.
vespaclient-java/src/test/java/com/yahoo/vespavisit/VdsVisitTestCase.java