[ONOS-7683] Add missing toString methods for telemetry configs
Change-Id: Iff17acf7b5698669ae8f753bce5a402bad06fd5c
diff --git a/apps/openstacktelemetry/app/src/main/java/org/onosproject/openstacktelemetry/config/DefaultGrpcTelemetryConfig.java b/apps/openstacktelemetry/app/src/main/java/org/onosproject/openstacktelemetry/config/DefaultGrpcTelemetryConfig.java
index 6cee737..5ece99b 100644
--- a/apps/openstacktelemetry/app/src/main/java/org/onosproject/openstacktelemetry/config/DefaultGrpcTelemetryConfig.java
+++ b/apps/openstacktelemetry/app/src/main/java/org/onosproject/openstacktelemetry/config/DefaultGrpcTelemetryConfig.java
@@ -23,6 +23,7 @@
import java.util.Map;
import java.util.Objects;
+import static com.google.common.base.MoreObjects.toStringHelper;
import static com.google.common.base.Preconditions.checkNotNull;
/**
@@ -98,6 +99,17 @@
}
@Override
+ public String toString() {
+ return toStringHelper(this)
+ .add("address", address)
+ .add("port", port)
+ .add("usePlaintext", usePlaintext)
+ .add("maxInboundMsgSize", maxInboundMsgSize)
+ .add("configMap", configMap)
+ .toString();
+ }
+
+ @Override
public TelemetryConfig.Builder createBuilder() {
return new DefaultBuilder();
}
diff --git a/apps/openstacktelemetry/app/src/main/java/org/onosproject/openstacktelemetry/config/DefaultInfluxDbTelemetryConfig.java b/apps/openstacktelemetry/app/src/main/java/org/onosproject/openstacktelemetry/config/DefaultInfluxDbTelemetryConfig.java
index 68b28c1..461fee5 100644
--- a/apps/openstacktelemetry/app/src/main/java/org/onosproject/openstacktelemetry/config/DefaultInfluxDbTelemetryConfig.java
+++ b/apps/openstacktelemetry/app/src/main/java/org/onosproject/openstacktelemetry/config/DefaultInfluxDbTelemetryConfig.java
@@ -23,6 +23,7 @@
import java.util.Map;
import java.util.Objects;
+import static com.google.common.base.MoreObjects.toStringHelper;
import static com.google.common.base.Preconditions.checkNotNull;
/**
@@ -115,6 +116,19 @@
}
@Override
+ public String toString() {
+ return toStringHelper(this)
+ .add("address", address)
+ .add("port", port)
+ .add("username", username)
+ .add("password", password)
+ .add("database", database)
+ .add("enableBatch", enableBatch)
+ .add("configMap", configMap)
+ .toString();
+ }
+
+ @Override
public TelemetryConfig.Builder createBuilder() {
return new DefaultBuilder();
}
diff --git a/apps/openstacktelemetry/app/src/main/java/org/onosproject/openstacktelemetry/config/DefaultKafkaTelemetryConfig.java b/apps/openstacktelemetry/app/src/main/java/org/onosproject/openstacktelemetry/config/DefaultKafkaTelemetryConfig.java
index efde9f5..6fc90fd 100644
--- a/apps/openstacktelemetry/app/src/main/java/org/onosproject/openstacktelemetry/config/DefaultKafkaTelemetryConfig.java
+++ b/apps/openstacktelemetry/app/src/main/java/org/onosproject/openstacktelemetry/config/DefaultKafkaTelemetryConfig.java
@@ -23,6 +23,7 @@
import java.util.Map;
import java.util.Objects;
+import static com.google.common.base.MoreObjects.toStringHelper;
import static com.google.common.base.Preconditions.checkNotNull;
/**
@@ -142,6 +143,22 @@
}
@Override
+ public String toString() {
+ return toStringHelper(this)
+ .add("address", address)
+ .add("port", port)
+ .add("retries", retries)
+ .add("requiredAcks", requiredAcks)
+ .add("batchSize", batchSize)
+ .add("lingerMs", lingerMs)
+ .add("memoryBuffer", memoryBuffer)
+ .add("keySerializer", keySerializer)
+ .add("valueSerializer", valueSerializer)
+ .add("configMap", configMap)
+ .toString();
+ }
+
+ @Override
public TelemetryConfig.Builder createBuilder() {
return new DefaultBuilder();
}
diff --git a/apps/openstacktelemetry/app/src/main/java/org/onosproject/openstacktelemetry/config/DefaultRestTelemetryConfig.java b/apps/openstacktelemetry/app/src/main/java/org/onosproject/openstacktelemetry/config/DefaultRestTelemetryConfig.java
index 29e9a2a..df9d6ce 100644
--- a/apps/openstacktelemetry/app/src/main/java/org/onosproject/openstacktelemetry/config/DefaultRestTelemetryConfig.java
+++ b/apps/openstacktelemetry/app/src/main/java/org/onosproject/openstacktelemetry/config/DefaultRestTelemetryConfig.java
@@ -23,6 +23,7 @@
import java.util.Map;
import java.util.Objects;
+import static com.google.common.base.MoreObjects.toStringHelper;
import static com.google.common.base.Preconditions.checkNotNull;
/**
@@ -116,6 +117,19 @@
}
@Override
+ public String toString() {
+ return toStringHelper(this)
+ .add("address", address)
+ .add("port", port)
+ .add("endpoint", endpoint)
+ .add("method", method)
+ .add("requestMediaType", requestMediaType)
+ .add("responseMediaType", responseMediaType)
+ .add("configMap", configMap)
+ .toString();
+ }
+
+ @Override
public TelemetryConfig.Builder createBuilder() {
return new DefaultBuilder();
}
diff --git a/apps/openstacktelemetry/app/src/test/java/org/onosproject/openstacktelemetry/codec/TestTinaFlowInfoByteBufferCodec.java b/apps/openstacktelemetry/app/src/test/java/org/onosproject/openstacktelemetry/codec/TinaFlowInfoByteBufferCodecTest.java
similarity index 98%
rename from apps/openstacktelemetry/app/src/test/java/org/onosproject/openstacktelemetry/codec/TestTinaFlowInfoByteBufferCodec.java
rename to apps/openstacktelemetry/app/src/test/java/org/onosproject/openstacktelemetry/codec/TinaFlowInfoByteBufferCodecTest.java
index 110bfc2..f8bc900 100644
--- a/apps/openstacktelemetry/app/src/test/java/org/onosproject/openstacktelemetry/codec/TestTinaFlowInfoByteBufferCodec.java
+++ b/apps/openstacktelemetry/app/src/test/java/org/onosproject/openstacktelemetry/codec/TinaFlowInfoByteBufferCodecTest.java
@@ -34,7 +34,7 @@
/**
* Unit tests for TinaFlowInfoByteBufferCodec.
*/
-public final class TestTinaFlowInfoByteBufferCodec {
+public final class TinaFlowInfoByteBufferCodecTest {
private static final byte FLOW_TYPE = 1;
private static final DeviceId DEVICE_ID = DeviceId.deviceId("1234");
diff --git a/apps/openstacktelemetry/app/src/test/java/org/onosproject/openstacktelemetry/codec/TestTinaStatsInfoByteBufferCodec.java b/apps/openstacktelemetry/app/src/test/java/org/onosproject/openstacktelemetry/codec/TinaStatsInfoByteBufferCodecTest.java
similarity index 97%
rename from apps/openstacktelemetry/app/src/test/java/org/onosproject/openstacktelemetry/codec/TestTinaStatsInfoByteBufferCodec.java
rename to apps/openstacktelemetry/app/src/test/java/org/onosproject/openstacktelemetry/codec/TinaStatsInfoByteBufferCodecTest.java
index 04a527b..f23f728 100644
--- a/apps/openstacktelemetry/app/src/test/java/org/onosproject/openstacktelemetry/codec/TestTinaStatsInfoByteBufferCodec.java
+++ b/apps/openstacktelemetry/app/src/test/java/org/onosproject/openstacktelemetry/codec/TinaStatsInfoByteBufferCodecTest.java
@@ -26,7 +26,7 @@
/**
* Unit tests for TinaStatsInfoByteBufferCodef.
*/
-public class TestTinaStatsInfoByteBufferCodec {
+public class TinaStatsInfoByteBufferCodecTest {
private static final int STARTUP_TIME = 1000;
private static final int CURRENT_ACCUMULATED_PACKETS = 8000;
diff --git a/apps/openstacktelemetry/app/src/test/java/org/onosproject/openstacktelemetry/config/TestDefaultGrpcTelemetryConfig.java b/apps/openstacktelemetry/app/src/test/java/org/onosproject/openstacktelemetry/config/DefaultGrpcTelemetryConfigTest.java
similarity index 98%
rename from apps/openstacktelemetry/app/src/test/java/org/onosproject/openstacktelemetry/config/TestDefaultGrpcTelemetryConfig.java
rename to apps/openstacktelemetry/app/src/test/java/org/onosproject/openstacktelemetry/config/DefaultGrpcTelemetryConfigTest.java
index ba66f36..6dcf229 100644
--- a/apps/openstacktelemetry/app/src/test/java/org/onosproject/openstacktelemetry/config/TestDefaultGrpcTelemetryConfig.java
+++ b/apps/openstacktelemetry/app/src/test/java/org/onosproject/openstacktelemetry/config/DefaultGrpcTelemetryConfigTest.java
@@ -29,7 +29,7 @@
/**
* Unit tests for DefaultGrpcTelemetryConfig class.
*/
-public final class TestDefaultGrpcTelemetryConfig {
+public final class DefaultGrpcTelemetryConfigTest {
private static final String IP_ADDRESS_1 = "10.10.10.1";
private static final String IP_ADDRESS_2 = "20.20.20.1";
diff --git a/apps/openstacktelemetry/app/src/test/java/org/onosproject/openstacktelemetry/config/TestDefaultInfluxDbTelemetryConfig.java b/apps/openstacktelemetry/app/src/test/java/org/onosproject/openstacktelemetry/config/DefaultInfluxDbTelemetryConfigTest.java
similarity index 98%
rename from apps/openstacktelemetry/app/src/test/java/org/onosproject/openstacktelemetry/config/TestDefaultInfluxDbTelemetryConfig.java
rename to apps/openstacktelemetry/app/src/test/java/org/onosproject/openstacktelemetry/config/DefaultInfluxDbTelemetryConfigTest.java
index 62c1a13..3c95f6d 100644
--- a/apps/openstacktelemetry/app/src/test/java/org/onosproject/openstacktelemetry/config/TestDefaultInfluxDbTelemetryConfig.java
+++ b/apps/openstacktelemetry/app/src/test/java/org/onosproject/openstacktelemetry/config/DefaultInfluxDbTelemetryConfigTest.java
@@ -29,7 +29,7 @@
/**
* Unit tests for DefaultInfluxDbTelemetryConfig class.
*/
-public final class TestDefaultInfluxDbTelemetryConfig {
+public final class DefaultInfluxDbTelemetryConfigTest {
private static final String IP_ADDRESS_1 = "10.10.10.1";
private static final String IP_ADDRESS_2 = "20.20.20.1";
diff --git a/apps/openstacktelemetry/app/src/test/java/org/onosproject/openstacktelemetry/config/TestDefaultKafkaTelemetryConfig.java b/apps/openstacktelemetry/app/src/test/java/org/onosproject/openstacktelemetry/config/DefaultKafkaTelemetryConfigTest.java
similarity index 98%
rename from apps/openstacktelemetry/app/src/test/java/org/onosproject/openstacktelemetry/config/TestDefaultKafkaTelemetryConfig.java
rename to apps/openstacktelemetry/app/src/test/java/org/onosproject/openstacktelemetry/config/DefaultKafkaTelemetryConfigTest.java
index 6faa0ab..6608d7a 100644
--- a/apps/openstacktelemetry/app/src/test/java/org/onosproject/openstacktelemetry/config/TestDefaultKafkaTelemetryConfig.java
+++ b/apps/openstacktelemetry/app/src/test/java/org/onosproject/openstacktelemetry/config/DefaultKafkaTelemetryConfigTest.java
@@ -26,7 +26,7 @@
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
-public final class TestDefaultKafkaTelemetryConfig {
+public final class DefaultKafkaTelemetryConfigTest {
private static final String IP_ADDRESS_1 = "10.10.10.1";
private static final String IP_ADDRESS_2 = "20.20.20.1";
diff --git a/apps/openstacktelemetry/app/src/test/java/org/onosproject/openstacktelemetry/config/TestDefaultRestTelemetryConfig.java b/apps/openstacktelemetry/app/src/test/java/org/onosproject/openstacktelemetry/config/DefaultRestTelemetryConfigTest.java
similarity index 98%
rename from apps/openstacktelemetry/app/src/test/java/org/onosproject/openstacktelemetry/config/TestDefaultRestTelemetryConfig.java
rename to apps/openstacktelemetry/app/src/test/java/org/onosproject/openstacktelemetry/config/DefaultRestTelemetryConfigTest.java
index b4b18f6..2a6277b 100644
--- a/apps/openstacktelemetry/app/src/test/java/org/onosproject/openstacktelemetry/config/TestDefaultRestTelemetryConfig.java
+++ b/apps/openstacktelemetry/app/src/test/java/org/onosproject/openstacktelemetry/config/DefaultRestTelemetryConfigTest.java
@@ -26,7 +26,7 @@
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
-public final class TestDefaultRestTelemetryConfig {
+public final class DefaultRestTelemetryConfigTest {
private static final String IP_ADDRESS_1 = "10.10.10.1";
private static final String IP_ADDRESS_2 = "20.20.20.1";
diff --git a/apps/openstacktelemetry/app/src/test/java/org/onosproject/openstacktelemetry/impl/TestDefaultFlowInfo.java b/apps/openstacktelemetry/app/src/test/java/org/onosproject/openstacktelemetry/impl/DefaultFlowInfoTest.java
similarity index 98%
rename from apps/openstacktelemetry/app/src/test/java/org/onosproject/openstacktelemetry/impl/TestDefaultFlowInfo.java
rename to apps/openstacktelemetry/app/src/test/java/org/onosproject/openstacktelemetry/impl/DefaultFlowInfoTest.java
index fcbbdc5..53d18c3 100644
--- a/apps/openstacktelemetry/app/src/test/java/org/onosproject/openstacktelemetry/impl/TestDefaultFlowInfo.java
+++ b/apps/openstacktelemetry/app/src/test/java/org/onosproject/openstacktelemetry/impl/DefaultFlowInfoTest.java
@@ -33,7 +33,7 @@
/**
* Unit tests for DefaultFlowInfo class.
*/
-public final class TestDefaultFlowInfo {
+public final class DefaultFlowInfoTest {
private static final String IP_ADDRESS_1 = "10.10.10.1";
private static final String IP_ADDRESS_2 = "20.20.20.1";
diff --git a/apps/openstacktelemetry/app/src/test/java/org/onosproject/openstacktelemetry/impl/TestDefaultStatsInfo.java b/apps/openstacktelemetry/app/src/test/java/org/onosproject/openstacktelemetry/impl/DefaultStatsInfoTest.java
similarity index 98%
rename from apps/openstacktelemetry/app/src/test/java/org/onosproject/openstacktelemetry/impl/TestDefaultStatsInfo.java
rename to apps/openstacktelemetry/app/src/test/java/org/onosproject/openstacktelemetry/impl/DefaultStatsInfoTest.java
index f13b9b7..d1e0b7e 100644
--- a/apps/openstacktelemetry/app/src/test/java/org/onosproject/openstacktelemetry/impl/TestDefaultStatsInfo.java
+++ b/apps/openstacktelemetry/app/src/test/java/org/onosproject/openstacktelemetry/impl/DefaultStatsInfoTest.java
@@ -26,7 +26,7 @@
/**
* Unit tests for DefaultStatsInfo class.
*/
-public final class TestDefaultStatsInfo {
+public final class DefaultStatsInfoTest {
private static final int STATIC_INTEGER_1 = 1;
private static final int STATIC_INTEGER_2 = 2;