Cyberduck Mountain Duck CLI

Changeset 16941


Ignore:
Timestamp:
Feb 23, 2015 3:19:02 PM (7 years ago)
Author:
dkocher
Message:

Update dependency. Fix length field for SSH_FXP_WRITE packets https://github.com/dkocher/sshj/commit/68a054529b7d836a903a1c55aaf241b70e958c50. Fix #8603. Add test.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/ch/cyberduck/core/sftp/SFTPWriteFeatureTest.java

    r16859 r16941  
    1616import ch.cyberduck.core.PathCache;
    1717import ch.cyberduck.core.exception.NotfoundException;
     18import ch.cyberduck.core.io.BandwidthThrottle;
    1819import ch.cyberduck.core.io.StreamCopier;
     20import ch.cyberduck.core.io.ThrottledOutputStream;
    1921import ch.cyberduck.core.shared.DefaultHomeFinderService;
    2022import ch.cyberduck.core.transfer.TransferStatus;
     
    4143
    4244    @Test
    43     public void testWrite() throws Exception {
     45    public void testWriteThrottled() throws Exception {
    4446        final Host host = new Host(new SFTPProtocol(), "test.cyberduck.ch", new Credentials(
    4547                properties.getProperty("sftp.user"), properties.getProperty("sftp.password")
     
    5355        status.setLength(content.length);
    5456        final Path test = new Path(session.workdir(), UUID.randomUUID().toString(), EnumSet.of(Path.Type.file));
    55         final OutputStream out = new SFTPWriteFeature(session).write(test, status);
     57        final OutputStream out = new ThrottledOutputStream(new SFTPWriteFeature(session).write(test, status),
     58                new BandwidthThrottle(102400f));
    5659        assertNotNull(out);
    5760        new StreamCopier(status, status).transfer(new ByteArrayInputStream(content), out);
Note: See TracChangeset for help on using the changeset viewer.