Package com.xebialabs.overthere.util

Examples of com.xebialabs.overthere.util.DefaultAddressPortMapper


    @Test(expectedExceptions = IllegalArgumentException.class)
    @SuppressWarnings("resource")
    public void shouldNotAcceptPasswordPromptRegexWithWildcardStar() {
        ConnectionOptions options = new ConnectionOptions(connectionOptions);
        options.set(SUDO_PASSWORD_PROMPT_REGEX, "assword*");
        new SshInteractiveSudoConnection(SSH_PROTOCOL, options, new DefaultAddressPortMapper());
    }
View Full Code Here


    @Test(expectedExceptions = IllegalArgumentException.class)
    @SuppressWarnings("resource")
    public void shouldNotAcceptPasswordPromptRegexWithWildcardQuestion() {
        ConnectionOptions options = new ConnectionOptions(connectionOptions);
        options.set(SUDO_PASSWORD_PROMPT_REGEX, "assword?");
        new SshInteractiveSudoConnection(SSH_PROTOCOL, options, new DefaultAddressPortMapper());
    }
View Full Code Here

    @Test
    @SuppressWarnings("resource")
    public void shouldAcceptPasswordPromptRegex() {
        ConnectionOptions options = new ConnectionOptions(connectionOptions);
        options.set(SUDO_PASSWORD_PROMPT_REGEX, "[Pp]assword.*:");
        SshInteractiveSudoConnection connection = new SshInteractiveSudoConnection(SSH_PROTOCOL, options, new DefaultAddressPortMapper());
        connection.close();
    }
View Full Code Here

    @Test
    public void shouldSetAllocatePtyIfNoDefaultPtyAndNoPtySet() throws NoSuchFieldException, IllegalAccessException {
        ConnectionOptions options = new ConnectionOptions(connectionOptions);
        options.set(ALLOCATE_DEFAULT_PTY, false);
        options.set(ALLOCATE_PTY, null);
        SshInteractiveSudoConnection sshInteractiveSudoConnection = new SshInteractiveSudoConnection(SSH_PROTOCOL, options, new DefaultAddressPortMapper());
        try {
            Field allocatePty = SshConnection.class.getDeclaredField("allocatePty");
            allocatePty.setAccessible(true);
            assertThat((String) allocatePty.get(sshInteractiveSudoConnection), equalTo("vt220:80:24:0:0"));
        } finally {
View Full Code Here

import static com.xebialabs.overthere.ssh.SshConnectionBuilder.SSH_PROTOCOL;

public class PresetClientSshConnection extends SshConnection {

    public PresetClientSshConnection(ConnectionOptions options, final SSHClient clientToReturn) {
        super(SSH_PROTOCOL, options, new DefaultAddressPortMapper());
        sshClientFactory = new Factory<SSHClient>() {
            @Override
            public SSHClient create() {
                return clientToReturn;
            }
View Full Code Here

        connectionOptions.set(OPERATING_SYSTEM, UNIX);
        connectionOptions.set(ADDRESS, "nowhere.example.com");
        connectionOptions.set(USERNAME, "some-user");
        connectionOptions.set(PASSWORD, "foo");
        connectionOptions.set(SUDO_USERNAME, "some-other-user");
        resolver = new DefaultAddressPortMapper();
    }
View Full Code Here

    /**
     * Constructs a connection to the local host.
     */
    public LocalConnection(String protocol, ConnectionOptions options) {
        this(protocol, options, new DefaultAddressPortMapper());
    }
View Full Code Here

TOP

Related Classes of com.xebialabs.overthere.util.DefaultAddressPortMapper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.