From 55c3c90d4995c811251369fc557d9855de51b97b Mon Sep 17 00:00:00 2001 From: godotg Date: Sun, 7 Jul 2024 13:54:44 +0800 Subject: [PATCH] test[scala]: scala protocol test --- .../com/zfoo/scala/ProtocolManager.scala | 28 +++++++++---------- .../com/zfoo/scala/packet/ComplexObject.scala | 2 +- .../com/zfoo/scala/packet/EmptyObject.scala | 2 +- .../com/zfoo/scala/packet/NormalObject.scala | 2 +- .../scala/com/zfoo/scala/packet/ObjectA.scala | 2 +- .../scala/com/zfoo/scala/packet/ObjectB.scala | 2 +- .../com/zfoo/scala/packet/SimpleObject.scala | 2 +- .../com/zfoo/scala/packet/VeryBigObject.scala | 2 +- 8 files changed, 21 insertions(+), 21 deletions(-) diff --git a/protocol/src/test/scala/com/zfoo/scala/ProtocolManager.scala b/protocol/src/test/scala/com/zfoo/scala/ProtocolManager.scala index 725401725..87e2f90ad 100644 --- a/protocol/src/test/scala/com/zfoo/scala/ProtocolManager.scala +++ b/protocol/src/test/scala/com/zfoo/scala/ProtocolManager.scala @@ -1,18 +1,18 @@ package com.zfoo.scala import com.zfoo.scala.packet.EmptyObject -import com.zfoo.scala.packet.RegistrationEmptyObject +import com.zfoo.scala.packet.EmptyObjectRegistration import com.zfoo.scala.packet.VeryBigObject -import com.zfoo.scala.packet.RegistrationVeryBigObject +import com.zfoo.scala.packet.VeryBigObjectRegistration import com.zfoo.scala.packet.ComplexObject -import com.zfoo.scala.packet.RegistrationComplexObject +import com.zfoo.scala.packet.ComplexObjectRegistration import com.zfoo.scala.packet.NormalObject -import com.zfoo.scala.packet.RegistrationNormalObject +import com.zfoo.scala.packet.NormalObjectRegistration import com.zfoo.scala.packet.ObjectA -import com.zfoo.scala.packet.RegistrationObjectA +import com.zfoo.scala.packet.ObjectARegistration import com.zfoo.scala.packet.ObjectB -import com.zfoo.scala.packet.RegistrationObjectB +import com.zfoo.scala.packet.ObjectBRegistration import com.zfoo.scala.packet.SimpleObject -import com.zfoo.scala.packet.RegistrationSimpleObject +import com.zfoo.scala.packet.SimpleObjectRegistration import scala.collection.mutable object ProtocolManager { @@ -22,19 +22,19 @@ object ProtocolManager { def initProtocol(): Unit = { // initProtocol - protocols(0) = RegistrationEmptyObject + protocols(0) = EmptyObjectRegistration protocolIdMap.put(classOf[EmptyObject], 0) - protocols(1) = RegistrationVeryBigObject + protocols(1) = VeryBigObjectRegistration protocolIdMap.put(classOf[VeryBigObject], 1) - protocols(100) = RegistrationComplexObject + protocols(100) = ComplexObjectRegistration protocolIdMap.put(classOf[ComplexObject], 100) - protocols(101) = RegistrationNormalObject + protocols(101) = NormalObjectRegistration protocolIdMap.put(classOf[NormalObject], 101) - protocols(102) = RegistrationObjectA + protocols(102) = ObjectARegistration protocolIdMap.put(classOf[ObjectA], 102) - protocols(103) = RegistrationObjectB + protocols(103) = ObjectBRegistration protocolIdMap.put(classOf[ObjectB], 103) - protocols(104) = RegistrationSimpleObject + protocols(104) = SimpleObjectRegistration protocolIdMap.put(classOf[SimpleObject], 104) } diff --git a/protocol/src/test/scala/com/zfoo/scala/packet/ComplexObject.scala b/protocol/src/test/scala/com/zfoo/scala/packet/ComplexObject.scala index 35e2fcf0a..aa6f5da98 100644 --- a/protocol/src/test/scala/com/zfoo/scala/packet/ComplexObject.scala +++ b/protocol/src/test/scala/com/zfoo/scala/packet/ComplexObject.scala @@ -62,7 +62,7 @@ class ComplexObject { var myObject: ObjectA = _ } -object RegistrationComplexObject extends IProtocolRegistration { +object ComplexObjectRegistration extends IProtocolRegistration { override def protocolId: Short = 100 override def write(buffer: ByteBuffer, packet: Any): Unit = { diff --git a/protocol/src/test/scala/com/zfoo/scala/packet/EmptyObject.scala b/protocol/src/test/scala/com/zfoo/scala/packet/EmptyObject.scala index 0f00e0cf0..a0a199969 100644 --- a/protocol/src/test/scala/com/zfoo/scala/packet/EmptyObject.scala +++ b/protocol/src/test/scala/com/zfoo/scala/packet/EmptyObject.scala @@ -8,7 +8,7 @@ class EmptyObject { } -object RegistrationEmptyObject extends IProtocolRegistration { +object EmptyObjectRegistration extends IProtocolRegistration { override def protocolId: Short = 0 override def write(buffer: ByteBuffer, packet: Any): Unit = { diff --git a/protocol/src/test/scala/com/zfoo/scala/packet/NormalObject.scala b/protocol/src/test/scala/com/zfoo/scala/packet/NormalObject.scala index 81b012468..f34056220 100644 --- a/protocol/src/test/scala/com/zfoo/scala/packet/NormalObject.scala +++ b/protocol/src/test/scala/com/zfoo/scala/packet/NormalObject.scala @@ -30,7 +30,7 @@ class NormalObject { var outCompatibleValue2: Int = 0 } -object RegistrationNormalObject extends IProtocolRegistration { +object NormalObjectRegistration extends IProtocolRegistration { override def protocolId: Short = 101 override def write(buffer: ByteBuffer, packet: Any): Unit = { diff --git a/protocol/src/test/scala/com/zfoo/scala/packet/ObjectA.scala b/protocol/src/test/scala/com/zfoo/scala/packet/ObjectA.scala index 8ce2cf129..2eb2785ba 100644 --- a/protocol/src/test/scala/com/zfoo/scala/packet/ObjectA.scala +++ b/protocol/src/test/scala/com/zfoo/scala/packet/ObjectA.scala @@ -12,7 +12,7 @@ class ObjectA { var innerCompatibleValue: Int = 0 } -object RegistrationObjectA extends IProtocolRegistration { +object ObjectARegistration extends IProtocolRegistration { override def protocolId: Short = 102 override def write(buffer: ByteBuffer, packet: Any): Unit = { diff --git a/protocol/src/test/scala/com/zfoo/scala/packet/ObjectB.scala b/protocol/src/test/scala/com/zfoo/scala/packet/ObjectB.scala index 3750e7aa0..897750a0a 100644 --- a/protocol/src/test/scala/com/zfoo/scala/packet/ObjectB.scala +++ b/protocol/src/test/scala/com/zfoo/scala/packet/ObjectB.scala @@ -9,7 +9,7 @@ class ObjectB { var innerCompatibleValue: Int = 0 } -object RegistrationObjectB extends IProtocolRegistration { +object ObjectBRegistration extends IProtocolRegistration { override def protocolId: Short = 103 override def write(buffer: ByteBuffer, packet: Any): Unit = { diff --git a/protocol/src/test/scala/com/zfoo/scala/packet/SimpleObject.scala b/protocol/src/test/scala/com/zfoo/scala/packet/SimpleObject.scala index 829892a4d..c3d142f2e 100644 --- a/protocol/src/test/scala/com/zfoo/scala/packet/SimpleObject.scala +++ b/protocol/src/test/scala/com/zfoo/scala/packet/SimpleObject.scala @@ -9,7 +9,7 @@ class SimpleObject { var g: Boolean = false } -object RegistrationSimpleObject extends IProtocolRegistration { +object SimpleObjectRegistration extends IProtocolRegistration { override def protocolId: Short = 104 override def write(buffer: ByteBuffer, packet: Any): Unit = { diff --git a/protocol/src/test/scala/com/zfoo/scala/packet/VeryBigObject.scala b/protocol/src/test/scala/com/zfoo/scala/packet/VeryBigObject.scala index de86204fc..8be3f21f5 100644 --- a/protocol/src/test/scala/com/zfoo/scala/packet/VeryBigObject.scala +++ b/protocol/src/test/scala/com/zfoo/scala/packet/VeryBigObject.scala @@ -3353,7 +3353,7 @@ class VeryBigObject { var ssss88: Set[String] = _ } -object RegistrationVeryBigObject extends IProtocolRegistration { +object VeryBigObjectRegistration extends IProtocolRegistration { override def protocolId: Short = 1 override def write(buffer: ByteBuffer, packet: Any): Unit = {