Skip to content

Commit

Permalink
test[scala]: scala protocol test
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysunxiao committed Jul 7, 2024
1 parent a32fbd4 commit 55c3c90
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 21 deletions.
28 changes: 14 additions & 14 deletions protocol/src/test/scala/com/zfoo/scala/ProtocolManager.scala
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -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)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit 55c3c90

Please sign in to comment.