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);
}
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);
}
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);
}
Aggregations