summaryrefslogtreecommitdiffstats
path: root/config-model/src/main/java/com/yahoo/config/model/deploy/TestProperties.java
diff options
context:
space:
mode:
authorArne Juul <arnej@yahoo-inc.com>2019-02-22 13:57:24 +0000
committerArne Juul <arnej@yahoo-inc.com>2019-02-22 13:57:24 +0000
commitd384da4f3f6de0d1ef3deb70f1d66a6f84cdaf9e (patch)
tree3db7ecad73136fb6cb302bdd9fe551b7ee6319f4 /config-model/src/main/java/com/yahoo/config/model/deploy/TestProperties.java
parent8bd7b6534fab28d507629fca1c109fff65585c40 (diff)
remove unused code and simplify
Diffstat (limited to 'config-model/src/main/java/com/yahoo/config/model/deploy/TestProperties.java')
-rw-r--r--config-model/src/main/java/com/yahoo/config/model/deploy/TestProperties.java53
1 files changed, 52 insertions, 1 deletions
diff --git a/config-model/src/main/java/com/yahoo/config/model/deploy/TestProperties.java b/config-model/src/main/java/com/yahoo/config/model/deploy/TestProperties.java
index f93688abddc..378c262cd72 100644
--- a/config-model/src/main/java/com/yahoo/config/model/deploy/TestProperties.java
+++ b/config-model/src/main/java/com/yahoo/config/model/deploy/TestProperties.java
@@ -73,7 +73,7 @@ public class TestProperties implements ModelContext.Properties {
return this;
}
- public TestProperties setConfigServerSpecs(List<Configserver.Spec> configServerSpecs) {
+ public TestProperties setConfigServerSpecs(List<Spec> configServerSpecs) {
this.configServerSpecs = ImmutableList.copyOf(configServerSpecs);
return this;
}
@@ -82,4 +82,55 @@ public class TestProperties implements ModelContext.Properties {
this.useDedicatedNodeForLogserver = useDedicatedNodeForLogserver;
return this;
}
+
+ public static class Spec implements ConfigServerSpec {
+
+ private final String hostName;
+ private final int configServerPort;
+ private final int httpPort;
+ private final int zooKeeperPort;
+
+ public String getHostName() {
+ return hostName;
+ }
+
+ public int getConfigServerPort() {
+ return configServerPort;
+ }
+
+ public int getHttpPort() {
+ return httpPort;
+ }
+
+ public int getZooKeeperPort() {
+ return zooKeeperPort;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o instanceof ConfigServerSpec) {
+ ConfigServerSpec other = (ConfigServerSpec)o;
+
+ return hostName.equals(other.getHostName()) &&
+ configServerPort == other.getConfigServerPort() &&
+ httpPort == other.getHttpPort() &&
+ zooKeeperPort == other.getZooKeeperPort();
+ } else {
+ return false;
+ }
+ }
+
+ @Override
+ public int hashCode() {
+ return hostName.hashCode();
+ }
+
+ public Spec(String hostName, int configServerPort, int httpPort, int zooKeeperPort) {
+ this.hostName = hostName;
+ this.configServerPort = configServerPort;
+ this.httpPort = httpPort;
+ this.zooKeeperPort = zooKeeperPort;
+ }
+ }
+
}