Search in sources :

Example 6 with PortBinding

use of org.eclipse.che.plugin.docker.client.json.PortBinding in project che by eclipse.

the class DefaultServerEvaluationStrategyTest method setUp.

@BeforeMethod
public void setUp() {
    serverConfs = new HashMap<>();
    serverConfs.put("4301/tcp", new ServerConfImpl("sysServer1-tcp", "4301/tcp", "http", "/some/path1"));
    serverConfs.put("4305/udp", new ServerConfImpl("devSysServer1-udp", "4305/udp", null, "some/path4"));
    Map<String, List<PortBinding>> ports = new HashMap<>();
    ports.put("4301/tcp", Collections.singletonList(new PortBinding().withHostIp(ALL_IP_ADDRESS).withHostPort("32100")));
    ports.put("4305/udp", Collections.singletonList(new PortBinding().withHostIp(ALL_IP_ADDRESS).withHostPort("32103")));
    when(containerInfo.getNetworkSettings()).thenReturn(networkSettings);
    when(networkSettings.getPorts()).thenReturn(ports);
    when(containerInfo.getConfig()).thenReturn(containerConfig);
    when(containerConfig.getLabels()).thenReturn(Collections.emptyMap());
}
Also used : PortBinding(org.eclipse.che.plugin.docker.client.json.PortBinding) HashMap(java.util.HashMap) List(java.util.List) ServerConfImpl(org.eclipse.che.api.machine.server.model.impl.ServerConfImpl) BeforeMethod(org.testng.annotations.BeforeMethod)

Aggregations

PortBinding (org.eclipse.che.plugin.docker.client.json.PortBinding)6 HashMap (java.util.HashMap)5 List (java.util.List)5 ArrayList (java.util.ArrayList)3 PodList (io.fabric8.kubernetes.api.model.PodList)2 ServiceList (io.fabric8.kubernetes.api.model.ServiceList)2 ServicePort (io.fabric8.kubernetes.api.model.ServicePort)2 IOException (java.io.IOException)2 Arrays (java.util.Arrays)2 Map (java.util.Map)2 Set (java.util.Set)2 Inject (javax.inject.Inject)2 Named (javax.inject.Named)2 ServerConfImpl (org.eclipse.che.api.machine.server.model.impl.ServerConfImpl)2 DockerConnector (org.eclipse.che.plugin.docker.client.DockerConnector)2 ProgressMonitor (org.eclipse.che.plugin.docker.client.ProgressMonitor)2 ImageNotFoundException (org.eclipse.che.plugin.docker.client.exception.ImageNotFoundException)2 ContainerConfig (org.eclipse.che.plugin.docker.client.json.ContainerConfig)2 HostConfig (org.eclipse.che.plugin.docker.client.json.HostConfig)2 CreateContainerParams (org.eclipse.che.plugin.docker.client.params.CreateContainerParams)2