Search in sources :

Example 1 with IDockerConnectionSettingsFinder

use of org.eclipse.linuxtools.docker.core.IDockerConnectionSettingsFinder in project linuxtools by eclipse.

the class MockDockerConnectionSettingsFinder method noDockerConnectionAvailable.

/**
 * Configures the {@link DockerConnectionManager} singleton to not being
 * able to detect any connection to Docker daemons.
 */
public static void noDockerConnectionAvailable() {
    final IDockerConnectionSettingsFinder noDockerDaemonAvailable = Mockito.mock(IDockerConnectionSettingsFinder.class);
    DockerConnectionManager.getInstance().setConnectionSettingsFinder(noDockerDaemonAvailable);
}
Also used : IDockerConnectionSettingsFinder(org.eclipse.linuxtools.docker.core.IDockerConnectionSettingsFinder)

Example 2 with IDockerConnectionSettingsFinder

use of org.eclipse.linuxtools.docker.core.IDockerConnectionSettingsFinder in project linuxtools by eclipse.

the class MockDockerConnectionSettingsFinder method validTCPConnectionAvailable.

public static void validTCPConnectionAvailable(final String connectionName, final String host, final String pathToCerts) {
    final IDockerConnectionSettingsFinder validTCPSocketConnectionAvailable = Mockito.mock(IDockerConnectionSettingsFinder.class);
    final TCPConnectionSettings tcpConnectionSettings = new TCPConnectionSettings(host, pathToCerts);
    // tcpConnectionSettings.setName("mock");
    tcpConnectionSettings.setSettingsResolved(true);
    Mockito.when(validTCPSocketConnectionAvailable.findDefaultConnectionSettings()).thenReturn(tcpConnectionSettings);
    Mockito.when(validTCPSocketConnectionAvailable.resolveConnectionName(Matchers.any(IDockerConnectionSettings.class))).thenReturn(connectionName);
    DockerConnectionManager.getInstance().setConnectionSettingsFinder(validTCPSocketConnectionAvailable);
}
Also used : IDockerConnectionSettingsFinder(org.eclipse.linuxtools.docker.core.IDockerConnectionSettingsFinder) IDockerConnectionSettings(org.eclipse.linuxtools.docker.core.IDockerConnectionSettings) TCPConnectionSettings(org.eclipse.linuxtools.internal.docker.core.TCPConnectionSettings)

Example 3 with IDockerConnectionSettingsFinder

use of org.eclipse.linuxtools.docker.core.IDockerConnectionSettingsFinder in project linuxtools by eclipse.

the class MockDockerConnectionSettingsFinder method validUnixSocketConnectionAvailable.

/**
 * Configures the {@link DockerConnectionManager} singleton to being able to
 * detect a <strong>valid Unix Socket</strong> to a Docker daemon.
 */
public static void validUnixSocketConnectionAvailable(final String connectionName, final String unixSocketPath) {
    final IDockerConnectionSettingsFinder validUnixSocketConnectionAvailable = Mockito.mock(IDockerConnectionSettingsFinder.class);
    final UnixSocketConnectionSettings unixSocketConnectionSettings = new UnixSocketConnectionSettings(unixSocketPath);
    // unixSocketConnectionSettings.setName("mock");
    unixSocketConnectionSettings.setSettingsResolved(true);
    Mockito.when(validUnixSocketConnectionAvailable.findDefaultConnectionSettings()).thenReturn(unixSocketConnectionSettings);
    Mockito.when(validUnixSocketConnectionAvailable.resolveConnectionName(Matchers.any(IDockerConnectionSettings.class))).thenReturn(connectionName);
    DockerConnectionManager.getInstance().setConnectionSettingsFinder(validUnixSocketConnectionAvailable);
}
Also used : IDockerConnectionSettingsFinder(org.eclipse.linuxtools.docker.core.IDockerConnectionSettingsFinder) UnixSocketConnectionSettings(org.eclipse.linuxtools.internal.docker.core.UnixSocketConnectionSettings) IDockerConnectionSettings(org.eclipse.linuxtools.docker.core.IDockerConnectionSettings)

Aggregations

IDockerConnectionSettingsFinder (org.eclipse.linuxtools.docker.core.IDockerConnectionSettingsFinder)3 IDockerConnectionSettings (org.eclipse.linuxtools.docker.core.IDockerConnectionSettings)2 TCPConnectionSettings (org.eclipse.linuxtools.internal.docker.core.TCPConnectionSettings)1 UnixSocketConnectionSettings (org.eclipse.linuxtools.internal.docker.core.UnixSocketConnectionSettings)1