diff options
Diffstat (limited to 'config-model-api')
3 files changed, 57 insertions, 0 deletions
diff --git a/config-model-api/src/main/java/com/yahoo/config/model/api/container/ContainerServiceType.java b/config-model-api/src/main/java/com/yahoo/config/model/api/container/ContainerServiceType.java new file mode 100644 index 00000000000..0b521881838 --- /dev/null +++ b/config-model-api/src/main/java/com/yahoo/config/model/api/container/ContainerServiceType.java @@ -0,0 +1,21 @@ +// Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.config.model.api.container; + +/** + * @author gjoranv + */ +public enum ContainerServiceType { + + CONTAINER("container"), + QRSERVER("qrserver"), + CLUSTERCONTROLLER_CONTAINER("container-clustercontroller"), + LOGSERVER_CONTAINER("logserver-container"), + METRICS_PROXY_CONTAINER("metrics-proxy-container"); + + public final String serviceName; + + ContainerServiceType(String serviceName) { + this.serviceName = serviceName; + } + +} diff --git a/config-model-api/src/main/java/com/yahoo/config/model/api/container/package-info.java b/config-model-api/src/main/java/com/yahoo/config/model/api/container/package-info.java new file mode 100644 index 00000000000..c32fdc393d0 --- /dev/null +++ b/config-model-api/src/main/java/com/yahoo/config/model/api/container/package-info.java @@ -0,0 +1,5 @@ +// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +@ExportPackage +package com.yahoo.config.model.api.container; + +import com.yahoo.osgi.annotation.ExportPackage; diff --git a/config-model-api/src/test/java/com/yahoo/config/model/api/container/ContainerServiceTypeTest.java b/config-model-api/src/test/java/com/yahoo/config/model/api/container/ContainerServiceTypeTest.java new file mode 100644 index 00000000000..f6cc1c8d7b3 --- /dev/null +++ b/config-model-api/src/test/java/com/yahoo/config/model/api/container/ContainerServiceTypeTest.java @@ -0,0 +1,31 @@ +package com.yahoo.config.model.api.container; + +import org.junit.Test; + +import static com.yahoo.config.model.api.container.ContainerServiceType.CLUSTERCONTROLLER_CONTAINER; +import static com.yahoo.config.model.api.container.ContainerServiceType.CONTAINER; +import static com.yahoo.config.model.api.container.ContainerServiceType.LOGSERVER_CONTAINER; +import static com.yahoo.config.model.api.container.ContainerServiceType.METRICS_PROXY_CONTAINER; +import static com.yahoo.config.model.api.container.ContainerServiceType.QRSERVER; +import static org.junit.Assert.assertEquals; + +/** + * @author gjoranv + */ +public class ContainerServiceTypeTest { + + @Test + public void new_values_are_not_added_without_updating_tests() { + assertEquals(5, ContainerServiceType.values().length); + } + + @Test + public void service_names_do_not_change() { + assertEquals("container", CONTAINER.serviceName); + assertEquals("qrserver", QRSERVER.serviceName); + assertEquals("container-clustercontroller", CLUSTERCONTROLLER_CONTAINER.serviceName); + assertEquals("logserver-container", LOGSERVER_CONTAINER.serviceName); + assertEquals("metrics-proxy-container", METRICS_PROXY_CONTAINER.serviceName); + } + +} |