aboutsummaryrefslogtreecommitdiffstats
path: root/hv-collector-ct
diff options
context:
space:
mode:
authorPiotr Jaszczyk <piotr.jaszczyk@nokia.com>2018-06-04 13:51:29 +0200
committerPiotr Jaszczyk <piotr.jaszczyk@nokia.com>2018-08-01 09:06:13 +0200
commit5644fbd17af113c2d65ffbad71548eb26898ee18 (patch)
tree2a4a4b4515658cf9d1467dc5c9f136eb4454d8de /hv-collector-ct
parent4b8cfb3e5bafc0cb078e37f64d0f21e8dfb0916a (diff)
Fix wire protocol decoder refCnt issue
We should use retain + slice because every reactor-netty operator automatically releases the buffer. Change-Id: Ie0282e70fadb56d56fc410a08e036fb0ca10584c Signed-off-by: Piotr Jaszczyk <piotr.jaszczyk@nokia.com> Issue-ID: DCAEGEN2-601
Diffstat (limited to 'hv-collector-ct')
-rw-r--r--hv-collector-ct/src/test/kotlin/org/onap/dcae/collectors/veshv/tests/component/VesHvSpecification.kt9
1 files changed, 5 insertions, 4 deletions
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 2cfb785e..5990fd0a 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
@@ -47,21 +47,22 @@ object VesHvSpecification : Spek({
val msgWithInvalidPayload = invalidVesMessage()
val msgWithInvalidFrame = invalidWireFrame()
val validMessage = vesMessage(Domain.HVRANMEAS)
+ val refCntBeforeSending = msgWithInvalidDomain.refCnt()
sut.handleConnection(msgWithInvalidDomain, msgWithInvalidPayload, msgWithInvalidFrame, validMessage)
assertThat(msgWithInvalidDomain.refCnt())
.describedAs("message with invalid domain should be released")
- .isEqualTo(0)
+ .isEqualTo(refCntBeforeSending)
assertThat(msgWithInvalidPayload.refCnt())
.describedAs("message with invalid payload should be released")
- .isEqualTo(0)
+ .isEqualTo(refCntBeforeSending)
assertThat(msgWithInvalidFrame.refCnt())
.describedAs("message with invalid frame should be released")
- .isEqualTo(0)
+ .isEqualTo(refCntBeforeSending)
assertThat(validMessage.refCnt())
.describedAs("handled message should be released")
- .isEqualTo(0)
+ .isEqualTo(refCntBeforeSending)
}
}