Search in sources :

Example 1 with DefaultDockerConnectionSettingsFinder

use of org.eclipse.linuxtools.internal.docker.core.DefaultDockerConnectionSettingsFinder in project linuxtools by eclipse.

the class DockerConnectionManagerTest method testExtensionPointProvidedConnections.

@Test
public void testExtensionPointProvidedConnections() {
    DefaultDockerConnectionSettingsFinder finder = new DefaultDockerConnectionSettingsFinder();
    List<IDockerConnectionSettings> settings = finder.getKnownConnectionSettings();
    assertTrue(settings.size() > 0);
    for (IDockerConnectionSettings s : settings) {
        if (s instanceof TCPConnectionSettings) {
            TCPConnectionSettings t = (TCPConnectionSettings) s;
            assertThat(t.getType()).isEqualTo(BindingType.TCP_CONNECTION);
            assertThat(t.getHost()).isEqualTo("https://1.2.3.4:5678");
            assertThat(t.getPathToCertificates()).isEqualTo("/foo/bar/baz/certs");
            assertThat(t.getName()).isEqualTo("https://1.2.3.4:5678");
        } else if (s instanceof UnixSocketConnectionSettings) {
            UnixSocketConnectionSettings t = (UnixSocketConnectionSettings) s;
            // skip if this is the Linux native or Docker for Mac daemon
            if (t.getPath().equals("unix:///var/run/docker.sock")) {
                continue;
            }
            assertThat(t.getType()).isEqualTo(BindingType.UNIX_SOCKET_CONNECTION);
            assertThat(t.getPath()).isEqualTo("unix:///foo/bar/baz/docker.sock");
            assertThat(t.getName()).isEqualTo("unix:///foo/bar/baz/docker.sock");
        } else {
            fail("Docker Connection Settings does not match a known type");
        }
    }
}
Also used : DefaultDockerConnectionSettingsFinder(org.eclipse.linuxtools.internal.docker.core.DefaultDockerConnectionSettingsFinder) UnixSocketConnectionSettings(org.eclipse.linuxtools.internal.docker.core.UnixSocketConnectionSettings) TCPConnectionSettings(org.eclipse.linuxtools.internal.docker.core.TCPConnectionSettings) Test(org.junit.Test)

Example 2 with DefaultDockerConnectionSettingsFinder

use of org.eclipse.linuxtools.internal.docker.core.DefaultDockerConnectionSettingsFinder in project linuxtools by eclipse.

the class ClearConnectionManagerRule method after.

@Override
protected void after() {
    removeAllConnections(DockerConnectionManager.getInstance());
    DockerConnectionManagerUtils.configureConnectionManager();
    DockerConnectionManager.getInstance().setConnectionSettingsFinder(new DefaultDockerConnectionSettingsFinder());
}
Also used : DefaultDockerConnectionSettingsFinder(org.eclipse.linuxtools.internal.docker.core.DefaultDockerConnectionSettingsFinder)

Aggregations

DefaultDockerConnectionSettingsFinder (org.eclipse.linuxtools.internal.docker.core.DefaultDockerConnectionSettingsFinder)2 TCPConnectionSettings (org.eclipse.linuxtools.internal.docker.core.TCPConnectionSettings)1 UnixSocketConnectionSettings (org.eclipse.linuxtools.internal.docker.core.UnixSocketConnectionSettings)1 Test (org.junit.Test)1