added and expanded tests in hopes of increasing code coverage score

added tests for AvatarService and PacketCodingActor; especially PCA tests
This commit is contained in:
FateJH 2017-12-05 00:37:24 -05:00
parent 0e5afe6cfd
commit 3aee0ab4e8
69 changed files with 4534 additions and 3037 deletions

View file

@ -120,10 +120,6 @@ class PacketCodingActor extends Actor with MDCContextAware {
// failWithError(s"Invalid message '$default' received in state Established")
}
def resetState() : Unit = {
context.become(receive)
}
/**
* Retrieve the current subslot number.
* Increment the `subslot` for the next time it is needed.

View file

@ -199,7 +199,7 @@ class WorldSessionActor extends Actor with MDCContextAware {
sendResponse(PacketCoding.CreateGamePacket(0, ObjectHeldMessage(guid, slot, true)))
}
case AvatarResponse.PlanetSideAttribute(attribute_type, attribute_value) =>
case AvatarResponse.PlanetsideAttribute(attribute_type, attribute_value) =>
if(player.GUID != guid) {
sendResponse(PacketCoding.CreateGamePacket(0, PlanetsideAttributeMessage(guid, attribute_type, attribute_value)))
}

View file

@ -19,7 +19,7 @@ object AvatarResponse {
// final case class LoadMap() extends Response
final case class ObjectDelete(item_guid : PlanetSideGUID, unk : Int) extends Response
final case class ObjectHeld(slot : Int) extends Response
final case class PlanetSideAttribute(attribute_type : Int, attribute_value : Long) extends Response
final case class PlanetsideAttribute(attribute_type : Int, attribute_value : Long) extends Response
final case class PlayerState(msg : PlayerStateMessageUpstream, spectator : Boolean, weaponInHand : Boolean) extends Response
final case class Reload(mag : Int) extends Response
// final case class PlayerStateShift(itemID : PlanetSideGUID) extends Response

View file

@ -59,7 +59,7 @@ class AvatarService extends Actor {
)
case AvatarAction.PlanetsideAttribute(guid, attribute_type, attribute_value) =>
AvatarEvents.publish(
AvatarServiceResponse(s"/$forChannel/Avatar", guid, AvatarResponse.PlanetSideAttribute(attribute_type, attribute_value))
AvatarServiceResponse(s"/$forChannel/Avatar", guid, AvatarResponse.PlanetsideAttribute(attribute_type, attribute_value))
)
case AvatarAction.PlayerState(guid, msg, spectator, weapon) =>
AvatarEvents.publish(