diff options
author | 2018-06-05 12:55:06 +0200 | |
---|---|---|
committer | 2018-08-01 11:14:55 +0200 | |
commit | 23438166832778b36f3aac7b3cc0b81ab6e8da1e (patch) | |
tree | e0f6c70b8c3f105849d16351cfc3d7882b618f45 /hv-collector-core/src/test | |
parent | f895b8628fbc9cde4013dcf68607b4e18a8ce85b (diff) |
Extract domain module
WireFrame extracted to domain module
Domain package name in collector-core changed to avoid collision
Merged Protobuf module with new domain module
Closes ONAP-253.
Change-Id: Ie7ac0bb877eae018a7520b4f3ceebe9fd51dbf65
Signed-off-by: fkrzywka <filip.krzywka@nokia.com>
Issue-ID: DCAEGEN2-601
Diffstat (limited to 'hv-collector-core/src/test')
6 files changed, 7 insertions, 64 deletions
diff --git a/hv-collector-core/src/test/kotlin/org/onap/dcae/collectors/veshv/domain/WireFrameTest.kt b/hv-collector-core/src/test/kotlin/org/onap/dcae/collectors/veshv/domain/WireFrameTest.kt deleted file mode 100644 index 5a923c4e..00000000 --- a/hv-collector-core/src/test/kotlin/org/onap/dcae/collectors/veshv/domain/WireFrameTest.kt +++ /dev/null @@ -1,55 +0,0 @@ -package org.onap.dcae.collectors.veshv.domain - -import io.netty.buffer.ByteBufAllocator -import io.netty.buffer.Unpooled -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 - -/** - * @author Piotr Jaszczyk <piotr.jaszczyk@nokia.com> - * @since June 2018 - */ -object WireFrameTest : Spek({ - describe("Wire Frame codec") { - describe("encode-decode methods' compatibility") { - val payloadContent = "test" - val payload = Unpooled.wrappedBuffer(payloadContent.toByteArray(Charsets.US_ASCII)) - val frame = WireFrame(payload = payload, - majorVersion = 1, - minorVersion = 2, - mark = 0xFF, - payloadSize = payload.readableBytes()) - - val encoded = frame.encode(ByteBufAllocator.DEFAULT) - val decoded = WireFrame.decode(encoded) - - it("should decode major version") { - assertThat(decoded.majorVersion).isEqualTo(frame.majorVersion) - } - - it("should decode minor version") { - assertThat(decoded.minorVersion).isEqualTo(frame.minorVersion) - } - - it("should decode mark") { - assertThat(decoded.mark).isEqualTo(frame.mark) - } - - it("should decode payload size") { - assertThat(decoded.payloadSize).isEqualTo(frame.payloadSize) - } - - it("should decode payload") { - assertThat(decoded.payload.toString(Charsets.US_ASCII)) - .isEqualTo(payloadContent) - } - - it("should retain decoded payload") { - encoded.release() - assertThat(decoded.payload.refCnt()).isEqualTo(1) - } - } - } -})
\ No newline at end of file diff --git a/hv-collector-core/src/test/kotlin/org/onap/dcae/collectors/veshv/impl/MessageValidatorTest.kt b/hv-collector-core/src/test/kotlin/org/onap/dcae/collectors/veshv/impl/MessageValidatorTest.kt index 4f893307..df2840b9 100644 --- a/hv-collector-core/src/test/kotlin/org/onap/dcae/collectors/veshv/impl/MessageValidatorTest.kt +++ b/hv-collector-core/src/test/kotlin/org/onap/dcae/collectors/veshv/impl/MessageValidatorTest.kt @@ -27,7 +27,7 @@ import org.jetbrains.spek.api.Spek import org.jetbrains.spek.api.dsl.given import org.jetbrains.spek.api.dsl.it import org.jetbrains.spek.api.dsl.on -import org.onap.dcae.collectors.veshv.domain.VesMessage +import org.onap.dcae.collectors.veshv.model.VesMessage import org.onap.ves.VesEventV5.VesEvent.CommonEventHeader import org.onap.ves.VesEventV5.VesEvent import org.assertj.core.api.Assertions.assertThat diff --git a/hv-collector-core/src/test/kotlin/org/onap/dcae/collectors/veshv/impl/RouterTest.kt b/hv-collector-core/src/test/kotlin/org/onap/dcae/collectors/veshv/impl/RouterTest.kt index ac91aaeb..3812db58 100644 --- a/hv-collector-core/src/test/kotlin/org/onap/dcae/collectors/veshv/impl/RouterTest.kt +++ b/hv-collector-core/src/test/kotlin/org/onap/dcae/collectors/veshv/impl/RouterTest.kt @@ -6,8 +6,8 @@ import org.jetbrains.spek.api.Spek import org.jetbrains.spek.api.dsl.given import org.jetbrains.spek.api.dsl.it import org.jetbrains.spek.api.dsl.on -import org.onap.dcae.collectors.veshv.domain.VesMessage -import org.onap.dcae.collectors.veshv.domain.routing +import org.onap.dcae.collectors.veshv.model.VesMessage +import org.onap.dcae.collectors.veshv.model.routing import org.onap.ves.VesEventV5.VesEvent.CommonEventHeader import org.onap.ves.VesEventV5.VesEvent.CommonEventHeader.Domain diff --git a/hv-collector-core/src/test/kotlin/org/onap/dcae/collectors/veshv/impl/VesDecoderTest.kt b/hv-collector-core/src/test/kotlin/org/onap/dcae/collectors/veshv/impl/VesDecoderTest.kt index 1aae8540..8d9e4962 100644 --- a/hv-collector-core/src/test/kotlin/org/onap/dcae/collectors/veshv/impl/VesDecoderTest.kt +++ b/hv-collector-core/src/test/kotlin/org/onap/dcae/collectors/veshv/impl/VesDecoderTest.kt @@ -26,10 +26,9 @@ import org.jetbrains.spek.api.Spek import org.jetbrains.spek.api.dsl.given import org.jetbrains.spek.api.dsl.it import org.jetbrains.spek.api.dsl.on -import org.onap.dcae.collectors.veshv.domain.VesMessage +import org.onap.dcae.collectors.veshv.model.VesMessage import org.onap.ves.VesEventV5.VesEvent import org.onap.ves.VesEventV5.VesEvent.CommonEventHeader -import reactor.test.StepVerifier import java.nio.charset.Charset diff --git a/hv-collector-core/src/test/kotlin/org/onap/dcae/collectors/veshv/impl/WireDecoderTest.kt b/hv-collector-core/src/test/kotlin/org/onap/dcae/collectors/veshv/impl/WireDecoderTest.kt index 3563bf6d..81706ce4 100644 --- a/hv-collector-core/src/test/kotlin/org/onap/dcae/collectors/veshv/impl/WireDecoderTest.kt +++ b/hv-collector-core/src/test/kotlin/org/onap/dcae/collectors/veshv/impl/WireDecoderTest.kt @@ -57,7 +57,7 @@ internal object WireDecoderTest : Spek({ given("input with too small payload size") { val input = WireFrame( - payload = Unpooled.wrappedBuffer(byteArrayOf(1, 2 ,3)), + payload = Unpooled.wrappedBuffer(byteArrayOf(1, 2, 3)), mark = 0xFF, majorVersion = 1, minorVersion = 0, @@ -70,7 +70,7 @@ internal object WireDecoderTest : Spek({ given("input with too big payload size") { val input = WireFrame( - payload = Unpooled.wrappedBuffer(byteArrayOf(1, 2 ,3)), + payload = Unpooled.wrappedBuffer(byteArrayOf(1, 2, 3)), mark = 0xFF, majorVersion = 1, minorVersion = 0, diff --git a/hv-collector-core/src/test/kotlin/org/onap/dcae/collectors/veshv/impl/socket/SslContextFactoryTest.kt b/hv-collector-core/src/test/kotlin/org/onap/dcae/collectors/veshv/impl/socket/SslContextFactoryTest.kt index 227e9b9c..dcd4f412 100644 --- a/hv-collector-core/src/test/kotlin/org/onap/dcae/collectors/veshv/impl/socket/SslContextFactoryTest.kt +++ b/hv-collector-core/src/test/kotlin/org/onap/dcae/collectors/veshv/impl/socket/SslContextFactoryTest.kt @@ -27,8 +27,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.jetbrains.spek.api.dsl.xit -import org.onap.dcae.collectors.veshv.domain.SecurityConfiguration +import org.onap.dcae.collectors.veshv.model.SecurityConfiguration import java.nio.file.Paths /** |