sshd-benchmarks/src/main/java/org/apache/sshd/benchmarks/sftp/upload/CatBenchmark.java [58:96]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        public SftpUploadBenchmark() {
            super();
        }

        @Override
        protected void prepare() throws Exception {
            // Create a client, session and SftpClient
            sshClient = createClient();
        }

        private SshClient createClient() throws Exception {
            SshClient client = SshClient.setUpDefaultClient();
            if ("jsch".equals(settings)) {
                // Same as JSch default
                client.setCipherFactoriesNames("aes128-ctr");
                client.setMacFactoriesNames("hmac-sha2-256-etm@openssh.com");
            }
            client.setServerKeyVerifier((s, a, k) -> true);
            // Load the user key
            try (InputStream in = Files.newInputStream(Paths.get(sftpKey), StandardOpenOption.READ)) {
                Iterable<KeyPair> clientKeys = SecurityUtils.loadKeyPairIdentities(null, null, in, null);
                client.setKeyIdentityProvider(s -> clientKeys);
            }
            client.start();
            return client;
        }

        @Override
        protected void endTests() throws Exception {
            if (sshClient != null) {
                sshClient.close(false);
            }
        }

        @Override
        protected void setupSession() throws Exception {
            sshSession = sshClient.connect(sftpUser, sftpHost, Integer.parseInt(sftpPort)).verify().getClientSession();
            sshSession.auth().verify(2000);
            sftpClient = SftpClientFactory.instance().createSftpClient(sshSession);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



sshd-benchmarks/src/main/java/org/apache/sshd/benchmarks/sftp/upload/SshBenchmark.java [56:94]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        public SftpUploadBenchmark() {
            super();
        }

        @Override
        protected void prepare() throws Exception {
            // Create a client, session and SftpClient
            sshClient = createClient();
        }

        private SshClient createClient() throws Exception {
            SshClient client = SshClient.setUpDefaultClient();
            if ("jsch".equals(settings)) {
                // Same as JSch default
                client.setCipherFactoriesNames("aes128-ctr");
                client.setMacFactoriesNames("hmac-sha2-256-etm@openssh.com");
            }
            client.setServerKeyVerifier((s, a, k) -> true);
            // Load the user key
            try (InputStream in = Files.newInputStream(Paths.get(sftpKey), StandardOpenOption.READ)) {
                Iterable<KeyPair> clientKeys = SecurityUtils.loadKeyPairIdentities(null, null, in, null);
                client.setKeyIdentityProvider(s -> clientKeys);
            }
            client.start();
            return client;
        }

        @Override
        protected void endTests() throws Exception {
            if (sshClient != null) {
                sshClient.close(false);
            }
        }

        @Override
        protected void setupSession() throws Exception {
            sshSession = sshClient.connect(sftpUser, sftpHost, Integer.parseInt(sftpPort)).verify().getClientSession();
            sshSession.auth().verify(2000);
            sftpClient = SftpClientFactory.instance().createSftpClient(sshSession);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



