Search in sources :

Example 1 with SERVER_CONF_LABEL_PREFIX

use of org.eclipse.che.api.environment.server.EnvironmentParser.SERVER_CONF_LABEL_PREFIX in project che by eclipse.

the class EnvironmentParserTest method environmentWithServersProvider.

@DataProvider(name = "environmentWithServersProvider")
public static Object[][] environmentWithServersProvider() {
    // Format of result array:
    // [ [environment object, expected che services environment object, @Nullable compose representation of environment], ... ]
    List<List<Object>> data = new ArrayList<>();
    data.add(getEntryForDockerfileEnv(emptyMap(), emptyList(), emptyMap()));
    data.add(getEntryForDockerfileEnv(singletonMap("ref1", new ServerConf2Impl("8080", "http", emptyMap())), singletonList("8080/tcp"), splitOnPairsAsMap(SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_PROTOCOL_SUFFIX, "http", SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_REF_SUFFIX, "ref1")));
    data.add(getEntryForDockerfileEnv(singletonMap("ref1", new ServerConf2Impl("8080/tcp", "http", emptyMap())), singletonList("8080/tcp"), splitOnPairsAsMap(SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_PROTOCOL_SUFFIX, "http", SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_REF_SUFFIX, "ref1")));
    data.add(getEntryForDockerfileEnv(singletonMap("ref1", new ServerConf2Impl("8080/udp", "http", emptyMap())), singletonList("8080/udp"), splitOnPairsAsMap(SERVER_CONF_LABEL_PREFIX + "8080/udp" + SERVER_CONF_LABEL_PROTOCOL_SUFFIX, "http", SERVER_CONF_LABEL_PREFIX + "8080/udp" + SERVER_CONF_LABEL_REF_SUFFIX, "ref1")));
    data.add(getEntryForDockerfileEnv(singletonMap("ref1", new ServerConf2Impl("8080", "https", emptyMap())), singletonList("8080/tcp"), splitOnPairsAsMap(SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_PROTOCOL_SUFFIX, "https", SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_REF_SUFFIX, "ref1")));
    data.add(getEntryForDockerfileEnv(singletonMap("ref1", new ServerConf2Impl("8080", "https", singletonMap("path", "/some/path"))), singletonList("8080/tcp"), splitOnPairsAsMap(SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_PROTOCOL_SUFFIX, "https", SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_REF_SUFFIX, "ref1", SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_PATH_SUFFIX, "/some/path")));
    data.add(getEntryForDockerfileEnv(singletonMap("ref1", new ServerConf2Impl("8080", "https", singletonMap("path", "some/path"))), singletonList("8080/tcp"), splitOnPairsAsMap(SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_PROTOCOL_SUFFIX, "https", SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_REF_SUFFIX, "ref1", SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_PATH_SUFFIX, "some/path")));
    data.add(getEntryForDockerfileEnv(singletonMap("ref1", new ServerConf2Impl("8080", "https", singletonMap("path", ""))), singletonList("8080/tcp"), splitOnPairsAsMap(SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_PROTOCOL_SUFFIX, "https", SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_REF_SUFFIX, "ref1", SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_PATH_SUFFIX, "")));
    data.add(getEntryForDockerfileEnv(singletonMap("ref1", new ServerConf2Impl("8080", "https", singletonMap("path", null))), singletonList("8080/tcp"), splitOnPairsAsMap(SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_PROTOCOL_SUFFIX, "https", SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_REF_SUFFIX, "ref1")));
    data.add(getEntryForDockerfileEnv(singletonMap("ref1", new ServerConf2Impl("8080", null, emptyMap())), singletonList("8080/tcp"), splitOnPairsAsMap(SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_REF_SUFFIX, "ref1")));
    data.add(getEntryForDockerfileEnv(singletonMap("ref1", new ServerConf2Impl("8080", "https", splitOnPairsAsMap("some", "value"))), singletonList("8080/tcp"), splitOnPairsAsMap(SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_PROTOCOL_SUFFIX, "https", SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_REF_SUFFIX, "ref1")));
    data.add(getEntryForDockerfileEnv(singletonMap("ref1", new ServerConf2Impl("8080", "https", splitOnPairsAsMap("some", "value", "path", "some"))), singletonList("8080/tcp"), splitOnPairsAsMap(SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_PROTOCOL_SUFFIX, "https", SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_REF_SUFFIX, "ref1", SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_PATH_SUFFIX, "some")));
    data.add(getEntryForDockerfileEnv(serversMap("ref1", new ServerConf2Impl("8080", "https", singletonMap("path", "some/path")), "ref2", new ServerConf2Impl("9090", "http", singletonMap("path", "/some/path"))), asList("8080/tcp", "9090/tcp"), splitOnPairsAsMap(SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_PROTOCOL_SUFFIX, "https", SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_REF_SUFFIX, "ref1", SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_PATH_SUFFIX, "some/path", SERVER_CONF_LABEL_PREFIX + "9090/tcp" + SERVER_CONF_LABEL_PROTOCOL_SUFFIX, "http", SERVER_CONF_LABEL_PREFIX + "9090/tcp" + SERVER_CONF_LABEL_REF_SUFFIX, "ref2", SERVER_CONF_LABEL_PREFIX + "9090/tcp" + SERVER_CONF_LABEL_PATH_SUFFIX, "/some/path")));
    data.add(getEntryForDockerfileEnv(serversMap("ref1", new ServerConf2Impl("8080", "https", singletonMap("path", "some/path")), "ref2", new ServerConf2Impl("8080/udp", "http", singletonMap("path", "/some/path"))), asList("8080/tcp", "8080/udp"), splitOnPairsAsMap(SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_PROTOCOL_SUFFIX, "https", SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_REF_SUFFIX, "ref1", SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_PATH_SUFFIX, "some/path", SERVER_CONF_LABEL_PREFIX + "8080/udp" + SERVER_CONF_LABEL_PROTOCOL_SUFFIX, "http", SERVER_CONF_LABEL_PREFIX + "8080/udp" + SERVER_CONF_LABEL_REF_SUFFIX, "ref2", SERVER_CONF_LABEL_PREFIX + "8080/udp" + SERVER_CONF_LABEL_PATH_SUFFIX, "/some/path")));
    data.add(getEntryForDockerimageEnv(emptyMap(), emptyList(), emptyMap()));
    data.add(getEntryForDockerimageEnv(singletonMap("ref1", new ServerConf2Impl("8080", "http", emptyMap())), singletonList("8080/tcp"), splitOnPairsAsMap(SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_PROTOCOL_SUFFIX, "http", SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_REF_SUFFIX, "ref1")));
    data.add(getEntryForDockerimageEnv(singletonMap("ref1", new ServerConf2Impl("8080/tcp", "http", emptyMap())), singletonList("8080/tcp"), splitOnPairsAsMap(SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_PROTOCOL_SUFFIX, "http", SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_REF_SUFFIX, "ref1")));
    data.add(getEntryForDockerimageEnv(singletonMap("ref1", new ServerConf2Impl("8080/udp", "http", emptyMap())), singletonList("8080/udp"), splitOnPairsAsMap(SERVER_CONF_LABEL_PREFIX + "8080/udp" + SERVER_CONF_LABEL_PROTOCOL_SUFFIX, "http", SERVER_CONF_LABEL_PREFIX + "8080/udp" + SERVER_CONF_LABEL_REF_SUFFIX, "ref1")));
    data.add(getEntryForDockerimageEnv(singletonMap("ref1", new ServerConf2Impl("8080", "https", emptyMap())), singletonList("8080/tcp"), splitOnPairsAsMap(SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_PROTOCOL_SUFFIX, "https", SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_REF_SUFFIX, "ref1")));
    data.add(getEntryForDockerimageEnv(singletonMap("ref1", new ServerConf2Impl("8080", "https", singletonMap("path", "/some/path"))), singletonList("8080/tcp"), splitOnPairsAsMap(SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_PROTOCOL_SUFFIX, "https", SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_REF_SUFFIX, "ref1", SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_PATH_SUFFIX, "/some/path")));
    data.add(getEntryForDockerimageEnv(singletonMap("ref1", new ServerConf2Impl("8080", "https", singletonMap("path", "some/path"))), singletonList("8080/tcp"), splitOnPairsAsMap(SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_PROTOCOL_SUFFIX, "https", SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_REF_SUFFIX, "ref1", SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_PATH_SUFFIX, "some/path")));
    data.add(getEntryForDockerimageEnv(singletonMap("ref1", new ServerConf2Impl("8080", "https", singletonMap("path", ""))), singletonList("8080/tcp"), splitOnPairsAsMap(SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_PROTOCOL_SUFFIX, "https", SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_REF_SUFFIX, "ref1", SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_PATH_SUFFIX, "")));
    data.add(getEntryForDockerimageEnv(singletonMap("ref1", new ServerConf2Impl("8080", "https", singletonMap("path", null))), singletonList("8080/tcp"), splitOnPairsAsMap(SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_PROTOCOL_SUFFIX, "https", SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_REF_SUFFIX, "ref1")));
    data.add(getEntryForDockerimageEnv(singletonMap("ref1", new ServerConf2Impl("8080", null, emptyMap())), singletonList("8080/tcp"), splitOnPairsAsMap(SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_REF_SUFFIX, "ref1")));
    data.add(getEntryForDockerimageEnv(singletonMap("ref1", new ServerConf2Impl("8080", "https", splitOnPairsAsMap("some", "value"))), singletonList("8080/tcp"), splitOnPairsAsMap(SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_PROTOCOL_SUFFIX, "https", SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_REF_SUFFIX, "ref1")));
    data.add(getEntryForDockerimageEnv(singletonMap("ref1", new ServerConf2Impl("8080", "https", splitOnPairsAsMap("some", "value", "path", "some"))), singletonList("8080/tcp"), splitOnPairsAsMap(SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_PROTOCOL_SUFFIX, "https", SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_REF_SUFFIX, "ref1", SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_PATH_SUFFIX, "some")));
    data.add(getEntryForDockerimageEnv(serversMap("ref1", new ServerConf2Impl("8080", "https", singletonMap("path", "some/path")), "ref2", new ServerConf2Impl("9090", "http", singletonMap("path", "/some/path"))), asList("8080/tcp", "9090/tcp"), splitOnPairsAsMap(SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_PROTOCOL_SUFFIX, "https", SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_REF_SUFFIX, "ref1", SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_PATH_SUFFIX, "some/path", SERVER_CONF_LABEL_PREFIX + "9090/tcp" + SERVER_CONF_LABEL_PROTOCOL_SUFFIX, "http", SERVER_CONF_LABEL_PREFIX + "9090/tcp" + SERVER_CONF_LABEL_REF_SUFFIX, "ref2", SERVER_CONF_LABEL_PREFIX + "9090/tcp" + SERVER_CONF_LABEL_PATH_SUFFIX, "/some/path")));
    data.add(getEntryForDockerimageEnv(serversMap("ref1", new ServerConf2Impl("8080", "https", singletonMap("path", "some/path")), "ref2", new ServerConf2Impl("8080/udp", "http", singletonMap("path", "/some/path"))), asList("8080/tcp", "8080/udp"), splitOnPairsAsMap(SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_PROTOCOL_SUFFIX, "https", SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_REF_SUFFIX, "ref1", SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_PATH_SUFFIX, "some/path", SERVER_CONF_LABEL_PREFIX + "8080/udp" + SERVER_CONF_LABEL_PROTOCOL_SUFFIX, "http", SERVER_CONF_LABEL_PREFIX + "8080/udp" + SERVER_CONF_LABEL_REF_SUFFIX, "ref2", SERVER_CONF_LABEL_PREFIX + "8080/udp" + SERVER_CONF_LABEL_PATH_SUFFIX, "/some/path")));
    data.add(getEntryForComposeEnv(emptyMap(), emptyList(), emptyMap(), emptyList(), emptyMap()));
    data.add(getEntryForComposeEnv(singletonMap("ref1", new ServerConf2Impl("8080", "http", emptyMap())), emptyList(), emptyMap(), singletonList("8080/tcp"), splitOnPairsAsMap(SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_PROTOCOL_SUFFIX, "http", SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_REF_SUFFIX, "ref1")));
    data.add(getEntryForComposeEnv(singletonMap("ref1", new ServerConf2Impl("8080/tcp", "http", emptyMap())), emptyList(), emptyMap(), singletonList("8080/tcp"), splitOnPairsAsMap(SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_PROTOCOL_SUFFIX, "http", SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_REF_SUFFIX, "ref1")));
    data.add(getEntryForComposeEnv(singletonMap("ref1", new ServerConf2Impl("8080/udp", "http", emptyMap())), emptyList(), emptyMap(), singletonList("8080/udp"), splitOnPairsAsMap(SERVER_CONF_LABEL_PREFIX + "8080/udp" + SERVER_CONF_LABEL_PROTOCOL_SUFFIX, "http", SERVER_CONF_LABEL_PREFIX + "8080/udp" + SERVER_CONF_LABEL_REF_SUFFIX, "ref1")));
    data.add(getEntryForComposeEnv(singletonMap("ref1", new ServerConf2Impl("8080", "https", emptyMap())), emptyList(), emptyMap(), singletonList("8080/tcp"), splitOnPairsAsMap(SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_PROTOCOL_SUFFIX, "https", SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_REF_SUFFIX, "ref1")));
    data.add(getEntryForComposeEnv(singletonMap("ref1", new ServerConf2Impl("8080", "https", singletonMap("path", "/some/path"))), emptyList(), emptyMap(), singletonList("8080/tcp"), splitOnPairsAsMap(SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_PROTOCOL_SUFFIX, "https", SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_REF_SUFFIX, "ref1", SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_PATH_SUFFIX, "/some/path")));
    data.add(getEntryForComposeEnv(singletonMap("ref1", new ServerConf2Impl("8080", "https", singletonMap("path", "some/path"))), emptyList(), emptyMap(), singletonList("8080/tcp"), splitOnPairsAsMap(SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_PROTOCOL_SUFFIX, "https", SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_REF_SUFFIX, "ref1", SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_PATH_SUFFIX, "some/path")));
    data.add(getEntryForComposeEnv(singletonMap("ref1", new ServerConf2Impl("8080", "https", singletonMap("path", ""))), emptyList(), emptyMap(), singletonList("8080/tcp"), splitOnPairsAsMap(SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_PROTOCOL_SUFFIX, "https", SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_REF_SUFFIX, "ref1", SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_PATH_SUFFIX, "")));
    data.add(getEntryForComposeEnv(singletonMap("ref1", new ServerConf2Impl("8080", "https", singletonMap("path", null))), emptyList(), emptyMap(), singletonList("8080/tcp"), splitOnPairsAsMap(SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_PROTOCOL_SUFFIX, "https", SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_REF_SUFFIX, "ref1")));
    data.add(getEntryForComposeEnv(singletonMap("ref1", new ServerConf2Impl("8080", null, emptyMap())), emptyList(), emptyMap(), singletonList("8080/tcp"), splitOnPairsAsMap(SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_REF_SUFFIX, "ref1")));
    data.add(getEntryForComposeEnv(singletonMap("ref1", new ServerConf2Impl("8080", "https", splitOnPairsAsMap("some", "value"))), emptyList(), emptyMap(), singletonList("8080/tcp"), splitOnPairsAsMap(SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_PROTOCOL_SUFFIX, "https", SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_REF_SUFFIX, "ref1")));
    data.add(getEntryForComposeEnv(singletonMap("ref1", new ServerConf2Impl("8080", "https", splitOnPairsAsMap("some", "value", "path", "some"))), emptyList(), emptyMap(), singletonList("8080/tcp"), splitOnPairsAsMap(SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_PROTOCOL_SUFFIX, "https", SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_REF_SUFFIX, "ref1", SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_PATH_SUFFIX, "some")));
    data.add(getEntryForComposeEnv(serversMap("ref1", new ServerConf2Impl("8080", "https", singletonMap("path", "some/path")), "ref2", new ServerConf2Impl("9090", "http", singletonMap("path", "/some/path"))), emptyList(), emptyMap(), asList("8080/tcp", "9090/tcp"), splitOnPairsAsMap(SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_PROTOCOL_SUFFIX, "https", SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_REF_SUFFIX, "ref1", SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_PATH_SUFFIX, "some/path", SERVER_CONF_LABEL_PREFIX + "9090/tcp" + SERVER_CONF_LABEL_PROTOCOL_SUFFIX, "http", SERVER_CONF_LABEL_PREFIX + "9090/tcp" + SERVER_CONF_LABEL_REF_SUFFIX, "ref2", SERVER_CONF_LABEL_PREFIX + "9090/tcp" + SERVER_CONF_LABEL_PATH_SUFFIX, "/some/path")));
    data.add(getEntryForComposeEnv(serversMap("ref1", new ServerConf2Impl("8080", "https", singletonMap("path", "some/path")), "ref2", new ServerConf2Impl("8080/udp", "http", singletonMap("path", "/some/path"))), emptyList(), emptyMap(), asList("8080/tcp", "8080/udp"), splitOnPairsAsMap(SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_PROTOCOL_SUFFIX, "https", SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_REF_SUFFIX, "ref1", SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_PATH_SUFFIX, "some/path", SERVER_CONF_LABEL_PREFIX + "8080/udp" + SERVER_CONF_LABEL_PROTOCOL_SUFFIX, "http", SERVER_CONF_LABEL_PREFIX + "8080/udp" + SERVER_CONF_LABEL_REF_SUFFIX, "ref2", SERVER_CONF_LABEL_PREFIX + "8080/udp" + SERVER_CONF_LABEL_PATH_SUFFIX, "/some/path")));
    data.add(getEntryForComposeEnv(serversMap("ref1", new ServerConf2Impl("8080", "https", singletonMap("path", "some/path")), "ref2", new ServerConf2Impl("8080/udp", "http", singletonMap("path", "/some/path"))), asList("9090/tcp", "9090/udp", "7070", "7070/udp"), emptyMap(), asList("8080/tcp", "8080/udp", "9090/udp", "9090/tcp", "7070/tcp", "7070/udp"), splitOnPairsAsMap(SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_PROTOCOL_SUFFIX, "https", SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_REF_SUFFIX, "ref1", SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_PATH_SUFFIX, "some/path", SERVER_CONF_LABEL_PREFIX + "8080/udp" + SERVER_CONF_LABEL_PROTOCOL_SUFFIX, "http", SERVER_CONF_LABEL_PREFIX + "8080/udp" + SERVER_CONF_LABEL_REF_SUFFIX, "ref2", SERVER_CONF_LABEL_PREFIX + "8080/udp" + SERVER_CONF_LABEL_PATH_SUFFIX, "/some/path")));
    data.add(getEntryForComposeEnv(serversMap("ref1", new ServerConf2Impl("8080", "https", singletonMap("path", "some/path")), "ref2", new ServerConf2Impl("8080/udp", "http", singletonMap("path", "/some/path"))), emptyList(), splitOnPairsAsMap("label1", "value1", "label2", "value2"), asList("8080/tcp", "8080/udp"), splitOnPairsAsMap(SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_PROTOCOL_SUFFIX, "https", SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_REF_SUFFIX, "ref1", SERVER_CONF_LABEL_PREFIX + "8080/tcp" + SERVER_CONF_LABEL_PATH_SUFFIX, "some/path", SERVER_CONF_LABEL_PREFIX + "8080/udp" + SERVER_CONF_LABEL_PROTOCOL_SUFFIX, "http", SERVER_CONF_LABEL_PREFIX + "8080/udp" + SERVER_CONF_LABEL_REF_SUFFIX, "ref2", SERVER_CONF_LABEL_PREFIX + "8080/udp" + SERVER_CONF_LABEL_PATH_SUFFIX, "/some/path", "label1", "value1", "label2", "value2")));
    return data.stream().map(list -> list.toArray(new Object[list.size()])).toArray(value -> new Object[data.size()][]);
}
Also used : Listeners(org.testng.annotations.Listeners) EnvironmentImpl(org.eclipse.che.api.workspace.server.model.impl.EnvironmentImpl) DataProvider(org.testng.annotations.DataProvider) Mock(org.mockito.Mock) SERVER_CONF_LABEL_PATH_SUFFIX(org.eclipse.che.api.environment.server.EnvironmentParser.SERVER_CONF_LABEL_PATH_SUFFIX) Assert.assertEquals(org.testng.Assert.assertEquals) Test(org.testng.annotations.Test) HashMap(java.util.HashMap) ExtendedMachineImpl(org.eclipse.che.api.workspace.server.model.impl.ExtendedMachineImpl) ServerConf2Impl(org.eclipse.che.api.workspace.server.model.impl.ServerConf2Impl) CheServicesEnvironmentImpl(org.eclipse.che.api.environment.server.model.CheServicesEnvironmentImpl) ArrayList(java.util.ArrayList) Collections.singletonList(java.util.Collections.singletonList) Arrays.asList(java.util.Arrays.asList) Map(java.util.Map) CheServiceBuildContextImpl(org.eclipse.che.api.environment.server.model.CheServiceBuildContextImpl) Collections.singletonMap(java.util.Collections.singletonMap) Collections.emptyMap(java.util.Collections.emptyMap) SERVER_CONF_LABEL_PROTOCOL_SUFFIX(org.eclipse.che.api.environment.server.EnvironmentParser.SERVER_CONF_LABEL_PROTOCOL_SUFFIX) EnvironmentRecipeImpl(org.eclipse.che.api.workspace.server.model.impl.EnvironmentRecipeImpl) MockitoTestNGListener(org.mockito.testng.MockitoTestNGListener) ImmutableMap(com.google.common.collect.ImmutableMap) Collections.emptyList(java.util.Collections.emptyList) BeforeMethod(org.testng.annotations.BeforeMethod) Set(java.util.Set) Mockito.when(org.mockito.Mockito.when) Assert.assertNotNull(org.testng.Assert.assertNotNull) String.format(java.lang.String.format) Mockito.verify(org.mockito.Mockito.verify) Matchers.any(org.mockito.Matchers.any) List(java.util.List) SERVER_CONF_LABEL_PREFIX(org.eclipse.che.api.environment.server.EnvironmentParser.SERVER_CONF_LABEL_PREFIX) SERVER_CONF_LABEL_REF_SUFFIX(org.eclipse.che.api.environment.server.EnvironmentParser.SERVER_CONF_LABEL_REF_SUFFIX) Environment(org.eclipse.che.api.core.model.workspace.Environment) ServerException(org.eclipse.che.api.core.ServerException) CheServiceImpl(org.eclipse.che.api.environment.server.model.CheServiceImpl) Assert.assertEqualsNoOrder(org.testng.Assert.assertEqualsNoOrder) ServerConf2Impl(org.eclipse.che.api.workspace.server.model.impl.ServerConf2Impl) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) Collections.singletonList(java.util.Collections.singletonList) Arrays.asList(java.util.Arrays.asList) Collections.emptyList(java.util.Collections.emptyList) List(java.util.List) DataProvider(org.testng.annotations.DataProvider)

Aggregations

ImmutableMap (com.google.common.collect.ImmutableMap)1 String.format (java.lang.String.format)1 ArrayList (java.util.ArrayList)1 Arrays.asList (java.util.Arrays.asList)1 Collections.emptyList (java.util.Collections.emptyList)1 Collections.emptyMap (java.util.Collections.emptyMap)1 Collections.singletonList (java.util.Collections.singletonList)1 Collections.singletonMap (java.util.Collections.singletonMap)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1 Set (java.util.Set)1 ServerException (org.eclipse.che.api.core.ServerException)1 Environment (org.eclipse.che.api.core.model.workspace.Environment)1 SERVER_CONF_LABEL_PATH_SUFFIX (org.eclipse.che.api.environment.server.EnvironmentParser.SERVER_CONF_LABEL_PATH_SUFFIX)1 SERVER_CONF_LABEL_PREFIX (org.eclipse.che.api.environment.server.EnvironmentParser.SERVER_CONF_LABEL_PREFIX)1 SERVER_CONF_LABEL_PROTOCOL_SUFFIX (org.eclipse.che.api.environment.server.EnvironmentParser.SERVER_CONF_LABEL_PROTOCOL_SUFFIX)1 SERVER_CONF_LABEL_REF_SUFFIX (org.eclipse.che.api.environment.server.EnvironmentParser.SERVER_CONF_LABEL_REF_SUFFIX)1 CheServiceBuildContextImpl (org.eclipse.che.api.environment.server.model.CheServiceBuildContextImpl)1 CheServiceImpl (org.eclipse.che.api.environment.server.model.CheServiceImpl)1