aboutsummaryrefslogtreecommitdiffstats
path: root/hv-collector-ct/src
diff options
context:
space:
mode:
authorPiotr Jaszczyk <piotr.jaszczyk@nokia.com>2018-10-01 07:54:26 +0200
committerPiotr Jaszczyk <piotr.jaszczyk@nokia.com>2018-10-01 08:16:05 +0200
commitfd44b433ac9825be6cc654e8a566f9d0bfc70166 (patch)
treef720c9d891bc43ee1abbb4662a72d1b942f31d47 /hv-collector-ct/src
parent069dcc194fd049e1c52e60d03ce2a9c0553289a7 (diff)
HV-VES Domain update
Change domain name. In this project this yields following changes: * Comment change in VesEvent proto * Updated measurements proto (kept as documentation only, ie. not used in the collector) * Update name in test scenarios for unit and component scope Change-Id: I719077b5fcb642c067d25b7aa174a2e629404689 Issue-ID: DCAEGEN2-847 Signed-off-by: Piotr Jaszczyk <piotr.jaszczyk@nokia.com>
Diffstat (limited to 'hv-collector-ct/src')
-rw-r--r--hv-collector-ct/src/test/kotlin/org/onap/dcae/collectors/veshv/tests/component/PerformanceSpecification.kt6
-rw-r--r--hv-collector-ct/src/test/kotlin/org/onap/dcae/collectors/veshv/tests/component/VesHvSpecification.kt64
-rw-r--r--hv-collector-ct/src/test/kotlin/org/onap/dcae/collectors/veshv/tests/fakes/configuration.kt22
3 files changed, 46 insertions, 46 deletions
diff --git a/hv-collector-ct/src/test/kotlin/org/onap/dcae/collectors/veshv/tests/component/PerformanceSpecification.kt b/hv-collector-ct/src/test/kotlin/org/onap/dcae/collectors/veshv/tests/component/PerformanceSpecification.kt
index 8e6103c9..67291abd 100644
--- a/hv-collector-ct/src/test/kotlin/org/onap/dcae/collectors/veshv/tests/component/PerformanceSpecification.kt
+++ b/hv-collector-ct/src/test/kotlin/org/onap/dcae/collectors/veshv/tests/component/PerformanceSpecification.kt
@@ -29,7 +29,7 @@ import org.assertj.core.api.Assertions.assertThat
import org.jetbrains.spek.api.Spek
import org.jetbrains.spek.api.dsl.describe
import org.jetbrains.spek.api.dsl.it
-import org.onap.dcae.collectors.veshv.domain.VesEventDomain.HVMEAS
+import org.onap.dcae.collectors.veshv.domain.VesEventDomain.PERF3GPP
import org.onap.dcae.collectors.veshv.domain.WireFrameEncoder
import org.onap.dcae.collectors.veshv.tests.fakes.CountingSink
import org.onap.dcae.collectors.veshv.tests.fakes.basicConfiguration
@@ -62,7 +62,7 @@ object PerformanceSpecification : Spek({
val timeout = Duration.ofMinutes((1 + (runs / 2)).toLong())
val params = MessageParameters(
- commonEventHeader = commonHeader(HVMEAS),
+ commonEventHeader = commonHeader(PERF3GPP),
messageType = VALID,
amount = numMessages
)
@@ -92,7 +92,7 @@ object PerformanceSpecification : Spek({
val timeout = Duration.ofSeconds(30)
val params = MessageParameters(
- commonEventHeader = commonHeader(HVMEAS),
+ commonEventHeader = commonHeader(PERF3GPP),
messageType = VALID,
amount = numMessages
)
diff --git a/hv-collector-ct/src/test/kotlin/org/onap/dcae/collectors/veshv/tests/component/VesHvSpecification.kt b/hv-collector-ct/src/test/kotlin/org/onap/dcae/collectors/veshv/tests/component/VesHvSpecification.kt
index 3eba9b6b..e9c0d67f 100644
--- a/hv-collector-ct/src/test/kotlin/org/onap/dcae/collectors/veshv/tests/component/VesHvSpecification.kt
+++ b/hv-collector-ct/src/test/kotlin/org/onap/dcae/collectors/veshv/tests/component/VesHvSpecification.kt
@@ -25,12 +25,12 @@ import org.jetbrains.spek.api.dsl.describe
import org.jetbrains.spek.api.dsl.given
import org.jetbrains.spek.api.dsl.it
import org.onap.dcae.collectors.veshv.domain.VesEventDomain.OTHER
-import org.onap.dcae.collectors.veshv.domain.VesEventDomain.HVMEAS
+import org.onap.dcae.collectors.veshv.domain.VesEventDomain.PERF3GPP
import org.onap.dcae.collectors.veshv.domain.VesEventDomain.HEARTBEAT
import org.onap.dcae.collectors.veshv.domain.VesEventDomain.MEASUREMENT
import org.onap.dcae.collectors.veshv.healthcheck.api.HealthDescription
-import org.onap.dcae.collectors.veshv.tests.fakes.ALTERNATE_HVMEAS_TOPIC
-import org.onap.dcae.collectors.veshv.tests.fakes.HVMEAS_TOPIC
+import org.onap.dcae.collectors.veshv.tests.fakes.ALTERNATE_PERF3GPP_TOPIC
+import org.onap.dcae.collectors.veshv.tests.fakes.PERF3GPP_TOPIC
import org.onap.dcae.collectors.veshv.tests.fakes.MEASUREMENTS_FOR_VF_SCALING_TOPIC
import org.onap.dcae.collectors.veshv.tests.fakes.StoringSink
import org.onap.dcae.collectors.veshv.tests.fakes.basicConfiguration
@@ -57,8 +57,8 @@ object VesHvSpecification : Spek({
it("should handle multiple HV RAN events") {
val (sut, sink) = vesHvWithStoringSink()
val messages = sut.handleConnection(sink,
- vesWireFrameMessage(HVMEAS),
- vesWireFrameMessage(HVMEAS)
+ vesWireFrameMessage(PERF3GPP),
+ vesWireFrameMessage(PERF3GPP)
)
assertThat(messages)
@@ -70,9 +70,9 @@ object VesHvSpecification : Spek({
describe("Memory management") {
it("should release memory for each handled and dropped message") {
val (sut, sink) = vesHvWithStoringSink()
- val validMessage = vesWireFrameMessage(HVMEAS)
+ val validMessage = vesWireFrameMessage(PERF3GPP)
val msgWithInvalidFrame = invalidWireFrame()
- val msgWithTooBigPayload = vesMessageWithTooBigPayload(HVMEAS)
+ val msgWithTooBigPayload = vesMessageWithTooBigPayload(PERF3GPP)
val expectedRefCnt = 0
val handledEvents = sut.handleConnection(
@@ -93,7 +93,7 @@ object VesHvSpecification : Spek({
it("should release memory for each message with invalid payload") {
val (sut, sink) = vesHvWithStoringSink()
- val validMessage = vesWireFrameMessage(HVMEAS)
+ val validMessage = vesWireFrameMessage(PERF3GPP)
val msgWithInvalidPayload = wireFrameMessageWithInvalidPayload()
val expectedRefCnt = 0
@@ -112,7 +112,7 @@ object VesHvSpecification : Spek({
it("should release memory for each message with garbage frame") {
val (sut, sink) = vesHvWithStoringSink()
- val validMessage = vesWireFrameMessage(HVMEAS)
+ val validMessage = vesWireFrameMessage(PERF3GPP)
val msgWithGarbageFrame = garbageFrame()
val expectedRefCnt = 0
@@ -134,11 +134,11 @@ object VesHvSpecification : Spek({
it("should direct message to a topic by means of routing configuration") {
val (sut, sink) = vesHvWithStoringSink()
- val messages = sut.handleConnection(sink, vesWireFrameMessage(HVMEAS))
+ val messages = sut.handleConnection(sink, vesWireFrameMessage(PERF3GPP))
assertThat(messages).describedAs("number of routed messages").hasSize(1)
val msg = messages[0]
- assertThat(msg.topic).describedAs("routed message topic").isEqualTo(HVMEAS_TOPIC)
+ assertThat(msg.topic).describedAs("routed message topic").isEqualTo(PERF3GPP_TOPIC)
assertThat(msg.partition).describedAs("routed message partition").isEqualTo(0)
}
@@ -148,17 +148,17 @@ object VesHvSpecification : Spek({
sut.configurationProvider.updateConfiguration(twoDomainsToOneTopicConfiguration)
val messages = sut.handleConnection(sink,
- vesWireFrameMessage(HVMEAS),
+ vesWireFrameMessage(PERF3GPP),
vesWireFrameMessage(HEARTBEAT),
vesWireFrameMessage(MEASUREMENT))
assertThat(messages).describedAs("number of routed messages").hasSize(3)
assertThat(messages[0].topic).describedAs("first message topic")
- .isEqualTo(HVMEAS_TOPIC)
+ .isEqualTo(PERF3GPP_TOPIC)
assertThat(messages[1].topic).describedAs("second message topic")
- .isEqualTo(HVMEAS_TOPIC)
+ .isEqualTo(PERF3GPP_TOPIC)
assertThat(messages[2].topic).describedAs("last message topic")
.isEqualTo(MEASUREMENTS_FOR_VF_SCALING_TOPIC)
@@ -168,13 +168,13 @@ object VesHvSpecification : Spek({
val (sut, sink) = vesHvWithStoringSink()
val messages = sut.handleConnection(sink,
vesWireFrameMessage(OTHER, "first"),
- vesWireFrameMessage(HVMEAS, "second"),
+ vesWireFrameMessage(PERF3GPP, "second"),
vesWireFrameMessage(HEARTBEAT, "third"))
assertThat(messages).describedAs("number of routed messages").hasSize(1)
val msg = messages[0]
- assertThat(msg.topic).describedAs("routed message topic").isEqualTo(HVMEAS_TOPIC)
+ assertThat(msg.topic).describedAs("routed message topic").isEqualTo(PERF3GPP_TOPIC)
assertThat(msg.message.header.eventId).describedAs("routed message eventId").isEqualTo("second")
}
}
@@ -208,41 +208,41 @@ object VesHvSpecification : Spek({
sut.configurationProvider.updateConfiguration(configurationWithoutRouting)
- val messages = sut.handleConnection(sink, vesWireFrameMessage(HVMEAS))
+ val messages = sut.handleConnection(sink, vesWireFrameMessage(PERF3GPP))
assertThat(messages).isEmpty()
sut.configurationProvider.updateConfiguration(basicConfiguration)
- val messagesAfterUpdate = sut.handleConnection(sink, vesWireFrameMessage(HVMEAS))
+ val messagesAfterUpdate = sut.handleConnection(sink, vesWireFrameMessage(PERF3GPP))
assertThat(messagesAfterUpdate).hasSize(1)
val message = messagesAfterUpdate[0]
assertThat(message.topic).describedAs("routed message topic after configuration's change")
- .isEqualTo(HVMEAS_TOPIC)
+ .isEqualTo(PERF3GPP_TOPIC)
assertThat(message.partition).describedAs("routed message partition")
.isEqualTo(0)
}
it("should change domain routing") {
- val messages = sut.handleConnection(sink, vesWireFrameMessage(HVMEAS))
+ val messages = sut.handleConnection(sink, vesWireFrameMessage(PERF3GPP))
assertThat(messages).hasSize(1)
val firstMessage = messages[0]
assertThat(firstMessage.topic).describedAs("routed message topic on initial configuration")
- .isEqualTo(HVMEAS_TOPIC)
+ .isEqualTo(PERF3GPP_TOPIC)
assertThat(firstMessage.partition).describedAs("routed message partition")
.isEqualTo(0)
sut.configurationProvider.updateConfiguration(configurationWithDifferentRouting)
- val messagesAfterUpdate = sut.handleConnection(sink, vesWireFrameMessage(HVMEAS))
+ val messagesAfterUpdate = sut.handleConnection(sink, vesWireFrameMessage(PERF3GPP))
assertThat(messagesAfterUpdate).hasSize(2)
val secondMessage = messagesAfterUpdate[1]
assertThat(secondMessage.topic).describedAs("routed message topic after configuration's change")
- .isEqualTo(ALTERNATE_HVMEAS_TOPIC)
+ .isEqualTo(ALTERNATE_PERF3GPP_TOPIC)
assertThat(secondMessage.partition).describedAs("routed message partition")
.isEqualTo(0)
}
@@ -257,13 +257,13 @@ object VesHvSpecification : Spek({
sut.configurationProvider.updateConfiguration(configurationWithDifferentRouting)
}
}.doOnNext {
- sut.handleConnection(sink, vesWireFrameMessage(HVMEAS))
+ sut.handleConnection(sink, vesWireFrameMessage(PERF3GPP))
}.then().block(defaultTimeout)
val messages = sink.sentMessages
- val firstTopicMessagesCount = messages.count { it.topic == HVMEAS_TOPIC }
- val secondTopicMessagesCount = messages.count { it.topic == ALTERNATE_HVMEAS_TOPIC }
+ val firstTopicMessagesCount = messages.count { it.topic == PERF3GPP_TOPIC }
+ val secondTopicMessagesCount = messages.count { it.topic == ALTERNATE_PERF3GPP_TOPIC }
assertThat(messages.size).isEqualTo(messagesAmount)
assertThat(messagesForEachTopic)
@@ -284,14 +284,14 @@ object VesHvSpecification : Spek({
println("config changed")
}
}
- .map { vesWireFrameMessage(HVMEAS) }
+ .map { vesWireFrameMessage(PERF3GPP) }
sut.collector.handleConnection(sut.alloc, incomingMessages).block(defaultTimeout)
val messages = sink.sentMessages
- val firstTopicMessagesCount = messages.count { it.topic == HVMEAS_TOPIC }
- val secondTopicMessagesCount = messages.count { it.topic == ALTERNATE_HVMEAS_TOPIC }
+ val firstTopicMessagesCount = messages.count { it.topic == PERF3GPP_TOPIC }
+ val secondTopicMessagesCount = messages.count { it.topic == ALTERNATE_PERF3GPP_TOPIC }
assertThat(messages.size).isEqualTo(messageStreamSize)
assertThat(firstTopicMessagesCount)
@@ -328,9 +328,9 @@ object VesHvSpecification : Spek({
val (sut, sink) = vesHvWithStoringSink()
val handledMessages = sut.handleConnection(sink,
- vesWireFrameMessage(HVMEAS, "first"),
- vesMessageWithTooBigPayload(HVMEAS),
- vesWireFrameMessage(HVMEAS))
+ vesWireFrameMessage(PERF3GPP, "first"),
+ vesMessageWithTooBigPayload(PERF3GPP),
+ vesWireFrameMessage(PERF3GPP))
assertThat(handledMessages).hasSize(1)
assertThat(handledMessages.first().message.header.eventId).isEqualTo("first")
diff --git a/hv-collector-ct/src/test/kotlin/org/onap/dcae/collectors/veshv/tests/fakes/configuration.kt b/hv-collector-ct/src/test/kotlin/org/onap/dcae/collectors/veshv/tests/fakes/configuration.kt
index 688f2758..432b6976 100644
--- a/hv-collector-ct/src/test/kotlin/org/onap/dcae/collectors/veshv/tests/fakes/configuration.kt
+++ b/hv-collector-ct/src/test/kotlin/org/onap/dcae/collectors/veshv/tests/fakes/configuration.kt
@@ -20,7 +20,7 @@
package org.onap.dcae.collectors.veshv.tests.fakes
import org.onap.dcae.collectors.veshv.boundary.ConfigurationProvider
-import org.onap.dcae.collectors.veshv.domain.VesEventDomain.HVMEAS
+import org.onap.dcae.collectors.veshv.domain.VesEventDomain.PERF3GPP
import org.onap.dcae.collectors.veshv.domain.VesEventDomain.HEARTBEAT
import org.onap.dcae.collectors.veshv.domain.VesEventDomain.MEASUREMENT
import org.onap.dcae.collectors.veshv.model.CollectorConfiguration
@@ -31,16 +31,16 @@ import reactor.core.publisher.UnicastProcessor
import reactor.retry.RetryExhaustedException
-const val HVMEAS_TOPIC = "ves_hvRanMeas"
-const val MEASUREMENTS_FOR_VF_SCALING_TOPIC = "ves_hvMeasForVfScaling"
-const val ALTERNATE_HVMEAS_TOPIC = "ves_alternateHvRanMeas"
+const val PERF3GPP_TOPIC = "HV_VES_PERF3GPP"
+const val MEASUREMENTS_FOR_VF_SCALING_TOPIC = "HV_VES_MEAS_FOR_VF_SCALING"
+const val ALTERNATE_PERF3GPP_TOPIC = "HV_VES_PERF3GPP_ALTERNATIVE"
val basicConfiguration: CollectorConfiguration = CollectorConfiguration(
kafkaBootstrapServers = "localhost:9969",
routing = routing {
defineRoute {
- fromDomain(HVMEAS.name)
- toTopic(HVMEAS_TOPIC)
+ fromDomain(PERF3GPP.name)
+ toTopic(PERF3GPP_TOPIC)
withFixedPartitioning()
}
}.build()
@@ -50,13 +50,13 @@ val twoDomainsToOneTopicConfiguration: CollectorConfiguration = CollectorConfigu
kafkaBootstrapServers = "localhost:9969",
routing = routing {
defineRoute {
- fromDomain(HVMEAS.name)
- toTopic(HVMEAS_TOPIC)
+ fromDomain(PERF3GPP.name)
+ toTopic(PERF3GPP_TOPIC)
withFixedPartitioning()
}
defineRoute {
fromDomain(HEARTBEAT.name)
- toTopic(HVMEAS_TOPIC)
+ toTopic(PERF3GPP_TOPIC)
withFixedPartitioning()
}
defineRoute {
@@ -72,8 +72,8 @@ val configurationWithDifferentRouting: CollectorConfiguration = CollectorConfigu
kafkaBootstrapServers = "localhost:9969",
routing = routing {
defineRoute {
- fromDomain(HVMEAS.name)
- toTopic(ALTERNATE_HVMEAS_TOPIC)
+ fromDomain(PERF3GPP.name)
+ toTopic(ALTERNATE_PERF3GPP_TOPIC)
withFixedPartitioning()
}
}.build()