summaryrefslogtreecommitdiffstats
path: root/config-model/src/test
diff options
context:
space:
mode:
authorJon Marius Venstad <venstad@gmail.com>2022-03-31 11:52:40 +0200
committerJon Marius Venstad <venstad@gmail.com>2022-03-31 11:53:33 +0200
commit2430b74a942659d549771cb4dd8b81d77692d905 (patch)
treec79b8b48bf150bea00ab9e0c6ad594740709d4fa /config-model/src/test
parent168f767ec12253f43ace27946dc530fde9e37d5e (diff)
Rename back to HostName, and merge the value class and utilities
Diffstat (limited to 'config-model/src/test')
-rw-r--r--config-model/src/test/java/com/yahoo/config/model/deploy/SystemModelTestCase.java4
-rw-r--r--config-model/src/test/java/com/yahoo/vespa/model/admin/AdminTestCase.java10
-rw-r--r--config-model/src/test/java/com/yahoo/vespa/model/container/HostProvisionerWithCustomRealResource.java4
-rw-r--r--config-model/src/test/java/com/yahoo/vespa/model/container/configserver/ConfigserverClusterTest.java4
-rw-r--r--config-model/src/test/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilderTest.java4
-rw-r--r--config-model/src/test/java/com/yahoo/vespa/model/test/VespaModelTestCase.java12
6 files changed, 19 insertions, 19 deletions
diff --git a/config-model/src/test/java/com/yahoo/config/model/deploy/SystemModelTestCase.java b/config-model/src/test/java/com/yahoo/config/model/deploy/SystemModelTestCase.java
index 9fea2cee88c..66cbfbd537f 100644
--- a/config-model/src/test/java/com/yahoo/config/model/deploy/SystemModelTestCase.java
+++ b/config-model/src/test/java/com/yahoo/config/model/deploy/SystemModelTestCase.java
@@ -7,7 +7,7 @@ import com.yahoo.config.model.ConfigModel;
import com.yahoo.config.model.ConfigModelRegistry;
import com.yahoo.config.model.MapConfigModelRegistry;
import com.yahoo.config.model.ApplicationConfigProducerRoot;
-import com.yahoo.net.Hostnames;
+import com.yahoo.net.HostName;
import com.yahoo.vespa.model.ConfigProducer;
import com.yahoo.vespa.model.HostResource;
import com.yahoo.vespa.model.HostSystem;
@@ -83,7 +83,7 @@ public class SystemModelTestCase {
// Verify configIds from vespaModel
assertTrue(12 <= vespaModel.getConfigIds().size());
- String localhost = Hostnames.getLocalhost();
+ String localhost = HostName.getLocalhost();
String localhostConfigId = "hosts/" + localhost;
Set<String> configIds = vespaModel.getConfigIds();
assertTrue(configIds.contains("client"));
diff --git a/config-model/src/test/java/com/yahoo/vespa/model/admin/AdminTestCase.java b/config-model/src/test/java/com/yahoo/vespa/model/admin/AdminTestCase.java
index e2c316a57c5..96f6c7999cc 100644
--- a/config-model/src/test/java/com/yahoo/vespa/model/admin/AdminTestCase.java
+++ b/config-model/src/test/java/com/yahoo/vespa/model/admin/AdminTestCase.java
@@ -16,7 +16,7 @@ import com.yahoo.config.provision.RegionName;
import com.yahoo.config.provision.Zone;
import com.yahoo.container.StatisticsConfig;
import com.yahoo.container.jdisc.config.HealthMonitorConfig;
-import com.yahoo.net.Hostnames;
+import com.yahoo.net.HostName;
import com.yahoo.vespa.config.core.StateserverConfig;
import com.yahoo.vespa.model.Service;
import com.yahoo.vespa.model.VespaModel;
@@ -60,7 +60,7 @@ public class AdminTestCase {
// Verify configIds
Set<String> configIds = vespaModel.getConfigIds();
- String localhost = Hostnames.getLocalhost();
+ String localhost = HostName.getLocalhost();
String localhostConfigId = "hosts/" + localhost;
assertTrue(configIds.contains(localhostConfigId));
assertTrue(configIds.contains("admin/logserver"));
@@ -124,7 +124,7 @@ public class AdminTestCase {
// Verify configIds
Set<String> configIds = vespaModel.getConfigIds();
- String localhost = Hostnames.getLocalhost();
+ String localhost = HostName.getLocalhost();
String localhostConfigId = "hosts/" + localhost;
assertTrue(configIds.contains(localhostConfigId));
assertTrue(configIds.contains("admin/logserver"));
@@ -164,7 +164,7 @@ public class AdminTestCase {
.build()))
.build();
TestRoot root = new TestDriver().buildModel(state);
- String localhost = Hostnames.getLocalhost();
+ String localhost = HostName.getLocalhost();
SentinelConfig config = root.getConfig(SentinelConfig.class, "hosts/" + localhost);
assertEquals("quux", config.application().tenant());
assertEquals("foo", config.application().name());
@@ -187,7 +187,7 @@ public class AdminTestCase {
// Verify configIds
Set<String> configIds = vespaModel.getConfigIds();
- String localhost = Hostnames.getLocalhost();
+ String localhost = HostName.getLocalhost();
String localhostConfigId = "hosts/" + localhost;
assertTrue(configIds.contains(localhostConfigId));
assertTrue(configIds.contains("admin/logserver"));
diff --git a/config-model/src/test/java/com/yahoo/vespa/model/container/HostProvisionerWithCustomRealResource.java b/config-model/src/test/java/com/yahoo/vespa/model/container/HostProvisionerWithCustomRealResource.java
index e87388a0413..e8f30d59aa9 100644
--- a/config-model/src/test/java/com/yahoo/vespa/model/container/HostProvisionerWithCustomRealResource.java
+++ b/config-model/src/test/java/com/yahoo/vespa/model/container/HostProvisionerWithCustomRealResource.java
@@ -9,7 +9,7 @@ import com.yahoo.config.provision.ClusterSpec;
import com.yahoo.config.provision.HostSpec;
import com.yahoo.config.provision.NodeResources;
import com.yahoo.config.provision.ProvisionLogger;
-import com.yahoo.net.Hostnames;
+import com.yahoo.net.HostName;
import java.util.List;
import java.util.Optional;
@@ -26,7 +26,7 @@ public class HostProvisionerWithCustomRealResource implements HostProvisioner {
@Override
public HostSpec allocateHost(String alias) {
- Host host = new Host(Hostnames.getLocalhost());
+ Host host = new Host(HostName.getLocalhost());
ClusterMembership membership = ClusterMembership.from(
ClusterSpec
.specification(
diff --git a/config-model/src/test/java/com/yahoo/vespa/model/container/configserver/ConfigserverClusterTest.java b/config-model/src/test/java/com/yahoo/vespa/model/container/configserver/ConfigserverClusterTest.java
index ecfade44f76..29cff23d3bd 100644
--- a/config-model/src/test/java/com/yahoo/vespa/model/container/configserver/ConfigserverClusterTest.java
+++ b/config-model/src/test/java/com/yahoo/vespa/model/container/configserver/ConfigserverClusterTest.java
@@ -11,7 +11,7 @@ import com.yahoo.config.model.test.MockRoot;
import com.yahoo.container.StatisticsConfig;
import com.yahoo.container.di.config.PlatformBundlesConfig;
import com.yahoo.container.jdisc.config.HealthMonitorConfig;
-import com.yahoo.net.Hostnames;
+import com.yahoo.net.HostName;
import com.yahoo.text.XML;
import com.yahoo.vespa.defaults.Defaults;
import com.yahoo.vespa.model.HostResource;
@@ -108,7 +108,7 @@ public class ConfigserverClusterTest {
assertEquals(Defaults.getDefaults().underVespaHome("lib/jars/config-models"), config.configModelPluginDir().get(0));
assertEquals(12345, config.rpcport());
assertEquals(1337, config.httpport());
- assertEquals(Hostnames.getLocalhost(), config.serverId());
+ assertEquals(HostName.getLocalhost(), config.serverId());
assertTrue(config.useVespaVersionInRequest());
assertEquals(4, config.numParallelTenantLoaders());
assertFalse(config.multitenant());
diff --git a/config-model/src/test/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilderTest.java b/config-model/src/test/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilderTest.java
index 04f1b418219..16b4a8bed9b 100644
--- a/config-model/src/test/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilderTest.java
+++ b/config-model/src/test/java/com/yahoo/vespa/model/container/xml/ContainerModelBuilderTest.java
@@ -36,7 +36,7 @@ import com.yahoo.container.jdisc.JdiscBindingsConfig;
import com.yahoo.container.jdisc.secretstore.SecretStoreConfig;
import com.yahoo.container.usability.BindingsOverviewHandler;
import com.yahoo.jdisc.http.ConnectorConfig;
-import com.yahoo.net.Hostnames;
+import com.yahoo.net.HostName;
import com.yahoo.path.Path;
import com.yahoo.prelude.cluster.QrMonitorConfig;
import com.yahoo.search.config.QrStartConfig;
@@ -645,7 +645,7 @@ public class ContainerModelBuilderTest extends ContainerModelBuilderTestBase {
@Test
public void qrconfig_is_produced() throws IOException, SAXException {
QrConfig qr = getQrConfig(new TestProperties());
- String hostname = Hostnames.getLocalhost(); // Using the same way of getting hostname as filedistribution model
+ String hostname = HostName.getLocalhost(); // Using the same way of getting hostname as filedistribution model
assertEquals("default.container.0", qr.discriminator());
assertEquals(19102, qr.rpc().port());
assertEquals("vespa/service/default/container.0", qr.rpc().slobrokId());
diff --git a/config-model/src/test/java/com/yahoo/vespa/model/test/VespaModelTestCase.java b/config-model/src/test/java/com/yahoo/vespa/model/test/VespaModelTestCase.java
index b8fbe960dc9..7f8bca825d2 100644
--- a/config-model/src/test/java/com/yahoo/vespa/model/test/VespaModelTestCase.java
+++ b/config-model/src/test/java/com/yahoo/vespa/model/test/VespaModelTestCase.java
@@ -22,7 +22,7 @@ import com.yahoo.config.provision.AllocatedHosts;
import com.yahoo.config.provision.ApplicationId;
import com.yahoo.document.config.DocumentmanagerConfig;
import com.yahoo.messagebus.MessagebusConfig;
-import com.yahoo.net.Hostnames;
+import com.yahoo.net.HostName;
import com.yahoo.vespa.config.UnknownConfigIdException;
import com.yahoo.vespa.model.ConfigProducer;
import com.yahoo.vespa.model.VespaModel;
@@ -87,7 +87,7 @@ public class VespaModelTestCase {
LogdConfig.Builder b = new LogdConfig.Builder();
b = (LogdConfig.Builder) model.getConfig(b, "");
LogdConfig c = new LogdConfig(b);
- assertEquals(Hostnames.getLocalhost(), c.logserver().host());
+ assertEquals(HostName.getLocalhost(), c.logserver().host());
SlobroksConfig.Builder sb = new SlobroksConfig.Builder();
sb = (com.yahoo.cloud.config.SlobroksConfig.Builder) model.getConfig(sb, "");
@@ -98,7 +98,7 @@ public class VespaModelTestCase {
zb = (ZookeepersConfig.Builder) model.getConfig(zb, "");
ZookeepersConfig zc = new ZookeepersConfig(zb);
assertEquals(zc.zookeeperserverlist().split(",").length, 2);
- assertTrue(zc.zookeeperserverlist().startsWith(Hostnames.getLocalhost()));
+ assertTrue(zc.zookeeperserverlist().startsWith(HostName.getLocalhost()));
ApplicationIdConfig.Builder appIdBuilder = new ApplicationIdConfig.Builder();
appIdBuilder = (ApplicationIdConfig.Builder) model.getConfig(appIdBuilder, "");
@@ -112,11 +112,11 @@ public class VespaModelTestCase {
public void testHostsConfig() {
VespaModel model = getVespaModel(TESTDIR + "app_qrserverandgw");
LogdConfig config = getLogdConfig(model, "");
- assertEquals(config.logserver().host(), Hostnames.getLocalhost());
+ assertEquals(config.logserver().host(), HostName.getLocalhost());
assertNotNull(config);
config = getLogdConfig(model, "hosts");
assertNotNull(config);
- assertEquals(config.logserver().host(), Hostnames.getLocalhost());
+ assertEquals(config.logserver().host(), HostName.getLocalhost());
}
private static LogdConfig getLogdConfig(VespaModel model, String configId) {
@@ -143,7 +143,7 @@ public class VespaModelTestCase {
LogdConfig config = getLogdConfig(model, "");
assertNotNull(config);
assertEquals(config.logserver().host(), "foo");
- config = getLogdConfig(model, "hosts/" + Hostnames.getLocalhost() + "/logd");
+ config = getLogdConfig(model, "hosts/" + HostName.getLocalhost() + "/logd");
assertNotNull(config);
assertEquals(config.logserver().host(), "foo");
}