Cyberduck Mountain Duck CLI

Changeset 43656


Ignore:
Timestamp:
Jan 8, 2018 2:14:43 PM (6 months ago)
Author:
dkocher
Message:

Add test.

Location:
shelves/01.2018
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • shelves/01.2018

    • Property subgit:lock changed from commit:5555df2ab234c2ab26a868377ca6ed180477b455 timestamp:2018-01-08T21:15:49.441 to commit:3addf9cbd3de5011ecbfc4e874a04616cb4fece0 timestamp:2018-01-08T21:15:51.347
  • shelves/01.2018/dracoon/src/test/java/ch/cyberduck/core/sds/SDSSessionTest.java

    r43655 r43656  
    2020import ch.cyberduck.core.exception.LoginCanceledException;
    2121import ch.cyberduck.core.exception.LoginFailureException;
     22import ch.cyberduck.core.exception.ProxyLoginFailureException;
    2223import ch.cyberduck.core.proxy.Proxy;
    2324import ch.cyberduck.core.proxy.ProxyFinder;
    2425import ch.cyberduck.core.serializer.impl.dd.ProfilePlistReader;
    2526import ch.cyberduck.core.ssl.DefaultX509KeyManager;
     27import ch.cyberduck.core.ssl.DefaultX509TrustManager;
    2628import ch.cyberduck.core.ssl.DisabledX509TrustManager;
     29import ch.cyberduck.core.ssl.KeychainX509KeyManager;
    2730import ch.cyberduck.test.IntegrationTest;
    2831
     32import org.junit.Ignore;
    2933import org.junit.Test;
    3034import org.junit.experimental.categories.Category;
     
    187191        session.close();
    188192    }
     193
     194    @Ignore
     195    @Test(expected = ProxyLoginFailureException.class)
     196    public void testConnectProxyInvalidCredentials() throws Exception {
     197        final Host host = new Host(new SDSProtocol(), "duck.ssp-europe.eu", new Credentials(
     198            System.getProperties().getProperty("sds.user"), System.getProperties().getProperty("sds.key")
     199        ));
     200        final SDSSession session = new SDSSession(host, new DefaultX509TrustManager(),
     201            new KeychainX509KeyManager(host, new DisabledCertificateStore()), new ProxyFinder() {
     202            @Override
     203            public Proxy find(final Host target) {
     204                return new Proxy(Proxy.Type.HTTP, "localhost", 3128);
     205            }
     206        }) {
     207        };
     208        final LoginConnectionService c = new LoginConnectionService(
     209            new DisabledLoginCallback() {
     210                @Override
     211                public Credentials prompt(final Host bookmark, final String username, final String title, final String reason, final LoginOptions options) throws LoginCanceledException {
     212                    return new Credentials("test", "n");
     213                }
     214            },
     215            new DisabledHostKeyCallback(),
     216            new DisabledPasswordStore(),
     217            new DisabledProgressListener()
     218        );
     219        c.connect(session, PathCache.empty(), new DisabledCancelCallback());
     220        session.close();
     221    }
    189222}
Note: See TracChangeset for help on using the changeset viewer.
swiss made software