mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-02-21 23:53:36 +00:00
changes to quiet the warnings since the 2.13.2 update
This commit is contained in:
parent
222697aee8
commit
6f4eac9e43
56 changed files with 366 additions and 346 deletions
|
|
@ -186,7 +186,7 @@ trait ConfigParser {
|
|||
Valid
|
||||
}
|
||||
|
||||
def ReplaceConfig(map : Map[String, Any]) {
|
||||
def ReplaceConfig(map : Map[String, Any]) : Unit = {
|
||||
config_map = map
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ trait Constraints {
|
|||
errorMessage: String = "error.min",
|
||||
strictErrorMessage: String = "error.min.strict"
|
||||
)(implicit ordering: scala.math.Ordering[T]): Constraint[T] = Constraint[T]("constraint.min", minValue) { o =>
|
||||
(ordering.compare(o, minValue).signum, strict) match {
|
||||
(ordering.compare(o, minValue).sign, strict) match {
|
||||
case (1, _) | (0, false) => Valid
|
||||
case (_, false) => Invalid(ValidationError(errorMessage, minValue))
|
||||
case (_, true) => Invalid(ValidationError(strictErrorMessage, minValue))
|
||||
|
|
@ -145,7 +145,7 @@ trait Constraints {
|
|||
errorMessage: String = "error.max",
|
||||
strictErrorMessage: String = "error.max.strict"
|
||||
)(implicit ordering: scala.math.Ordering[T]): Constraint[T] = Constraint[T]("constraint.max", maxValue) { o =>
|
||||
(ordering.compare(o, maxValue).signum, strict) match {
|
||||
(ordering.compare(o, maxValue).sign, strict) match {
|
||||
case (-1, _) | (0, false) => Valid
|
||||
case (_, false) => Invalid(ValidationError(errorMessage, maxValue))
|
||||
case (_, true) => Invalid(ValidationError(strictErrorMessage, maxValue))
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ final class QuantizedDoubleCodec(min: Double, max: Double, bits: Int) extends Co
|
|||
}
|
||||
|
||||
def UnquantizeDouble(value : Int) : Double = {
|
||||
return ((max - min) * value.toDouble / (1 << bitsL).toDouble + min)
|
||||
return ((max - min) * value.toDouble / (1 << bitsL.toInt).toDouble + min)
|
||||
}
|
||||
|
||||
override def encode(value: Double) = {
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ class Player(private val core : Avatar) extends PlanetSideServerObject
|
|||
def Capacitor : Float = capacitor
|
||||
|
||||
def Capacitor_=(value : Float) : Float = {
|
||||
val newValue = math.min(math.max(0, value), ExoSuitDef.MaxCapacitor)
|
||||
val newValue = math.min(math.max(0, value), ExoSuitDef.MaxCapacitor.toFloat)
|
||||
|
||||
if(newValue < capacitor) {
|
||||
capacitorLastUsedMillis = System.currentTimeMillis()
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ object SpawnPoint {
|
|||
val z = ori.z
|
||||
val zrot = (z + 90) % 360
|
||||
val zrad = math.toRadians(zrot)
|
||||
val shift = Vector3(math.sin(zrad).toFloat, math.cos(zrad).toFloat, 0) * (3 * side) //x=sin, y=cos because compass-0 is East, not North
|
||||
val shift = Vector3(math.sin(zrad).toFloat, math.cos(zrad).toFloat, 0) * (3 * side).toFloat //x=sin, y=cos because compass-0 is East, not North
|
||||
(
|
||||
obj.Position + shift + (if(x >= 330) { //ams leaning to the left
|
||||
Vector3.z(xsin)
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ class PlayerControl(player : Player) extends Actor
|
|||
}
|
||||
|
||||
if(implant.StaminaCost > 0 && implant.GetCostIntervalByExoSuit(player.ExoSuit) > 0) { // Ongoing stamina drain, if applicable
|
||||
implantSlotStaminaDrainTimers(slot) = context.system.scheduler.schedule(0 seconds, implant.GetCostIntervalByExoSuit(player.ExoSuit) milliseconds, self, Player.DrainStamina(implant.StaminaCost))
|
||||
implantSlotStaminaDrainTimers(slot) = context.system.scheduler.scheduleWithFixedDelay(0 seconds, implant.GetCostIntervalByExoSuit(player.ExoSuit) milliseconds, self, Player.DrainStamina(implant.StaminaCost))
|
||||
}
|
||||
|
||||
player.Zone.AvatarEvents ! AvatarServiceMessage(player.Zone.Id, AvatarAction.PlanetsideAttribute(player.GUID, 28, player.Implant(slot).id * 2 + 1)) // Activation sound / effect
|
||||
|
|
|
|||
|
|
@ -166,8 +166,8 @@ object ProjectileDefinition {
|
|||
}
|
||||
|
||||
def CalculateDerivedFields(pdef : ProjectileDefinition) : Unit = {
|
||||
val (distanceMax, distanceFromAcceleration, finalVelocity) : (Float, Float, Float) = if(pdef.Acceleration == 0f) {
|
||||
(pdef.InitialVelocity * pdef.Lifespan, 0, pdef.InitialVelocity)
|
||||
val (distanceMax, distanceFromAcceleration, finalVelocity) : (Float, Float, Float) = if(pdef.Acceleration == 0) {
|
||||
(pdef.InitialVelocity * pdef.Lifespan, 0, pdef.InitialVelocity.toFloat)
|
||||
}
|
||||
else {
|
||||
val distanceFromAcceleration = (pdef.AccelerationUntil * pdef.InitialVelocity) + (0.5f * pdef.Acceleration * pdef.AccelerationUntil * pdef.AccelerationUntil)
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ object AvatarConverter {
|
|||
DressBattleRank(obj),
|
||||
0,
|
||||
DressCommandRank(obj),
|
||||
MakeImplantEffectList(obj.Implants),
|
||||
MakeImplantEffectList(obj.Implants.toIndexedSeq),
|
||||
MakeCosmetics(obj)
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ class TaskResolver() extends Actor {
|
|||
*/
|
||||
private def StartTimeoutCheck() : Unit = {
|
||||
if(timeoutCleanup.isCancelled) {
|
||||
timeoutCleanup = context.system.scheduler.schedule(500 milliseconds, 500 milliseconds, self, TaskResolver.TimeoutCleanup())
|
||||
timeoutCleanup = context.system.scheduler.scheduleWithFixedDelay(500 milliseconds, 500 milliseconds, self, TaskResolver.TimeoutCleanup())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -156,8 +156,8 @@ object GeneratorControl {
|
|||
*/
|
||||
def DamageAwareness(target : Generator, cause : ResolvedProjectile, amount : Int) : Unit = {
|
||||
if(!target.Destroyed) {
|
||||
val health : Float = target.Health
|
||||
val max : Float = target.MaxHealth
|
||||
val health : Float = target.Health.toFloat
|
||||
val max : Float = target.MaxHealth.toFloat
|
||||
if(target.Condition != PlanetSideGeneratorState.Critical && health / max < 0.51f) { //becoming critical
|
||||
target.Condition = PlanetSideGeneratorState.Critical
|
||||
GeneratorControl.UpdateOwner(target)
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@ object GenericHackables {
|
|||
def GetHackSpeed(player : Player, obj: PlanetSideServerObject): Float = {
|
||||
val playerHackLevel = Player.GetHackLevel(player)
|
||||
val timeToHack = obj match {
|
||||
case vehicle : Vehicle => vehicle.JackingDuration(playerHackLevel)
|
||||
case hackable : Hackable => hackable.HackDuration(playerHackLevel)
|
||||
case vehicle : Vehicle => vehicle.JackingDuration(playerHackLevel).toFloat
|
||||
case hackable : Hackable => hackable.HackDuration(playerHackLevel).toFloat
|
||||
case _ =>
|
||||
log.warn(s"${player.Name} tried to hack an object that has no hack time defined - ${obj.Definition.Name}#${obj.GUID} on ${obj.Zone.Id}")
|
||||
0f
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ class VehicleSpawnControl(pad : VehicleSpawnPad) extends VehicleSpawnControlBase
|
|||
case Some(entry) =>
|
||||
if(periodicReminder.isCancelled) {
|
||||
trace (s"the pad has become blocked by ${entry.vehicle.Definition.Name}")
|
||||
periodicReminder = context.system.scheduler.schedule(
|
||||
periodicReminder = context.system.scheduler.scheduleWithFixedDelay(
|
||||
VehicleSpawnControl.initialReminderDelay,
|
||||
VehicleSpawnControl.periodicReminderDelay,
|
||||
self, VehicleSpawnControl.ProcessControl.Reminder
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ class PainboxControl(painbox: Painbox) extends Actor {
|
|||
case Painbox.Start() =>
|
||||
context.become(Running)
|
||||
painboxTick.cancel
|
||||
painboxTick = context.system.scheduler.schedule(0 seconds, 1 second, self, Painbox.Tick())
|
||||
painboxTick = context.system.scheduler.scheduleWithFixedDelay(0 seconds, 1 second, self, Painbox.Tick())
|
||||
|
||||
case _ => ;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ class ProximityTerminalControl(term : Terminal with ProximityUnit) extends Actor
|
|||
val medDef = term.Definition.asInstanceOf[MedicalTerminalDefinition]
|
||||
import scala.concurrent.ExecutionContext.Implicits.global
|
||||
terminalAction.cancel
|
||||
terminalAction = context.system.scheduler.schedule(500 milliseconds, medDef.Interval, self, ProximityTerminalControl.TerminalAction())
|
||||
terminalAction = context.system.scheduler.scheduleWithFixedDelay(500 milliseconds, medDef.Interval, self, ProximityTerminalControl.TerminalAction())
|
||||
TerminalObject.Zone.LocalEvents ! Terminal.StartProximityEffect(term)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ class FacilityTurretControl(turret : FacilityTurret) extends Actor
|
|||
weaponAmmoRechargeTimer.cancel()
|
||||
}
|
||||
|
||||
weaponAmmoRechargeTimer = context.system.scheduler.schedule(3 seconds, 200 milliseconds, self, FacilityTurret.RechargeAmmo())
|
||||
weaponAmmoRechargeTimer = context.system.scheduler.scheduleWithFixedDelay(3 seconds, 200 milliseconds, self, FacilityTurret.RechargeAmmo())
|
||||
|
||||
case FacilityTurret.RechargeAmmo() =>
|
||||
val weapon = turret.ControlledWeapon(1).get.asInstanceOf[net.psforever.objects.Tool]
|
||||
|
|
|
|||
|
|
@ -25,5 +25,5 @@ trait StandardResistanceProfile extends ResistanceProfile {
|
|||
|
||||
def ResistanceAggravated : Int = resistDef.ResistanceDirectHit
|
||||
|
||||
def RadiationShielding : Float = resistDef.ResistanceDirectHit
|
||||
def RadiationShielding : Float = resistDef.ResistanceDirectHit.toFloat
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,11 +22,11 @@ trait ResistanceProfile {
|
|||
|
||||
def Resist(dtype : DamageType.Value) : Float = {
|
||||
dtype match {
|
||||
case DamageType.Direct => ResistanceDirectHit
|
||||
case DamageType.Splash => ResistanceSplash
|
||||
case DamageType.Aggravated => ResistanceAggravated
|
||||
case DamageType.Direct => ResistanceDirectHit.toFloat
|
||||
case DamageType.Splash => ResistanceSplash.toFloat
|
||||
case DamageType.Aggravated => ResistanceAggravated.toFloat
|
||||
case DamageType.Radiation => RadiationShielding
|
||||
case _ => 0
|
||||
case _ => 0f
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -140,12 +140,12 @@ object ResolutionCalculations {
|
|||
if(player.Capacitor.toInt > 0 && player.isShielded) {
|
||||
// Subtract armour damage from capacitor
|
||||
result = SubtractWithRemainder(player.Capacitor.toInt, b)
|
||||
player.Capacitor = result._1
|
||||
player.Capacitor = result._1.toFloat
|
||||
b = result._2
|
||||
|
||||
// Then follow up with health damage if any capacitor is left
|
||||
result = SubtractWithRemainder(player.Capacitor.toInt, a)
|
||||
player.Capacitor = result._1
|
||||
player.Capacitor = result._1.toFloat
|
||||
a = result._2
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import net.psforever.objects.entity.IdentifiableEntity
|
|||
import net.psforever.objects.equipment.Equipment
|
||||
import net.psforever.objects.guid.NumberPoolHub
|
||||
import net.psforever.objects.guid.actor.UniqueNumberSystem
|
||||
import net.psforever.objects.guid.key.LoanedKey
|
||||
import net.psforever.objects.guid.selector.RandomSelector
|
||||
import net.psforever.objects.guid.source.LimitedNumberSource
|
||||
import net.psforever.objects.inventory.Container
|
||||
|
|
@ -31,6 +32,8 @@ import scalax.collection.Graph
|
|||
import scalax.collection.GraphPredef._
|
||||
import scalax.collection.GraphEdge._
|
||||
|
||||
import scala.util.Try
|
||||
|
||||
/**
|
||||
* A server object representing the one-landmass planets as well as the individual subterranean caverns.<br>
|
||||
* <br>
|
||||
|
|
@ -223,7 +226,7 @@ class Zone(private val zoneId : String, zoneMap : ZoneMap, zoneNumber : Int) {
|
|||
* @return synchronized reference to the globally unique identifier system
|
||||
*/
|
||||
def GUID(hub : NumberPoolHub) : Boolean = {
|
||||
if(actor == ActorRef.noSender && guid.Pools.map({case (_, pool) => pool.Count}).sum == 0) {
|
||||
if(actor == ActorRef.noSender && guid.Pools.values.foldLeft(0)(_ + _.Count) == 0) {
|
||||
import org.fusesource.jansi.Ansi.Color.RED
|
||||
import org.fusesource.jansi.Ansi.ansi
|
||||
println(ansi().fgBright(RED).a(s"""Caution: replacement of the number pool system for zone $Id; function is for testing purposes only""").reset())
|
||||
|
|
@ -408,9 +411,9 @@ class Zone(private val zoneId : String, zoneMap : ZoneMap, zoneNumber : Int) {
|
|||
|
||||
private def MakeBuildings(implicit context : ActorContext) : PairMap[Int, Building] = {
|
||||
val buildingList = Map.LocalBuildings
|
||||
val registrationKeys = buildingList.map {
|
||||
case ((_, building_guid, _), _) =>
|
||||
building_guid -> guid.register(building_guid)
|
||||
val registrationKeys : Map[Int, Try[LoanedKey]] = buildingList.map {
|
||||
case ((_, building_guid : Int, _), _) =>
|
||||
(building_guid, guid.register(building_guid))
|
||||
}
|
||||
buildings = buildingList.map({
|
||||
case((name, building_guid, map_id), constructor) if registrationKeys(building_guid).isSuccess =>
|
||||
|
|
@ -448,19 +451,13 @@ class Zone(private val zoneId : String, zoneMap : ZoneMap, zoneNumber : Int) {
|
|||
}
|
||||
|
||||
private def MakeLattice(): Unit = {
|
||||
Map.LatticeLink.foreach({ case(source, target) =>
|
||||
val sourceBuilding = Building(source) match {
|
||||
case Some(building) => building
|
||||
lattice ++= Map.LatticeLink.map { case(source, target) =>
|
||||
val (sourceBuilding, targetBuilding) = (Building(source), Building(target)) match {
|
||||
case (Some(sBuilding), Some(tBuilding)) => (sBuilding, tBuilding)
|
||||
case _ => throw new NoSuchElementException(s"Can't create lattice link between $source $target. Source is missing")
|
||||
}
|
||||
|
||||
val targetBuilding = Building(target) match {
|
||||
case Some(building) => building
|
||||
case _ => throw new NoSuchElementException(s"Can't create lattice link between $source $target. Target is missing")
|
||||
}
|
||||
|
||||
lattice += sourceBuilding~targetBuilding
|
||||
})
|
||||
sourceBuilding~targetBuilding
|
||||
}
|
||||
}
|
||||
|
||||
private def CreateSpawnGroups() : Unit = {
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ object PacketHelpers {
|
|||
def createEnumerationCodec[E <: Enumeration](enum : E, storageCodec : Codec[Int]) : Codec[E#Value] = {
|
||||
type Struct = Int :: HNil
|
||||
val struct : Codec[Struct] = storageCodec.hlist
|
||||
val primitiveLimit = Math.pow(2, storageCodec.sizeBound.exact.get)
|
||||
val primitiveLimit = Math.pow(2, storageCodec.sizeBound.exact.get.toDouble)
|
||||
|
||||
// Assure that the enum will always be able to fit in a N-bit int
|
||||
assert(enum.maxId <= primitiveLimit,
|
||||
|
|
|
|||
|
|
@ -509,6 +509,8 @@ object SquadDetailDefinitionUpdateMessage extends Marshallable[SquadDetailDefini
|
|||
Some(linkFields(member_list.collect { case SquadPositionEntry(_, Some(entry)) => entry }.reverse)) ::
|
||||
HNil
|
||||
)
|
||||
case data =>
|
||||
Attempt.failure(Err(s"can not get squad detail definition from data $data"))
|
||||
}
|
||||
)
|
||||
}
|
||||
|
|
@ -637,6 +639,8 @@ object SquadDetailDefinitionUpdateMessage extends Marshallable[SquadDetailDefini
|
|||
Attempt.successful(SquadDetail(None, None, None, None, None, None, None, None, Some(ignoreTerminatingEntry(member_list.toList))))
|
||||
case false :: None :: Some(_ :: member_list :: HNil) :: HNil =>
|
||||
Attempt.successful(SquadDetail(None, None, None, None, None, None, None, None, Some(ignoreTerminatingEntry(member_list.toList))))
|
||||
case data =>
|
||||
Attempt.failure(Err(s"SquadDetail $data not encoded correctly"))
|
||||
},
|
||||
{
|
||||
case SquadDetail(_, _, _, _, _, _, _, _, Some(member_list)) =>
|
||||
|
|
@ -1108,18 +1112,22 @@ object SquadDetailDefinitionUpdateMessage extends Marshallable[SquadDetailDefini
|
|||
conditional(index < 255, bool :: squad_member_details_codec(bitsOverByte.Add(1))) ::
|
||||
conditional(index == 255, bits)
|
||||
}
|
||||
).xmap[SquadPositionEntry] (
|
||||
).exmap[SquadPositionEntry] (
|
||||
{
|
||||
case 255 :: _ :: _ :: HNil =>
|
||||
SquadPositionEntry(255, None)
|
||||
Attempt.Successful(SquadPositionEntry(255, None))
|
||||
case ndx :: Some(_ :: info :: HNil) :: _ :: HNil =>
|
||||
SquadPositionEntry(ndx, Some(unlinkFields(Some(info))))
|
||||
Attempt.Successful(SquadPositionEntry(ndx, Some(unlinkFields(Some(info)))))
|
||||
case data =>
|
||||
Attempt.Failure(Err(s"SquadPositionEntry: unsupported decoding format - $data"))
|
||||
},
|
||||
{
|
||||
case SquadPositionEntry(255, _) =>
|
||||
255 :: None :: None :: HNil
|
||||
Attempt.Successful(255 :: None :: None :: HNil)
|
||||
case SquadPositionEntry(ndx, Some(info)) =>
|
||||
ndx :: Some(true :: linkFields(info) :: HNil) :: None :: HNil
|
||||
Attempt.Successful(ndx :: Some(true :: linkFields(info) :: HNil) :: None :: HNil)
|
||||
case data =>
|
||||
Attempt.Failure(Err(s"SquadPositionEntry: unsupported encoding format - $data"))
|
||||
}
|
||||
)
|
||||
}
|
||||
|
|
@ -1223,18 +1231,20 @@ object SquadDetailDefinitionUpdateMessage extends Marshallable[SquadDetailDefini
|
|||
conditional(size - 1 > 0, subsequent_position_codec(size - 1)) ::
|
||||
conditional(index == 255, bits)
|
||||
}
|
||||
).xmap[LinkedFields](
|
||||
).exmap[LinkedFields](
|
||||
{
|
||||
case 255 :: _ :: _ :: _ :: HNil =>
|
||||
LinkedFields(255, SquadPositionDetail.Blank, None)
|
||||
Attempt.Successful(LinkedFields(255, SquadPositionDetail.Blank, None))
|
||||
case index :: Some(_ :: entry :: HNil) :: next :: _ :: HNil =>
|
||||
LinkedFields(index, entry, next)
|
||||
Attempt.Successful(LinkedFields(index, entry, next))
|
||||
case data =>
|
||||
Attempt.Failure(Err(s"LinkedFields: unsupported decoding format - $data"))
|
||||
},
|
||||
{
|
||||
case LinkedFields(255, _, _) =>
|
||||
255 :: None :: None :: None :: HNil
|
||||
Attempt.Successful(255 :: None :: None :: None :: HNil)
|
||||
case LinkedFields(index, entry, next) =>
|
||||
index :: Some(true :: entry :: HNil) :: next :: None :: HNil
|
||||
Attempt.Successful(index :: Some(true :: entry :: HNil) :: next :: None :: HNil)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
|
@ -1255,18 +1265,20 @@ object SquadDetailDefinitionUpdateMessage extends Marshallable[SquadDetailDefini
|
|||
conditional(index < 255 && size - 1 > 0, subsequent_position_codec(size - 1)) ::
|
||||
conditional(index == 255, bits)
|
||||
}
|
||||
).xmap[LinkedFields](
|
||||
).exmap[LinkedFields](
|
||||
{
|
||||
case 255 :: _ :: _ :: _ :: HNil =>
|
||||
LinkedFields(255, SquadPositionDetail.Blank, None)
|
||||
Attempt.Successful(LinkedFields(255, SquadPositionDetail.Blank, None))
|
||||
case index :: Some(_ :: entry :: HNil) :: next :: _ :: HNil =>
|
||||
LinkedFields(index, entry, next)
|
||||
Attempt.Successful(LinkedFields(index, entry, next))
|
||||
case data =>
|
||||
Attempt.Failure(Err(s"LinkedFields: unsupported decoding format - $data"))
|
||||
},
|
||||
{
|
||||
case LinkedFields(255, _, _) =>
|
||||
255 :: None :: None :: None :: HNil
|
||||
Attempt.Successful(255 :: None :: None :: None :: HNil)
|
||||
case LinkedFields(index, entry, next) =>
|
||||
index :: Some(true :: entry :: HNil) :: next :: None :: HNil
|
||||
Attempt.Successful(index :: Some(true :: entry :: HNil) :: next :: None :: HNil)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
|
@ -1355,6 +1367,8 @@ object SquadDetailDefinitionUpdateMessage extends Marshallable[SquadDetailDefini
|
|||
{
|
||||
case SquadPositionDetail(Some(closed), Some(role), Some(orders), Some(requirements), Some(char_id), Some(name)) =>
|
||||
Attempt.Successful(6 :: closed :: role :: orders :: char_id :: name :: CertificationType.toEncodedLong(defaultRequirements ++ requirements) :: HNil)
|
||||
case data =>
|
||||
Attempt.Failure(Err(s"can not encode a SquadDetailDefinitionUpdate member's data - $data"))
|
||||
}
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -145,7 +145,7 @@ object PlayerData extends Marshallable[PlayerData] {
|
|||
* @return the number of bits needed to pad it
|
||||
*/
|
||||
def ByteAlignmentPadding(length : Long) : Int = {
|
||||
val pad = (length - math.floor(length / 8) * 8).toInt
|
||||
val pad = (length - math.floor(length.toDouble / 8) * 8).toInt
|
||||
if(pad > 0) {
|
||||
8 - pad
|
||||
}
|
||||
|
|
@ -204,7 +204,7 @@ object PlayerData extends Marshallable[PlayerData] {
|
|||
PlayerData(None, app, data, inv, hand)(false)
|
||||
},
|
||||
{
|
||||
case PlayerData(None, app, data, inv, hand) =>
|
||||
case PlayerData(_, app, data, inv, hand) =>
|
||||
app :: data :: inv :: hand :: false :: HNil
|
||||
}
|
||||
)
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ abstract class SupportActor[A <: SupportActor.Entry] extends Actor {
|
|||
|
||||
def HurrySpecific(targets : List[PlanetSideGameObject], zone : Zone) : Unit
|
||||
|
||||
def HurryAll()
|
||||
def HurryAll() : Unit
|
||||
|
||||
def ClearSpecific(targets : List[PlanetSideGameObject], zone : Zone) : Unit
|
||||
|
||||
|
|
|
|||
|
|
@ -4,21 +4,23 @@ package base
|
|||
import akka.actor.{Actor, ActorRef, ActorSystem, Props}
|
||||
import akka.testkit.{ImplicitSender, TestKit}
|
||||
import com.typesafe.config.ConfigFactory
|
||||
import org.scalatest.{BeforeAndAfterAll, Matchers, WordSpecLike}
|
||||
import org.scalatest.BeforeAndAfterAll
|
||||
import org.scalatest.matchers.should.Matchers
|
||||
import org.scalatest.wordspec.AnyWordSpecLike
|
||||
import org.specs2.specification.Scope
|
||||
|
||||
import scala.collection.mutable
|
||||
import scala.concurrent.duration.FiniteDuration
|
||||
|
||||
abstract class ActorTest(sys : ActorSystem = ActorSystem("system", ConfigFactory.parseMap(ActorTest.LoggingConfig)))
|
||||
extends TestKit(sys) with Scope with ImplicitSender with WordSpecLike with Matchers with BeforeAndAfterAll {
|
||||
override def afterAll {
|
||||
extends TestKit(sys) with Scope with ImplicitSender with AnyWordSpecLike with Matchers with BeforeAndAfterAll {
|
||||
override def afterAll : Unit = {
|
||||
TestKit.shutdownActorSystem(system)
|
||||
}
|
||||
}
|
||||
|
||||
object ActorTest {
|
||||
import scala.collection.JavaConverters._
|
||||
import scala.jdk.CollectionConverters._
|
||||
private val LoggingConfig = Map(
|
||||
"akka.loggers" -> List("akka.testkit.TestEventListener").asJava,
|
||||
"akka.loglevel" -> "OFF",
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ class BuildingControl2Test extends ActorTest {
|
|||
|
||||
"Building Control" should {
|
||||
"convert and assert faction affinity on convert request" in {
|
||||
expectNoMsg(500 milliseconds)
|
||||
expectNoMessage(500 milliseconds)
|
||||
|
||||
assert(bldg.Faction == PlanetSideEmpire.TR)
|
||||
bldg.Actor ! FactionAffinity.ConvertFactionAffinity(PlanetSideEmpire.VS)
|
||||
|
|
@ -164,7 +164,7 @@ class BuildingControl3Test extends ActorTest {
|
|||
|
||||
"Building Control" should {
|
||||
"convert and assert faction affinity on convert request, and for each of its amenities" in {
|
||||
expectNoMsg(500 milliseconds)
|
||||
expectNoMessage(500 milliseconds)
|
||||
|
||||
assert(bldg.Faction == PlanetSideEmpire.TR)
|
||||
assert(bldg.Amenities.length == 2)
|
||||
|
|
|
|||
|
|
@ -262,7 +262,7 @@ class DamageableEntityDamageTest extends ActorTest {
|
|||
Vector3(1,0,0)
|
||||
)
|
||||
val applyDamageTo = resolved.damage_model.Calculate(resolved)
|
||||
expectNoMsg(200 milliseconds)
|
||||
expectNoMessage(200 milliseconds)
|
||||
|
||||
"DamageableEntity" should {
|
||||
"handle taking damage" in {
|
||||
|
|
@ -323,7 +323,7 @@ class DamageableEntityDestroyedTest extends ActorTest {
|
|||
Vector3(1, 0, 0)
|
||||
)
|
||||
val applyDamageTo = resolved.damage_model.Calculate(resolved)
|
||||
expectNoMsg(200 milliseconds)
|
||||
expectNoMessage(200 milliseconds)
|
||||
//we're not testing that the math is correct
|
||||
|
||||
"DamageableEntity" should {
|
||||
|
|
@ -387,7 +387,7 @@ class DamageableEntityNotDestroyTwice extends ActorTest {
|
|||
Vector3(1, 0, 0)
|
||||
)
|
||||
val applyDamageTo = resolved.damage_model.Calculate(resolved)
|
||||
expectNoMsg(200 milliseconds)
|
||||
expectNoMessage(200 milliseconds)
|
||||
//we're not testing that the math is correct
|
||||
|
||||
"DamageableEntity" should {
|
||||
|
|
@ -402,7 +402,7 @@ class DamageableEntityNotDestroyTwice extends ActorTest {
|
|||
|
||||
gen.Actor ! Vitality.Damage(applyDamageTo)
|
||||
avatarProbe.receiveOne(500 milliseconds) //only one message
|
||||
avatarProbe.expectNoMsg(500 milliseconds) //only one message
|
||||
avatarProbe.expectNoMessage(500 milliseconds) //only one message
|
||||
activityProbe.receiveOne(500 milliseconds) //triggers activity hotspot, like it's not a killing blow
|
||||
assert(gen.Health < originalHealth)
|
||||
assert(gen.Destroyed)
|
||||
|
|
@ -448,7 +448,7 @@ class DamageableAmenityTest extends ActorTest {
|
|||
Vector3(1, 0, 0)
|
||||
)
|
||||
val applyDamageTo = resolved.damage_model.Calculate(resolved)
|
||||
expectNoMsg(200 milliseconds)
|
||||
expectNoMessage(200 milliseconds)
|
||||
//we're not testing that the math is correct
|
||||
|
||||
"DamageableAmenity" should {
|
||||
|
|
@ -532,7 +532,7 @@ class DamageableMountableDamageTest extends ActorTest {
|
|||
val applyDamageTo = resolved.damage_model.Calculate(resolved)
|
||||
mech.Seats(0).Occupant = player2 //seat the player
|
||||
player2.VehicleSeated = Some(mech.GUID) //seat the player
|
||||
expectNoMsg(200 milliseconds)
|
||||
expectNoMessage(200 milliseconds)
|
||||
//we're not testing that the math is correct
|
||||
|
||||
"DamageableMountable" should {
|
||||
|
|
@ -612,7 +612,7 @@ class DamageableMountableDestroyTest extends ActorTest {
|
|||
val applyDamageTo = resolved.damage_model.Calculate(resolved)
|
||||
mech.Seats(0).Occupant = player2 //seat the player
|
||||
player2.VehicleSeated = Some(mech.GUID) //seat the player
|
||||
expectNoMsg(200 milliseconds)
|
||||
expectNoMessage(200 milliseconds)
|
||||
//we're not testing that the math is correct
|
||||
|
||||
"DamageableMountable" should {
|
||||
|
|
@ -623,7 +623,7 @@ class DamageableMountableDestroyTest extends ActorTest {
|
|||
|
||||
mech.Actor ! Vitality.Damage(applyDamageTo)
|
||||
val msg12 = avatarProbe.receiveN(2, 500 milliseconds)
|
||||
player1Probe.expectNoMsg(500 milliseconds)
|
||||
player1Probe.expectNoMessage(500 milliseconds)
|
||||
val msg3 = player2Probe.receiveOne(200 milliseconds)
|
||||
assert(
|
||||
msg12.head match {
|
||||
|
|
@ -689,7 +689,7 @@ class DamageableWeaponTurretDamageTest extends ActorTest {
|
|||
Vector3(1, 0, 0)
|
||||
)
|
||||
val applyDamageTo = resolved.damage_model.Calculate(resolved)
|
||||
expectNoMsg(200 milliseconds)
|
||||
expectNoMessage(200 milliseconds)
|
||||
//we're not testing that the math is correct
|
||||
|
||||
"DamageableWeaponTurret" should {
|
||||
|
|
@ -773,7 +773,7 @@ class DamageableWeaponTurretJammerTest extends ActorTest {
|
|||
Vector3(1, 0, 0)
|
||||
)
|
||||
val applyDamageTo = resolved.damage_model.Calculate(resolved)
|
||||
expectNoMsg(200 milliseconds)
|
||||
expectNoMessage(200 milliseconds)
|
||||
//we're not testing that the math is correct
|
||||
|
||||
"DamageableWeaponTurret" should {
|
||||
|
|
@ -867,7 +867,7 @@ class DamageableWeaponTurretDestructionTest extends ActorTest {
|
|||
Vector3(1, 0, 0)
|
||||
)
|
||||
val applyDamageToB = resolvedB.damage_model.Calculate(resolvedB)
|
||||
expectNoMsg(200 milliseconds)
|
||||
expectNoMessage(200 milliseconds)
|
||||
//we're not testing that the math is correct
|
||||
|
||||
"DamageableWeaponTurret" should {
|
||||
|
|
@ -886,7 +886,7 @@ class DamageableWeaponTurretDestructionTest extends ActorTest {
|
|||
|
||||
turret.Actor ! Vitality.Damage(applyDamageToB) //destroy
|
||||
val msg12_4 = avatarProbe.receiveN(3, 500 milliseconds)
|
||||
player1Probe.expectNoMsg(500 milliseconds)
|
||||
player1Probe.expectNoMessage(500 milliseconds)
|
||||
val msg3 = player2Probe.receiveOne(200 milliseconds)
|
||||
val msg56 = vehicleProbe.receiveN(2, 200 milliseconds)
|
||||
assert(
|
||||
|
|
@ -977,7 +977,7 @@ class DamageableVehicleDamageTest extends ActorTest {
|
|||
Vector3(1, 0, 0)
|
||||
)
|
||||
val applyDamageTo = resolved.damage_model.Calculate(resolved)
|
||||
expectNoMsg(200 milliseconds)
|
||||
expectNoMessage(200 milliseconds)
|
||||
//we're not testing that the math is correct
|
||||
|
||||
"DamageableVehicle" should {
|
||||
|
|
@ -1091,7 +1091,7 @@ class DamageableVehicleDamageMountedTest extends ActorTest {
|
|||
Vector3(1, 0, 0)
|
||||
)
|
||||
val applyDamageTo = resolved.damage_model.Calculate(resolved)
|
||||
expectNoMsg(200 milliseconds)
|
||||
expectNoMessage(200 milliseconds)
|
||||
//we're not testing that the math is correct
|
||||
|
||||
"handle damage with mounted vehicles" in {
|
||||
|
|
@ -1217,7 +1217,7 @@ class DamageableVehicleJammeringMountedTest extends ActorTest {
|
|||
Vector3(1, 0, 0)
|
||||
)
|
||||
val applyDamageTo = resolved.damage_model.Calculate(resolved)
|
||||
expectNoMsg(200 milliseconds)
|
||||
expectNoMessage(200 milliseconds)
|
||||
//we're not testing that the math is correct
|
||||
|
||||
"handle jammering with mounted vehicles" in {
|
||||
|
|
@ -1228,10 +1228,10 @@ class DamageableVehicleJammeringMountedTest extends ActorTest {
|
|||
|
||||
lodestar.Actor ! Vitality.Damage(applyDamageTo)
|
||||
val msg12 = vehicleProbe.receiveOne(500 milliseconds)
|
||||
avatarProbe.expectNoMsg(500 milliseconds)
|
||||
player1Probe.expectNoMsg(200 milliseconds)
|
||||
player2Probe.expectNoMsg(200 milliseconds)
|
||||
player3Probe.expectNoMsg(200 milliseconds)
|
||||
avatarProbe.expectNoMessage(500 milliseconds)
|
||||
player1Probe.expectNoMessage(200 milliseconds)
|
||||
player2Probe.expectNoMessage(200 milliseconds)
|
||||
player3Probe.expectNoMessage(200 milliseconds)
|
||||
assert(
|
||||
msg12 match {
|
||||
case VehicleServiceMessage("test", VehicleAction.PlanetsideAttribute(Service.defaultPlayerGUID, PlanetSideGUID(4), 27, 1))=> true
|
||||
|
|
@ -1293,7 +1293,7 @@ class DamageableVehicleDestroyTest extends ActorTest {
|
|||
Vector3(1, 0, 0)
|
||||
)
|
||||
val applyDamageTo = resolved.damage_model.Calculate(resolved)
|
||||
expectNoMsg(200 milliseconds)
|
||||
expectNoMessage(200 milliseconds)
|
||||
//we're not testing that the math is correct
|
||||
|
||||
"DamageableVehicle" should {
|
||||
|
|
@ -1419,7 +1419,7 @@ class DamageableVehicleDestroyMountedTest extends ActorTest {
|
|||
Vector3(1, 0, 0)
|
||||
)
|
||||
val applyDamageToB = resolvedB.damage_model.Calculate(resolvedB)
|
||||
expectNoMsg(200 milliseconds)
|
||||
expectNoMessage(200 milliseconds)
|
||||
//we're not testing that the math is correct
|
||||
|
||||
"handle jammering with mounted vehicles" in {
|
||||
|
|
@ -1435,10 +1435,10 @@ class DamageableVehicleDestroyMountedTest extends ActorTest {
|
|||
|
||||
lodestar.Actor ! Vitality.Damage(applyDamageToA)
|
||||
vehicleProbe.receiveOne(500 milliseconds) //flush jammered message
|
||||
avatarProbe.expectNoMsg(200 milliseconds)
|
||||
player1Probe.expectNoMsg(200 milliseconds)
|
||||
player2Probe.expectNoMsg(200 milliseconds)
|
||||
player3Probe.expectNoMsg(200 milliseconds)
|
||||
avatarProbe.expectNoMessage(200 milliseconds)
|
||||
player1Probe.expectNoMessage(200 milliseconds)
|
||||
player2Probe.expectNoMessage(200 milliseconds)
|
||||
player3Probe.expectNoMessage(200 milliseconds)
|
||||
assert(lodestar.Health > lodestar.Definition.DamageDestroysAt)
|
||||
assert(lodestar.Jammed)
|
||||
assert(!lodestar.Destroyed)
|
||||
|
|
@ -1449,13 +1449,13 @@ class DamageableVehicleDestroyMountedTest extends ActorTest {
|
|||
|
||||
lodestar.Actor ! Vitality.Damage(applyDamageToB)
|
||||
val msg_avatar = avatarProbe.receiveN(5, 500 milliseconds)
|
||||
avatarProbe.expectNoMsg(10 milliseconds)
|
||||
avatarProbe.expectNoMessage(10 milliseconds)
|
||||
val msg_player2 = player2Probe.receiveOne(200 milliseconds)
|
||||
player2Probe.expectNoMsg(10 milliseconds)
|
||||
player2Probe.expectNoMessage(10 milliseconds)
|
||||
val msg_player3 = player3Probe.receiveOne(200 milliseconds)
|
||||
player3Probe.expectNoMsg(10 milliseconds)
|
||||
player3Probe.expectNoMessage(10 milliseconds)
|
||||
val msg_vehicle = vehicleProbe.receiveN(2, 200 milliseconds)
|
||||
vehicleProbe.expectNoMsg(10 milliseconds)
|
||||
vehicleProbe.expectNoMessage(10 milliseconds)
|
||||
assert(
|
||||
msg_avatar.exists( {
|
||||
case AvatarServiceMessage("test", AvatarAction.PlanetsideAttributeToAll(PlanetSideGUID(4), 0, _)) => true
|
||||
|
|
|
|||
|
|
@ -342,7 +342,7 @@ class ExplosiveDeployableJammerTest extends ActorTest {
|
|||
j_mine.Actor ! Vitality.Damage(applyDamageToJ)
|
||||
val msg_local = localProbe.receiveN(4, 200 milliseconds)
|
||||
val msg_avatar = avatarProbe.receiveOne(200 milliseconds)
|
||||
activityProbe.expectNoMsg(200 milliseconds)
|
||||
activityProbe.expectNoMessage(200 milliseconds)
|
||||
assert(
|
||||
msg_local.head match {
|
||||
case LocalServiceMessage("TestCharacter2", LocalAction.AlertDestroyDeployable(PlanetSideGUID(0), target)) => target eq j_mine
|
||||
|
|
@ -532,7 +532,7 @@ class ExplosiveDeployableDestructionTest extends ActorTest {
|
|||
h_mine.Actor ! Vitality.Damage(applyDamageTo)
|
||||
val msg_local = localProbe.receiveN(5, 200 milliseconds)
|
||||
val msg_avatar = avatarProbe.receiveOne(200 milliseconds)
|
||||
activityProbe.expectNoMsg(200 milliseconds)
|
||||
activityProbe.expectNoMessage(200 milliseconds)
|
||||
assert(
|
||||
msg_local.head match {
|
||||
case LocalServiceMessage("TestCharacter2", LocalAction.AlertDestroyDeployable(PlanetSideGUID(0), target)) => target eq h_mine
|
||||
|
|
@ -595,7 +595,7 @@ class TurretControlInitializeTest extends ActorTest {
|
|||
assert(obj.Actor == ActorRef.noSender)
|
||||
val init = system.actorOf(Props(classOf[DeployableTest.TurretInitializer], obj), "init_turret_test")
|
||||
init ! "initialize"
|
||||
expectNoMsg(200 milliseconds)
|
||||
expectNoMessage(200 milliseconds)
|
||||
assert(obj.Actor != ActorRef.noSender)
|
||||
}
|
||||
}
|
||||
|
|
@ -608,11 +608,11 @@ class TurretControlUninitializeTest extends ActorTest {
|
|||
val init = system.actorOf(Props(classOf[DeployableTest.TurretInitializer], obj), "init_turret_test")
|
||||
obj.GUID = PlanetSideGUID(1)
|
||||
init ! "initialize"
|
||||
expectNoMsg(200 milliseconds)
|
||||
expectNoMessage(200 milliseconds)
|
||||
assert(obj.Actor != ActorRef.noSender)
|
||||
|
||||
init ! "uninitialize"
|
||||
expectNoMsg(200 milliseconds)
|
||||
expectNoMessage(200 milliseconds)
|
||||
assert(obj.Actor == ActorRef.noSender)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ class GeneratorControlDamageTest extends ActorTest {
|
|||
Vector3(1, 0, 0)
|
||||
)
|
||||
val applyDamageTo = resolved.damage_model.Calculate(resolved)
|
||||
expectNoMsg(200 milliseconds)
|
||||
expectNoMessage(200 milliseconds)
|
||||
//we're not testing that the math is correct
|
||||
|
||||
"GeneratorControl" should {
|
||||
|
|
@ -96,7 +96,7 @@ class GeneratorControlDamageTest extends ActorTest {
|
|||
|
||||
gen.Actor ! Vitality.Damage(applyDamageTo)
|
||||
val msg_avatar = avatarProbe.receiveN(2, 500 milliseconds)
|
||||
buildingProbe.expectNoMsg(200 milliseconds)
|
||||
buildingProbe.expectNoMessage(200 milliseconds)
|
||||
assert(
|
||||
msg_avatar.head match {
|
||||
case AvatarServiceMessage("test", AvatarAction.PlanetsideAttributeToAll(PlanetSideGUID(2), 0, _)) => true
|
||||
|
|
@ -158,7 +158,7 @@ class GeneratorControlCriticalTest extends ActorTest {
|
|||
)
|
||||
val applyDamageTo = resolved.damage_model.Calculate(resolved)
|
||||
val halfHealth = gen.Definition.MaxHealth / 2
|
||||
expectNoMsg(200 milliseconds)
|
||||
expectNoMessage(200 milliseconds)
|
||||
//we're not testing that the math is correct
|
||||
|
||||
"GeneratorControl" should {
|
||||
|
|
@ -238,7 +238,7 @@ class GeneratorControlDestroyedTest extends ActorTest {
|
|||
Vector3(1, 0, 0)
|
||||
)
|
||||
val applyDamageTo = resolved.damage_model.Calculate(resolved)
|
||||
expectNoMsg(200 milliseconds)
|
||||
expectNoMessage(200 milliseconds)
|
||||
//we're not testing that the math is correct
|
||||
|
||||
"GeneratorControl" should {
|
||||
|
|
@ -250,7 +250,7 @@ class GeneratorControlDestroyedTest extends ActorTest {
|
|||
|
||||
gen.Actor ! Vitality.Damage(applyDamageTo)
|
||||
val msg_avatar1 = avatarProbe.receiveOne(500 milliseconds)
|
||||
buildingProbe.expectNoMsg(200 milliseconds)
|
||||
buildingProbe.expectNoMessage(200 milliseconds)
|
||||
assert(
|
||||
msg_avatar1 match {
|
||||
case AvatarServiceMessage("TestCharacter1", AvatarAction.GenericObjectAction(_, PlanetSideGUID(1), 16)) => true
|
||||
|
|
@ -261,8 +261,8 @@ class GeneratorControlDestroyedTest extends ActorTest {
|
|||
assert(!gen.Destroyed)
|
||||
assert(gen.Condition == PlanetSideGeneratorState.Normal)
|
||||
|
||||
avatarProbe.expectNoMsg(9 seconds)
|
||||
buildingProbe.expectNoMsg(50 milliseconds) //no prior messages
|
||||
avatarProbe.expectNoMessage(9 seconds)
|
||||
buildingProbe.expectNoMessage(50 milliseconds) //no prior messages
|
||||
val msg_avatar2 = avatarProbe.receiveN(3, 1000 milliseconds) //see DamageableEntity test file
|
||||
val msg_building = buildingProbe.receiveOne(200 milliseconds)
|
||||
assert(
|
||||
|
|
@ -356,7 +356,7 @@ class GeneratorControlKillsTest extends ActorTest {
|
|||
Vector3(1, 0, 0)
|
||||
)
|
||||
val applyDamageTo = resolved.damage_model.Calculate(resolved)
|
||||
expectNoMsg(200 milliseconds)
|
||||
expectNoMessage(200 milliseconds)
|
||||
//we're not testing that the math is correct
|
||||
|
||||
"GeneratorControl" should {
|
||||
|
|
@ -368,9 +368,9 @@ class GeneratorControlKillsTest extends ActorTest {
|
|||
|
||||
gen.Actor ! Vitality.Damage(applyDamageTo)
|
||||
val msg_avatar1 = avatarProbe.receiveN(2, 500 milliseconds)
|
||||
buildingProbe.expectNoMsg(200 milliseconds)
|
||||
player1Probe.expectNoMsg(200 milliseconds)
|
||||
player2Probe.expectNoMsg(200 milliseconds)
|
||||
buildingProbe.expectNoMessage(200 milliseconds)
|
||||
player1Probe.expectNoMessage(200 milliseconds)
|
||||
player2Probe.expectNoMessage(200 milliseconds)
|
||||
assert(
|
||||
msg_avatar1.head match {
|
||||
case AvatarServiceMessage("TestCharacter1", AvatarAction.GenericObjectAction(_, PlanetSideGUID(1), 16)) => true
|
||||
|
|
@ -390,7 +390,7 @@ class GeneratorControlKillsTest extends ActorTest {
|
|||
val msg_building = buildingProbe.receiveOne(10500 milliseconds)
|
||||
val msg_avatar2 = avatarProbe.receiveN(3, 200 milliseconds)
|
||||
val msg_player1 = player1Probe.receiveOne(100 milliseconds)
|
||||
player2Probe.expectNoMsg(200 milliseconds)
|
||||
player2Probe.expectNoMessage(200 milliseconds)
|
||||
assert(
|
||||
msg_building match {
|
||||
case Building.AmenityStateChange(o) => o eq gen
|
||||
|
|
@ -465,7 +465,7 @@ class GeneratorControlNotDestroyTwice extends ActorTest {
|
|||
Vector3(1, 0, 0)
|
||||
)
|
||||
val applyDamageTo = resolved.damage_model.Calculate(resolved)
|
||||
expectNoMsg(200 milliseconds)
|
||||
expectNoMessage(200 milliseconds)
|
||||
//we're not testing that the math is correct
|
||||
|
||||
"GeneratorControl" should {
|
||||
|
|
@ -480,9 +480,9 @@ class GeneratorControlNotDestroyTwice extends ActorTest {
|
|||
assert(originalHealth > gen.Definition.DamageDestroysAt)
|
||||
|
||||
gen.Actor ! Vitality.Damage(applyDamageTo)
|
||||
avatarProbe.expectNoMsg(500 milliseconds)
|
||||
avatarProbe.expectNoMessage(500 milliseconds)
|
||||
activityProbe.receiveOne(500 milliseconds)
|
||||
buildingProbe.expectNoMsg(1000 milliseconds)
|
||||
buildingProbe.expectNoMessage(1000 milliseconds)
|
||||
assert(gen.Health < originalHealth)
|
||||
assert(gen.Destroyed)
|
||||
assert(originalHealth < gen.Definition.DefaultHealth)
|
||||
|
|
@ -494,9 +494,9 @@ class GeneratorControlNotDestroyTwice extends ActorTest {
|
|||
assert(gen.Health == 1)
|
||||
assert(gen.Destroyed)
|
||||
gen.Actor ! Vitality.Damage(applyDamageTo)
|
||||
avatarProbe.expectNoMsg(500 milliseconds)
|
||||
avatarProbe.expectNoMessage(500 milliseconds)
|
||||
activityProbe.receiveOne(500 milliseconds) //activity alert occurs because this was not a kill shot
|
||||
buildingProbe.expectNoMsg(1000 milliseconds)
|
||||
buildingProbe.expectNoMessage(1000 milliseconds)
|
||||
assert(gen.Health == 0)
|
||||
assert(gen.Destroyed)
|
||||
}
|
||||
|
|
@ -546,7 +546,7 @@ class GeneratorControlNotDamageIfExplodingTest extends ActorTest {
|
|||
Vector3(1, 0, 0)
|
||||
)
|
||||
val applyDamageTo = resolved.damage_model.Calculate(resolved)
|
||||
expectNoMsg(200 milliseconds)
|
||||
expectNoMessage(200 milliseconds)
|
||||
//we're not testing that the math is correct
|
||||
|
||||
"GeneratorControl" should {
|
||||
|
|
@ -558,8 +558,8 @@ class GeneratorControlNotDamageIfExplodingTest extends ActorTest {
|
|||
|
||||
gen.Actor ! Vitality.Damage(applyDamageTo)
|
||||
val msg_avatar = avatarProbe.receiveOne(500 milliseconds)
|
||||
buildingProbe.expectNoMsg(200 milliseconds)
|
||||
player1Probe.expectNoMsg(200 milliseconds)
|
||||
buildingProbe.expectNoMessage(200 milliseconds)
|
||||
player1Probe.expectNoMessage(200 milliseconds)
|
||||
assert(
|
||||
msg_avatar match {
|
||||
case AvatarServiceMessage("TestCharacter1", AvatarAction.GenericObjectAction(_, PlanetSideGUID(1), 16)) => true
|
||||
|
|
@ -573,15 +573,15 @@ class GeneratorControlNotDamageIfExplodingTest extends ActorTest {
|
|||
|
||||
//once
|
||||
gen.Actor ! Vitality.Damage(applyDamageTo)
|
||||
avatarProbe.expectNoMsg(500 milliseconds)
|
||||
buildingProbe.expectNoMsg(200 milliseconds)
|
||||
player1Probe.expectNoMsg(200 milliseconds)
|
||||
avatarProbe.expectNoMessage(500 milliseconds)
|
||||
buildingProbe.expectNoMessage(200 milliseconds)
|
||||
player1Probe.expectNoMessage(200 milliseconds)
|
||||
assert(gen.Health == 1)
|
||||
//twice
|
||||
gen.Actor ! Vitality.Damage(applyDamageTo)
|
||||
avatarProbe.expectNoMsg(500 milliseconds)
|
||||
buildingProbe.expectNoMsg(200 milliseconds)
|
||||
player1Probe.expectNoMsg(200 milliseconds)
|
||||
avatarProbe.expectNoMessage(500 milliseconds)
|
||||
buildingProbe.expectNoMessage(200 milliseconds)
|
||||
player1Probe.expectNoMessage(200 milliseconds)
|
||||
assert(gen.Health == 1)
|
||||
}
|
||||
}
|
||||
|
|
@ -634,7 +634,7 @@ class GeneratorControlNotRepairIfExplodingTest extends ActorTest {
|
|||
val tool = Tool(GlobalDefinitions.nano_dispenser) //4 & 5
|
||||
guid.register(tool, 4)
|
||||
guid.register(tool.AmmoSlot.Box, 5)
|
||||
expectNoMsg(200 milliseconds)
|
||||
expectNoMessage(200 milliseconds)
|
||||
//we're not testing that the math is correct
|
||||
|
||||
"GeneratorControl" should {
|
||||
|
|
@ -646,8 +646,8 @@ class GeneratorControlNotRepairIfExplodingTest extends ActorTest {
|
|||
|
||||
gen.Actor ! Vitality.Damage(applyDamageTo)
|
||||
val msg_avatar1 = avatarProbe.receiveOne(500 milliseconds)
|
||||
buildingProbe.expectNoMsg(200 milliseconds)
|
||||
player1Probe.expectNoMsg(200 milliseconds)
|
||||
buildingProbe.expectNoMessage(200 milliseconds)
|
||||
player1Probe.expectNoMessage(200 milliseconds)
|
||||
assert(
|
||||
msg_avatar1 match {
|
||||
case AvatarServiceMessage("TestCharacter1", AvatarAction.GenericObjectAction(_, PlanetSideGUID(1), 16)) => true
|
||||
|
|
@ -661,15 +661,15 @@ class GeneratorControlNotRepairIfExplodingTest extends ActorTest {
|
|||
|
||||
//once
|
||||
gen.Actor ! CommonMessages.Use(player1, Some(tool)) //repair?
|
||||
avatarProbe.expectNoMsg(1000 milliseconds) //no messages
|
||||
buildingProbe.expectNoMsg(200 milliseconds)
|
||||
player1Probe.expectNoMsg(200 milliseconds)
|
||||
avatarProbe.expectNoMessage(1000 milliseconds) //no messages
|
||||
buildingProbe.expectNoMessage(200 milliseconds)
|
||||
player1Probe.expectNoMessage(200 milliseconds)
|
||||
assert(gen.Health == 1)
|
||||
//twice
|
||||
gen.Actor ! CommonMessages.Use(player1, Some(tool)) //repair?
|
||||
avatarProbe.expectNoMsg(1000 milliseconds) //no messages
|
||||
buildingProbe.expectNoMsg(200 milliseconds)
|
||||
player1Probe.expectNoMsg(200 milliseconds)
|
||||
avatarProbe.expectNoMessage(1000 milliseconds) //no messages
|
||||
buildingProbe.expectNoMessage(200 milliseconds)
|
||||
player1Probe.expectNoMessage(200 milliseconds)
|
||||
assert(gen.Health == 1)
|
||||
}
|
||||
}
|
||||
|
|
@ -711,7 +711,7 @@ class GeneratorControlRepairPastRestorePoint extends ActorTest {
|
|||
guid.register(player1, 3)
|
||||
guid.register(tool, 4)
|
||||
guid.register(tool.AmmoSlot.Box, 5)
|
||||
expectNoMsg(200 milliseconds)
|
||||
expectNoMessage(200 milliseconds)
|
||||
//we're not testing that the math is correct
|
||||
|
||||
"GeneratorControl" should {
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ class PlayerControlHealTest extends ActorTest {
|
|||
|
||||
player1.Position = Vector3(10,0,0) //moved more than 5m away
|
||||
player2.Actor ! CommonMessages.Use(player1, Some(tool))
|
||||
avatarProbe.expectNoMsg(500 milliseconds)
|
||||
avatarProbe.expectNoMessage(500 milliseconds)
|
||||
assert(raisedHealth == player2.Health)
|
||||
}
|
||||
}
|
||||
|
|
@ -224,7 +224,7 @@ class PlayerControlRepairTest extends ActorTest {
|
|||
val fixedArmor = player2.Armor
|
||||
player1.Position = Vector3(10,0,0) //moved more than 5m away
|
||||
player2.Actor ! CommonMessages.Use(player1, Some(tool))
|
||||
avatarProbe.expectNoMsg(500 milliseconds)
|
||||
avatarProbe.expectNoMessage(500 milliseconds)
|
||||
assert(fixedArmor == player2.Armor)
|
||||
}
|
||||
}
|
||||
|
|
@ -329,7 +329,7 @@ class PlayerControlDamageTest extends ActorTest {
|
|||
guid.register(player2, 2)
|
||||
guid.register(tool, 3)
|
||||
guid.register(tool.AmmoSlot.Box, 4)
|
||||
expectNoMsg(200 milliseconds)
|
||||
expectNoMessage(200 milliseconds)
|
||||
"PlayerControl" should {
|
||||
"handle damage" in {
|
||||
assert(player2.Health == player2.Definition.DefaultHealth)
|
||||
|
|
@ -406,7 +406,7 @@ class PlayerControlDeathStandingTest extends ActorTest {
|
|||
guid.register(player2, 2)
|
||||
guid.register(tool, 3)
|
||||
guid.register(tool.AmmoSlot.Box, 4)
|
||||
expectNoMsg(200 milliseconds)
|
||||
expectNoMessage(200 milliseconds)
|
||||
|
||||
"PlayerControl" should {
|
||||
"handle death" in {
|
||||
|
|
@ -421,7 +421,7 @@ class PlayerControlDeathStandingTest extends ActorTest {
|
|||
|
||||
player2.Actor ! Vitality.Damage(applyDamageTo)
|
||||
val msg_avatar = avatarProbe.receiveN(8, 500 milliseconds)
|
||||
activityProbe.expectNoMsg(200 milliseconds)
|
||||
activityProbe.expectNoMessage(200 milliseconds)
|
||||
assert(
|
||||
msg_avatar.head match {
|
||||
case AvatarServiceMessage("test", AvatarAction.PlanetsideAttributeToAll(PlanetSideGUID(2), 4, _)) => true
|
||||
|
|
@ -518,7 +518,7 @@ class PlayerControlDeathSeatedTest extends ActorTest {
|
|||
guid.register(tool, 3)
|
||||
guid.register(tool.AmmoSlot.Box, 4)
|
||||
guid.register(vehicle, 5)
|
||||
expectNoMsg(200 milliseconds)
|
||||
expectNoMessage(200 milliseconds)
|
||||
|
||||
"PlayerControl" should {
|
||||
"handle death when seated (in something)" in {
|
||||
|
|
@ -531,7 +531,7 @@ class PlayerControlDeathSeatedTest extends ActorTest {
|
|||
|
||||
player2.Actor ! Vitality.Damage(applyDamageTo)
|
||||
val msg_avatar = avatarProbe.receiveN(9, 500 milliseconds)
|
||||
activityProbe.expectNoMsg(200 milliseconds)
|
||||
activityProbe.expectNoMessage(200 milliseconds)
|
||||
assert(
|
||||
msg_avatar.head match {
|
||||
case AvatarServiceMessage("TestCharacter2", AvatarAction.Killed(PlanetSideGUID(2))) => true
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ class RepairableEntityRepairTest extends ActorTest {
|
|||
val tool = Tool(GlobalDefinitions.nano_dispenser) //4 & 5
|
||||
guid.register(tool, 4)
|
||||
guid.register(tool.AmmoSlot.Box, 5)
|
||||
expectNoMsg(200 milliseconds)
|
||||
expectNoMessage(200 milliseconds)
|
||||
//we're not testing that the math is correct
|
||||
|
||||
"RepairableEntity" should {
|
||||
|
|
@ -115,14 +115,14 @@ class RepairableEntityNotRepairTest extends ActorTest {
|
|||
val tool = Tool(GlobalDefinitions.nano_dispenser) //4 & 5
|
||||
guid.register(tool, 4)
|
||||
guid.register(tool.AmmoSlot.Box, 5)
|
||||
expectNoMsg(200 milliseconds)
|
||||
expectNoMessage(200 milliseconds)
|
||||
//we're not testing that the math is correct
|
||||
|
||||
"RepairableEntity" should {
|
||||
"not repair if health is already full" in {
|
||||
assert(gen.Health == gen.Definition.DefaultHealth) //ideal
|
||||
gen.Actor ! CommonMessages.Use(player1, Some(tool)) //repair?
|
||||
avatarProbe.expectNoMsg(1000 milliseconds) //no messages
|
||||
avatarProbe.expectNoMessage(1000 milliseconds) //no messages
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -155,7 +155,7 @@ class RepairableAmenityTest extends ActorTest {
|
|||
val tool = Tool(GlobalDefinitions.nano_dispenser) //4 & 5
|
||||
guid.register(tool, 4)
|
||||
guid.register(tool.AmmoSlot.Box, 5)
|
||||
expectNoMsg(200 milliseconds)
|
||||
expectNoMessage(200 milliseconds)
|
||||
//we're not testing that the math is correct
|
||||
|
||||
"RepairableAmenity" should {
|
||||
|
|
@ -390,7 +390,7 @@ class RepairableVehicleRestoration extends ActorTest {
|
|||
assert(atv.Destroyed)
|
||||
|
||||
atv.Actor ! CommonMessages.Use(player1, Some(tool))
|
||||
avatarProbe.expectNoMsg(500 milliseconds)
|
||||
avatarProbe.expectNoMessage(500 milliseconds)
|
||||
assert(atv.Health == 0) //set to zero explicitly
|
||||
assert(atv.Destroyed)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,9 +69,9 @@ class ResourceSiloControlStartupTest extends ActorTest {
|
|||
|
||||
"Resource silo" should {
|
||||
"startup properly" in {
|
||||
expectNoMsg(500 milliseconds)
|
||||
expectNoMessage(500 milliseconds)
|
||||
system.actorOf(Props(classOf[ResourceSiloControl], obj), "test-silo")
|
||||
expectNoMsg(1 seconds)
|
||||
expectNoMessage(1 seconds)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -99,16 +99,16 @@ class ResourceSiloControlUseTest extends ActorTest {
|
|||
guid.register(obj, 2)
|
||||
guid.register(player, 3)
|
||||
guid.register(vehicle, 4)
|
||||
expectNoMsg(200 milliseconds)
|
||||
expectNoMessage(200 milliseconds)
|
||||
zone.Transport ! Zone.Vehicle.Spawn(vehicle)
|
||||
vehicle.Seats(0).Occupant = player
|
||||
player.VehicleSeated = vehicle.GUID
|
||||
val msg = UseItemMessage(PlanetSideGUID(1), PlanetSideGUID(0), PlanetSideGUID(2), 0L, false, Vector3.Zero,Vector3.Zero,0,0,0,0L) //faked
|
||||
expectNoMsg(200 milliseconds)
|
||||
expectNoMessage(200 milliseconds)
|
||||
|
||||
"Resource silo" should {
|
||||
"respond when being used" in {
|
||||
expectNoMsg(1 seconds)
|
||||
expectNoMessage(1 seconds)
|
||||
obj.Actor ! ResourceSilo.Use(ResourceSiloTest.player, msg)
|
||||
|
||||
val reply = receiveOne(500 milliseconds)
|
||||
|
|
@ -299,9 +299,9 @@ class ResourceSiloControlNoUpdateTest extends ActorTest {
|
|||
assert(!obj.LowNtuWarningOn)
|
||||
obj.Actor ! ResourceSilo.UpdateChargeLevel(50)
|
||||
|
||||
expectNoMsg(500 milliseconds)
|
||||
zoneEvents.expectNoMsg(500 milliseconds)
|
||||
buildingEvents.expectNoMsg(500 milliseconds)
|
||||
expectNoMessage(500 milliseconds)
|
||||
zoneEvents.expectNoMessage(500 milliseconds)
|
||||
buildingEvents.expectNoMessage(500 milliseconds)
|
||||
assert(obj.ChargeLevel == 299 || obj.ChargeLevel == 300) // Just in case the capacitor level drops while waiting for the message check 299 & 300
|
||||
assert(obj.CapacitorDisplay == 3)
|
||||
assert(!obj.LowNtuWarningOn)
|
||||
|
|
|
|||
|
|
@ -330,7 +330,7 @@ class VehicleControlPrepareForDeletionTest extends ActorTest {
|
|||
}
|
||||
|
||||
vehicle.GUID = PlanetSideGUID(1)
|
||||
expectNoMsg(200 milliseconds)
|
||||
expectNoMessage(200 milliseconds)
|
||||
|
||||
"VehicleControl" should {
|
||||
"submit for unregistering when marked for deconstruction" in {
|
||||
|
|
@ -369,7 +369,7 @@ class VehicleControlPrepareForDeletionPassengerTest extends ActorTest {
|
|||
player1.GUID = PlanetSideGUID(2)
|
||||
vehicle.Seats(1).Occupant = player1 //passenger seat
|
||||
player1.VehicleSeated = vehicle.GUID
|
||||
expectNoMsg(200 milliseconds)
|
||||
expectNoMessage(200 milliseconds)
|
||||
|
||||
"VehicleControl" should {
|
||||
"kick all players when marked for deconstruction" in {
|
||||
|
|
@ -431,7 +431,7 @@ class VehicleControlPrepareForDeletionMountedInTest extends FreedContextActorTes
|
|||
val vehicleProbe = new TestProbe(system)
|
||||
zone.VehicleEvents = vehicleProbe.ref
|
||||
zone.Transport ! Zone.Vehicle.Spawn(lodestar) //can not fake this
|
||||
expectNoMsg(200 milliseconds)
|
||||
expectNoMessage(200 milliseconds)
|
||||
|
||||
"VehicleControl" should {
|
||||
"if mounted as cargo, self-eject when marked for deconstruction" in {
|
||||
|
|
@ -534,7 +534,7 @@ class VehicleControlPrepareForDeletionMountedCargoTest extends FreedContextActor
|
|||
val vehicleProbe = new TestProbe(system)
|
||||
zone.VehicleEvents = vehicleProbe.ref
|
||||
zone.Transport ! Zone.Vehicle.Spawn(lodestar) //can not fake this
|
||||
expectNoMsg(200 milliseconds)
|
||||
expectNoMessage(200 milliseconds)
|
||||
|
||||
"VehicleControl" should {
|
||||
"if with mounted cargo, eject it when marked for deconstruction" in {
|
||||
|
|
@ -865,7 +865,7 @@ class VehicleControlShieldsNotChargingVehicleDeadTest extends ActorTest {
|
|||
assert(!vehicle.History.exists({p => p.isInstanceOf[VehicleShieldCharge]}))
|
||||
vehicle.Actor.tell(Vehicle.ChargeShields(15), probe.ref)
|
||||
|
||||
probe.expectNoMsg(1 seconds)
|
||||
probe.expectNoMessage(1 seconds)
|
||||
assert(vehicle.Shields == 0)
|
||||
assert(!vehicle.History.exists({p => p.isInstanceOf[VehicleShieldCharge]}))
|
||||
}
|
||||
|
|
@ -887,7 +887,7 @@ class VehicleControlShieldsNotChargingVehicleShieldsFullTest extends ActorTest {
|
|||
assert(!vehicle.History.exists({p => p.isInstanceOf[VehicleShieldCharge]}))
|
||||
vehicle.Actor ! Vehicle.ChargeShields(15)
|
||||
|
||||
probe.expectNoMsg(1 seconds)
|
||||
probe.expectNoMessage(1 seconds)
|
||||
assert(!vehicle.History.exists({p => p.isInstanceOf[VehicleShieldCharge]}))
|
||||
}
|
||||
}
|
||||
|
|
@ -914,7 +914,7 @@ class VehicleControlShieldsNotChargingTooEarlyTest extends ActorTest {
|
|||
assert(vehicle.Shields == 15)
|
||||
|
||||
vehicle.Actor ! Vehicle.ChargeShields(15)
|
||||
probe.expectNoMsg(200 milliseconds)
|
||||
probe.expectNoMessage(200 milliseconds)
|
||||
assert(vehicle.Shields == 15)
|
||||
}
|
||||
}
|
||||
|
|
@ -944,7 +944,7 @@ class VehicleControlShieldsNotChargingTooEarlyTest extends ActorTest {
|
|||
// assert(vehicle.Shields == 0)
|
||||
// vehicle.Actor.tell(Vehicle.ChargeShields(15), probe.ref)
|
||||
//
|
||||
// probe.expectNoMsg(200 milliseconds)
|
||||
// probe.expectNoMessage(200 milliseconds)
|
||||
// assert(vehicle.Shields == 0)
|
||||
// }
|
||||
//}
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ class ZoneActorTest extends ActorTest {
|
|||
"have an Actor" in {
|
||||
val zone = new Zone("test", new ZoneMap("map6"), 1) { override def SetupNumberPools() = { } }
|
||||
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), "test-actor")
|
||||
expectNoMsg(Duration.create(100, "ms"))
|
||||
expectNoMessage(Duration.create(100, "ms"))
|
||||
assert(zone.Actor != ActorRef.noSender)
|
||||
}
|
||||
|
||||
|
|
@ -152,7 +152,7 @@ class ZoneActorTest extends ActorTest {
|
|||
zone.GUID(new NumberPoolHub(new LimitedNumberSource(40150)))
|
||||
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), "test-add-pool-actor-init")
|
||||
zone.Actor ! Zone.Init()
|
||||
expectNoMsg(Duration.create(500, "ms"))
|
||||
expectNoMessage(Duration.create(500, "ms"))
|
||||
|
||||
assert( !zone.AddPool("test1", 1 to 2) )
|
||||
}
|
||||
|
|
@ -164,7 +164,7 @@ class ZoneActorTest extends ActorTest {
|
|||
zone.AddPool("test", 1 to 2)
|
||||
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), "test-remove-pool-actor-init")
|
||||
zone.Actor ! Zone.Init()
|
||||
expectNoMsg(Duration.create(300, "ms"))
|
||||
expectNoMessage(Duration.create(300, "ms"))
|
||||
|
||||
assert( !zone.RemovePool("test") )
|
||||
}
|
||||
|
|
@ -194,7 +194,7 @@ class ZoneActorTest extends ActorTest {
|
|||
val zone = new Zone("test", map6, 1) { override def SetupNumberPools() = { } }
|
||||
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), "test-init")
|
||||
zone.Actor ! Zone.Init()
|
||||
expectNoMsg(Duration.create(1, "seconds"))
|
||||
expectNoMessage(Duration.create(1, "seconds"))
|
||||
|
||||
val groups = zone.SpawnGroups()
|
||||
assert(groups.size == 2)
|
||||
|
|
@ -232,7 +232,7 @@ class ZoneActorTest extends ActorTest {
|
|||
val zone = new Zone("test", map6, 1) { override def SetupNumberPools() = { } }
|
||||
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), "test-spawn")
|
||||
zone.Actor ! Zone.Init()
|
||||
expectNoMsg(Duration.create(1, "seconds"))
|
||||
expectNoMessage(Duration.create(1, "seconds"))
|
||||
val player = Player(Avatar("Chord", PlanetSideEmpire.NEUTRAL, CharacterGender.Male, 0, CharacterVoice.Voice5))
|
||||
|
||||
val bldg1 = zone.Building(1).get
|
||||
|
|
@ -263,7 +263,7 @@ class ZoneActorTest extends ActorTest {
|
|||
val zone = new Zone("test", map6, 1) { override def SetupNumberPools() = { } }
|
||||
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), "test-no-spawn")
|
||||
zone.Actor ! Zone.Init()
|
||||
expectNoMsg(Duration.create(300, "ms"))
|
||||
expectNoMessage(Duration.create(300, "ms"))
|
||||
val player = Player(Avatar("Chord", PlanetSideEmpire.NEUTRAL, CharacterGender.Male, 0, CharacterVoice.Voice5))
|
||||
|
||||
zone.Actor ! Zone.Lattice.RequestSpawnPoint(1, player, 7)
|
||||
|
|
@ -282,12 +282,12 @@ class ZonePopulationTest extends ActorTest {
|
|||
val avatar = Avatar("Chord", PlanetSideEmpire.TR, CharacterGender.Male, 0, CharacterVoice.Voice5)
|
||||
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), ZoneTest.TestName)
|
||||
zone.Actor ! Zone.Init()
|
||||
expectNoMsg(200 milliseconds)
|
||||
expectNoMessage(200 milliseconds)
|
||||
|
||||
assert(zone.Players.isEmpty)
|
||||
assert(zone.LivePlayers.isEmpty)
|
||||
zone.Population ! Zone.Population.Join(avatar)
|
||||
expectNoMsg(Duration.create(100, "ms"))
|
||||
expectNoMessage(Duration.create(100, "ms"))
|
||||
assert(zone.Players.size == 1)
|
||||
assert(zone.Players.head == avatar)
|
||||
assert(zone.LivePlayers.isEmpty)
|
||||
|
|
@ -300,12 +300,12 @@ class ZonePopulationTest extends ActorTest {
|
|||
zone.Actor ! Zone.Init()
|
||||
receiveOne(Duration.create(200, "ms")) //consume
|
||||
zone.Population ! Zone.Population.Join(avatar)
|
||||
expectNoMsg(Duration.create(100, "ms"))
|
||||
expectNoMessage(Duration.create(100, "ms"))
|
||||
|
||||
assert(zone.Players.size == 1)
|
||||
assert(zone.Players.head == avatar)
|
||||
zone.Population ! Zone.Population.Leave(avatar)
|
||||
expectNoMsg(Duration.create(100, "ms"))
|
||||
expectNoMessage(Duration.create(100, "ms"))
|
||||
assert(zone.Players.isEmpty)
|
||||
}
|
||||
|
||||
|
|
@ -315,15 +315,15 @@ class ZonePopulationTest extends ActorTest {
|
|||
val player = Player(avatar)
|
||||
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), ZoneTest.TestName)
|
||||
zone.Actor ! Zone.Init()
|
||||
expectNoMsg(200 milliseconds)
|
||||
expectNoMessage(200 milliseconds)
|
||||
zone.Population ! Zone.Population.Join(avatar)
|
||||
expectNoMsg(Duration.create(100, "ms"))
|
||||
expectNoMessage(Duration.create(100, "ms"))
|
||||
|
||||
assert(zone.Players.size == 1)
|
||||
assert(zone.Players.head == avatar)
|
||||
assert(zone.LivePlayers.isEmpty)
|
||||
zone.Population ! Zone.Population.Spawn(avatar, player)
|
||||
expectNoMsg(Duration.create(100, "ms"))
|
||||
expectNoMessage(Duration.create(100, "ms"))
|
||||
assert(zone.Players.size == 1)
|
||||
assert(zone.Players.head == avatar)
|
||||
assert(zone.LivePlayers.size == 1)
|
||||
|
|
@ -336,18 +336,18 @@ class ZonePopulationTest extends ActorTest {
|
|||
val player = Player(avatar)
|
||||
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), ZoneTest.TestName)
|
||||
zone.Actor ! Zone.Init()
|
||||
expectNoMsg(200 milliseconds)
|
||||
expectNoMessage(200 milliseconds)
|
||||
zone.Population ! Zone.Population.Join(avatar)
|
||||
expectNoMsg(Duration.create(100, "ms"))
|
||||
expectNoMessage(Duration.create(100, "ms"))
|
||||
zone.Population ! Zone.Population.Spawn(avatar, player)
|
||||
expectNoMsg(Duration.create(100, "ms"))
|
||||
expectNoMessage(Duration.create(100, "ms"))
|
||||
|
||||
assert(zone.Players.size == 1)
|
||||
assert(zone.Players.head == avatar)
|
||||
assert(zone.LivePlayers.size == 1)
|
||||
assert(zone.LivePlayers.head == player)
|
||||
zone.Population ! Zone.Population.Release(avatar)
|
||||
expectNoMsg(Duration.create(100, "ms"))
|
||||
expectNoMessage(Duration.create(100, "ms"))
|
||||
assert(zone.Players.size == 1)
|
||||
assert(zone.Players.head == avatar)
|
||||
assert(zone.LivePlayers.isEmpty)
|
||||
|
|
@ -360,11 +360,11 @@ class ZonePopulationTest extends ActorTest {
|
|||
player.GUID = PlanetSideGUID(1)
|
||||
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), ZoneTest.TestName)
|
||||
zone.Actor ! Zone.Init()
|
||||
expectNoMsg(200 milliseconds)
|
||||
expectNoMessage(200 milliseconds)
|
||||
zone.Population ! Zone.Population.Join(avatar)
|
||||
expectNoMsg(Duration.create(100, "ms"))
|
||||
expectNoMessage(Duration.create(100, "ms"))
|
||||
zone.Population ! Zone.Population.Spawn(avatar, player)
|
||||
expectNoMsg(Duration.create(100, "ms"))
|
||||
expectNoMessage(Duration.create(100, "ms"))
|
||||
|
||||
assert(zone.Players.size == 1)
|
||||
assert(zone.Players.head == avatar)
|
||||
|
|
@ -386,11 +386,11 @@ class ZonePopulationTest extends ActorTest {
|
|||
val player2 = Player(avatar)
|
||||
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), ZoneTest.TestName)
|
||||
zone.Actor ! Zone.Init()
|
||||
expectNoMsg(200 milliseconds)
|
||||
expectNoMessage(200 milliseconds)
|
||||
zone.Population ! Zone.Population.Join(avatar)
|
||||
expectNoMsg(Duration.create(100, "ms"))
|
||||
expectNoMessage(Duration.create(100, "ms"))
|
||||
zone.Population ! Zone.Population.Spawn(avatar, player1)
|
||||
expectNoMsg(Duration.create(100, "ms"))
|
||||
expectNoMessage(Duration.create(100, "ms"))
|
||||
|
||||
assert(zone.Players.size == 1)
|
||||
assert(zone.Players.head == avatar)
|
||||
|
|
@ -412,7 +412,7 @@ class ZonePopulationTest extends ActorTest {
|
|||
val player = Player(avatar)
|
||||
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), ZoneTest.TestName)
|
||||
zone.Actor ! Zone.Init()
|
||||
expectNoMsg(200 milliseconds)
|
||||
expectNoMessage(200 milliseconds)
|
||||
|
||||
assert(zone.Players.isEmpty)
|
||||
assert(zone.LivePlayers.isEmpty)
|
||||
|
|
@ -430,9 +430,9 @@ class ZonePopulationTest extends ActorTest {
|
|||
val avatar = Avatar("Chord", PlanetSideEmpire.TR, CharacterGender.Male, 0, CharacterVoice.Voice5)
|
||||
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), ZoneTest.TestName)
|
||||
zone.Actor ! Zone.Init()
|
||||
expectNoMsg(200 milliseconds)
|
||||
expectNoMessage(200 milliseconds)
|
||||
zone.Population ! Zone.Population.Join(avatar)
|
||||
expectNoMsg(Duration.create(100, "ms"))
|
||||
expectNoMessage(Duration.create(100, "ms"))
|
||||
|
||||
assert(zone.Players.size == 1)
|
||||
assert(zone.Players.head == avatar)
|
||||
|
|
@ -453,11 +453,11 @@ class ZonePopulationTest extends ActorTest {
|
|||
player.Release
|
||||
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), ZoneTest.TestName)
|
||||
zone.Actor ! Zone.Init()
|
||||
expectNoMsg(200 milliseconds)
|
||||
expectNoMessage(200 milliseconds)
|
||||
|
||||
assert(zone.Corpses.isEmpty)
|
||||
zone.Population ! Zone.Corpse.Add(player)
|
||||
expectNoMsg(Duration.create(100, "ms"))
|
||||
expectNoMessage(Duration.create(100, "ms"))
|
||||
assert(zone.Corpses.size == 1)
|
||||
assert(zone.Corpses.head == player)
|
||||
}
|
||||
|
|
@ -468,14 +468,14 @@ class ZonePopulationTest extends ActorTest {
|
|||
player.Release
|
||||
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), ZoneTest.TestName)
|
||||
zone.Actor ! Zone.Init()
|
||||
expectNoMsg(200 milliseconds)
|
||||
expectNoMessage(200 milliseconds)
|
||||
zone.Population ! Zone.Corpse.Add(player)
|
||||
expectNoMsg(Duration.create(100, "ms"))
|
||||
expectNoMessage(Duration.create(100, "ms"))
|
||||
|
||||
assert(zone.Corpses.size == 1)
|
||||
assert(zone.Corpses.head == player)
|
||||
zone.Population ! Zone.Corpse.Remove(player)
|
||||
expectNoMsg(Duration.create(100, "ms"))
|
||||
expectNoMessage(Duration.create(100, "ms"))
|
||||
assert(zone.Corpses.isEmpty)
|
||||
}
|
||||
|
||||
|
|
@ -489,18 +489,18 @@ class ZonePopulationTest extends ActorTest {
|
|||
player3.Release
|
||||
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), ZoneTest.TestName)
|
||||
zone.Actor ! Zone.Init()
|
||||
expectNoMsg(200 milliseconds)
|
||||
expectNoMessage(200 milliseconds)
|
||||
zone.Population ! Zone.Corpse.Add(player1)
|
||||
zone.Population ! Zone.Corpse.Add(player2)
|
||||
zone.Population ! Zone.Corpse.Add(player3)
|
||||
expectNoMsg(Duration.create(100, "ms"))
|
||||
expectNoMessage(Duration.create(100, "ms"))
|
||||
|
||||
assert(zone.Corpses.size == 3)
|
||||
assert(zone.Corpses.head == player1)
|
||||
assert(zone.Corpses(1) == player2)
|
||||
assert(zone.Corpses(2) == player3)
|
||||
zone.Population ! Zone.Corpse.Remove(player2)
|
||||
expectNoMsg(Duration.create(100, "ms"))
|
||||
expectNoMessage(Duration.create(100, "ms"))
|
||||
assert(zone.Corpses.size == 2)
|
||||
assert(zone.Corpses.head == player1)
|
||||
assert(zone.Corpses(1) == player3)
|
||||
|
|
@ -512,11 +512,11 @@ class ZonePopulationTest extends ActorTest {
|
|||
//player.Release !!important
|
||||
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), ZoneTest.TestName)
|
||||
zone.Actor ! Zone.Init()
|
||||
expectNoMsg(200 milliseconds)
|
||||
expectNoMessage(200 milliseconds)
|
||||
|
||||
assert(zone.Corpses.isEmpty)
|
||||
zone.Population ! Zone.Corpse.Add(player)
|
||||
expectNoMsg(Duration.create(100, "ms"))
|
||||
expectNoMessage(Duration.create(100, "ms"))
|
||||
assert(zone.Corpses.isEmpty)
|
||||
}
|
||||
}
|
||||
|
|
@ -530,7 +530,7 @@ class ZoneGroundDropItemTest extends ActorTest {
|
|||
zone.GUID(hub)
|
||||
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), ZoneTest.TestName)
|
||||
zone.Actor ! Zone.Init()
|
||||
expectNoMsg(200 milliseconds)
|
||||
expectNoMessage(200 milliseconds)
|
||||
|
||||
"DropItem" should {
|
||||
"drop item on ground" in {
|
||||
|
|
@ -556,7 +556,7 @@ class ZoneGroundCanNotDropItem1Test extends ActorTest {
|
|||
zone.GUID(hub)
|
||||
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), ZoneTest.TestName)
|
||||
zone.Actor ! Zone.Init()
|
||||
expectNoMsg(200 milliseconds)
|
||||
expectNoMessage(200 milliseconds)
|
||||
|
||||
"DropItem" should {
|
||||
"not drop an item that is not registered" in {
|
||||
|
|
@ -582,7 +582,7 @@ class ZoneGroundCanNotDropItem2Test extends ActorTest {
|
|||
//zone.GUID(hub) //!important
|
||||
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), ZoneTest.TestName)
|
||||
zone.Actor ! Zone.Init()
|
||||
expectNoMsg(200 milliseconds)
|
||||
expectNoMessage(200 milliseconds)
|
||||
|
||||
"DropItem" should {
|
||||
"not drop an item that is not registered to the zone" in {
|
||||
|
|
@ -608,7 +608,7 @@ class ZoneGroundCanNotDropItem3Test extends ActorTest {
|
|||
zone.GUID(hub) //!important
|
||||
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), ZoneTest.TestName)
|
||||
zone.Actor ! Zone.Init()
|
||||
expectNoMsg(200 milliseconds)
|
||||
expectNoMessage(200 milliseconds)
|
||||
|
||||
"DropItem" should {
|
||||
"not drop an item that has already been dropped" in {
|
||||
|
|
@ -642,7 +642,7 @@ class ZoneGroundPickupItemTest extends ActorTest {
|
|||
zone.GUID(hub)
|
||||
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), ZoneTest.TestName)
|
||||
zone.Actor ! Zone.Init()
|
||||
expectNoMsg(200 milliseconds)
|
||||
expectNoMessage(200 milliseconds)
|
||||
|
||||
"PickupItem" should {
|
||||
"pickup an item from ground" in {
|
||||
|
|
@ -671,7 +671,7 @@ class ZoneGroundCanNotPickupItemTest extends ActorTest {
|
|||
zone.GUID(hub) //still registered to this zone
|
||||
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), ZoneTest.TestName)
|
||||
zone.Actor ! Zone.Init()
|
||||
expectNoMsg(200 milliseconds)
|
||||
expectNoMessage(200 milliseconds)
|
||||
|
||||
"PickupItem" should {
|
||||
"not pickup an item if it can not be found" in {
|
||||
|
|
@ -696,7 +696,7 @@ class ZoneGroundRemoveItemTest extends ActorTest {
|
|||
zone.GUID(hub) //still registered to this zone
|
||||
zone.Actor = system.actorOf(Props(classOf[ZoneActor], zone), ZoneTest.TestName)
|
||||
zone.Actor ! Zone.Init()
|
||||
expectNoMsg(200 milliseconds)
|
||||
expectNoMessage(200 milliseconds)
|
||||
|
||||
"RemoveItem" should {
|
||||
"remove an item from the ground without callback (even if the item is not found)" in {
|
||||
|
|
@ -707,11 +707,11 @@ class ZoneGroundRemoveItemTest extends ActorTest {
|
|||
assert(zone.EquipmentOnGround.contains(item)) //dropped
|
||||
|
||||
zone.Ground ! Zone.Ground.RemoveItem(item.GUID)
|
||||
expectNoMsg(500 milliseconds)
|
||||
expectNoMessage(500 milliseconds)
|
||||
assert(!zone.EquipmentOnGround.contains(item))
|
||||
|
||||
zone.Ground ! Zone.Ground.RemoveItem(item.GUID) //repeat
|
||||
expectNoMsg(500 milliseconds)
|
||||
expectNoMessage(500 milliseconds)
|
||||
assert(!zone.EquipmentOnGround.contains(item))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -288,7 +288,7 @@ class UniqueNumberSystemTest9 extends ActorTest() {
|
|||
guid.AddPool("pool3", (5001 to 6000).toList).Selector = new RandomSelector
|
||||
val uns = system.actorOf(Props(classOf[UniqueNumberSystem], guid, UniqueNumberSystemTest.AllocateNumberPoolActors(guid)), "uns")
|
||||
val excp = new Exception("EXCEPTION MESSAGE")
|
||||
expectNoMsg(Duration.create(200, "ms"))
|
||||
expectNoMessage(Duration.create(200, "ms"))
|
||||
|
||||
//GiveNumber
|
||||
uns ! NumberPoolActor.GiveNumber(1001, Some("test")) //no task associated with id="test"
|
||||
|
|
@ -319,7 +319,7 @@ class UniqueNumberSystemTestA extends ActorTest {
|
|||
val guid : NumberPoolHub = new NumberPoolHub(src)
|
||||
guid.AddPool("pool1", (0 until 10).toList).Selector = new RandomSelector
|
||||
val uns = system.actorOf(Props(classOf[UniqueNumberSystem], guid, UniqueNumberSystemTest.AllocateNumberPoolActors(guid)), "uns")
|
||||
expectNoMsg(Duration.create(200, "ms"))
|
||||
expectNoMessage(Duration.create(200, "ms"))
|
||||
|
||||
assert(src.CountUsed == 0)
|
||||
(0 to 4).foreach(i => { assert(guid.register(new EntityTestClass(), i).isSuccess) })
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ class ProximityTerminalControlStartTest extends ActorTest {
|
|||
avatar.GUID = PlanetSideGUID(1)
|
||||
terminal.GUID = PlanetSideGUID(2)
|
||||
terminal.Actor ! Service.Startup()
|
||||
expectNoMsg(500 milliseconds) //spacer
|
||||
expectNoMessage(500 milliseconds) //spacer
|
||||
val probe1 = new TestProbe(system, "local-events")
|
||||
val probe2 = new TestProbe(system, "target-callback")
|
||||
zone.LocalEvents = probe1.ref
|
||||
|
|
@ -160,7 +160,7 @@ class ProximityTerminalControlTwoUsersTest extends ActorTest {
|
|||
avatar2.GUID = PlanetSideGUID(2)
|
||||
terminal.GUID = PlanetSideGUID(3)
|
||||
terminal.Actor ! Service.Startup()
|
||||
expectNoMsg(500 milliseconds) //spacer
|
||||
expectNoMessage(500 milliseconds) //spacer
|
||||
val probe1 = new TestProbe(system, "local-events")
|
||||
val probe2 = new TestProbe(system, "target-callback-1")
|
||||
val probe3 = new TestProbe(system, "target-callback-2")
|
||||
|
|
@ -175,7 +175,7 @@ class ProximityTerminalControlTwoUsersTest extends ActorTest {
|
|||
probe2.expectMsgClass(1 second, classOf[ProximityUnit.Action])
|
||||
|
||||
terminal.Actor.tell(CommonMessages.Use(avatar2, Some(avatar2)), probe3.ref)
|
||||
probe1.expectNoMsg(1 second)
|
||||
probe1.expectNoMessage(1 second)
|
||||
probe2.expectMsgClass(1 second, classOf[ProximityUnit.Action])
|
||||
probe3.expectMsgClass(1 second, classOf[ProximityUnit.Action])
|
||||
assert(terminal.NumberUsers == 2)
|
||||
|
|
@ -206,7 +206,7 @@ class ProximityTerminalControlStopTest extends ActorTest {
|
|||
avatar.GUID = PlanetSideGUID(1)
|
||||
terminal.GUID = PlanetSideGUID(2)
|
||||
terminal.Actor ! Service.Startup()
|
||||
expectNoMsg(500 milliseconds) //spacer
|
||||
expectNoMessage(500 milliseconds) //spacer
|
||||
val probe1 = new TestProbe(system, "local-events")
|
||||
val probe2 = new TestProbe(system, "target-callback-1")
|
||||
zone.LocalEvents = probe1.ref
|
||||
|
|
@ -255,7 +255,7 @@ class ProximityTerminalControlNotStopTest extends ActorTest {
|
|||
avatar2.GUID = PlanetSideGUID(2)
|
||||
terminal.GUID = PlanetSideGUID(3)
|
||||
terminal.Actor ! Service.Startup()
|
||||
expectNoMsg(500 milliseconds) //spacer
|
||||
expectNoMessage(500 milliseconds) //spacer
|
||||
val probe1 = new TestProbe(system, "local-events")
|
||||
val probe2 = new TestProbe(system, "target-callback-1")
|
||||
val probe3 = new TestProbe(system, "target-callback-2")
|
||||
|
|
@ -270,11 +270,11 @@ class ProximityTerminalControlNotStopTest extends ActorTest {
|
|||
assert(terminal.NumberUsers == 1)
|
||||
|
||||
terminal.Actor.tell(CommonMessages.Use(avatar2, Some(avatar2)), probe3.ref)
|
||||
probe1.expectNoMsg(100 millisecond)
|
||||
probe1.expectNoMessage(100 millisecond)
|
||||
assert(terminal.NumberUsers == 2)
|
||||
|
||||
terminal.Actor ! CommonMessages.Unuse(avatar, Some(avatar))
|
||||
probe1.expectNoMsg(100 millisecond)
|
||||
probe1.expectNoMessage(100 millisecond)
|
||||
assert(terminal.NumberUsers == 1)
|
||||
|
||||
terminal.Actor ! CommonMessages.Unuse(avatar2, Some(avatar2))
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ class TerminalControl2Test extends ActorTest {
|
|||
val (_, terminal) = TerminalControlTest.SetUpAgents(GlobalDefinitions.cert_terminal, PlanetSideEmpire.TR)
|
||||
|
||||
terminal.Actor !"hello"
|
||||
expectNoMsg(Duration.create(500, "ms"))
|
||||
expectNoMessage(Duration.create(500, "ms"))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ class LocalService5Test extends ActorTest {
|
|||
val service = system.actorOf(Props(classOf[LocalService], Zone.Nowhere), "l_service")
|
||||
service ! Service.Join("test")
|
||||
service ! "hello"
|
||||
expectNoMsg()
|
||||
expectNoMessage()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ import scala.concurrent.duration._
|
|||
//
|
||||
// "RemoverActor" should {
|
||||
// "handle a simple task" in {
|
||||
// expectNoMsg(500 milliseconds)
|
||||
// expectNoMessage(500 milliseconds)
|
||||
// val remover = system.actorOf(
|
||||
// Props(classOf[ActorTest.SupportActorInterface], Props[RemoverActorTest.TestRemover], self),
|
||||
// "test-remover"
|
||||
|
|
@ -31,7 +31,7 @@ import scala.concurrent.duration._
|
|||
// assert(reply1.isInstanceOf[RemoverActorTest.InclusionTestAlert])
|
||||
// val reply2 = receiveOne(500 milliseconds)
|
||||
// assert(reply2.isInstanceOf[RemoverActorTest.InitialJobAlert])
|
||||
// expectNoMsg(1 seconds) //delay
|
||||
// expectNoMessage(1 seconds) //delay
|
||||
// val reply3 = receiveOne(500 milliseconds)
|
||||
// assert(reply3.isInstanceOf[RemoverActorTest.FirstJobAlert])
|
||||
// val reply4 = receiveOne(500 milliseconds)
|
||||
|
|
@ -51,7 +51,7 @@ import scala.concurrent.duration._
|
|||
//
|
||||
// "RemoverActor" should {
|
||||
// "handle a simple task (timed)" in {
|
||||
// expectNoMsg(500 milliseconds)
|
||||
// expectNoMessage(500 milliseconds)
|
||||
// val remover = system.actorOf(
|
||||
// Props(classOf[ActorTest.SupportActorInterface], Props[RemoverActorTest.TestRemover], self),
|
||||
// "test-remover"
|
||||
|
|
@ -83,7 +83,7 @@ import scala.concurrent.duration._
|
|||
//
|
||||
// "RemoverActor" should {
|
||||
// "allow only specific objects" in {
|
||||
// expectNoMsg(500 milliseconds)
|
||||
// expectNoMessage(500 milliseconds)
|
||||
// val probe = TestProbe()
|
||||
// val remover = system.actorOf(
|
||||
// Props(classOf[ActorTest.SupportActorInterface], Props[RemoverActorTest.TestRemover], self),
|
||||
|
|
@ -93,7 +93,7 @@ import scala.concurrent.duration._
|
|||
//
|
||||
// val reply1 = probe.receiveOne(200 milliseconds)
|
||||
// assert(reply1.isInstanceOf[RemoverActorTest.InclusionTestAlert])
|
||||
// expectNoMsg(2 seconds)
|
||||
// expectNoMessage(2 seconds)
|
||||
// //RemoverActor is stalled because it received an object that it was not allowed to act upon
|
||||
// }
|
||||
// }
|
||||
|
|
@ -105,7 +105,7 @@ import scala.concurrent.duration._
|
|||
//
|
||||
// "RemoverActor" should {
|
||||
// "work on parallel tasks" in {
|
||||
// expectNoMsg(500 milliseconds)
|
||||
// expectNoMessage(500 milliseconds)
|
||||
// val probe = TestProbe()
|
||||
// val remover = system.actorOf(Props(classOf[RemoverActorTest.TestRemover], probe), "test-remover")
|
||||
// remover ! RemoverActor.AddTask(RemoverActorTest.TestObject, Zone.Nowhere)
|
||||
|
|
@ -139,7 +139,7 @@ import scala.concurrent.duration._
|
|||
//
|
||||
// "RemoverActor" should {
|
||||
// "be able to hurry certain tasks" in {
|
||||
// expectNoMsg(500 milliseconds)
|
||||
// expectNoMessage(500 milliseconds)
|
||||
// val probe = TestProbe()
|
||||
// val remover = system.actorOf(Props(classOf[RemoverActorTest.TestRemover], probe), "test-remover")
|
||||
// remover ! RemoverActor.AddTask(RemoverActorTest.TestObject, Zone.Nowhere, Some(10 minutes)) //TEN MINUTE WAIT
|
||||
|
|
@ -148,7 +148,7 @@ import scala.concurrent.duration._
|
|||
// assert(reply1.isInstanceOf[RemoverActorTest.InclusionTestAlert])
|
||||
// val reply2 = probe.receiveOne(200 milliseconds)
|
||||
// assert(reply2.isInstanceOf[RemoverActorTest.InitialJobAlert])
|
||||
// probe.expectNoMsg(3 seconds) //long delay, longer than standard but not yet 10 minutes
|
||||
// probe.expectNoMessage(3 seconds) //long delay, longer than standard but not yet 10 minutes
|
||||
// remover ! RemoverActor.HurrySpecific(List(RemoverActorTest.TestObject), Zone.Nowhere) //hurried
|
||||
// val reply3 = probe.receiveOne(300 milliseconds)
|
||||
// assert(reply3.isInstanceOf[RemoverActorTest.FirstJobAlert])
|
||||
|
|
@ -170,7 +170,7 @@ import scala.concurrent.duration._
|
|||
//
|
||||
// "RemoverActor" should {
|
||||
// "be able to hurry certain tasks, but let others finish normally" in {
|
||||
// expectNoMsg(500 milliseconds)
|
||||
// expectNoMessage(500 milliseconds)
|
||||
// val probe = TestProbe()
|
||||
// val remover = system.actorOf(Props(classOf[RemoverActorTest.TestRemover], probe), "test-remover")
|
||||
// remover ! RemoverActor.AddTask(RemoverActorTest.TestObject, Zone.Nowhere, Some(5 seconds))
|
||||
|
|
@ -185,7 +185,7 @@ import scala.concurrent.duration._
|
|||
// case msg => assert(false, s"$msg")
|
||||
// }
|
||||
// assert(ita == 2 && ija == 2)
|
||||
// probe.expectNoMsg(3 seconds) //long delay, longer than standard but not yet 5 seconds
|
||||
// probe.expectNoMessage(3 seconds) //long delay, longer than standard but not yet 5 seconds
|
||||
// remover ! RemoverActor.HurrySpecific(List(RemoverActorTest.TestObject), Zone.Nowhere) //hurried
|
||||
// //first
|
||||
// val reply3a = probe.receiveOne(300 milliseconds)
|
||||
|
|
@ -221,7 +221,7 @@ import scala.concurrent.duration._
|
|||
//
|
||||
// "RemoverActor" should {
|
||||
// "be able to hurry certain tasks, but only valid ones" in {
|
||||
// expectNoMsg(500 milliseconds)
|
||||
// expectNoMessage(500 milliseconds)
|
||||
// val probe = TestProbe()
|
||||
// val remover = system.actorOf(Props(classOf[RemoverActorTest.TestRemover], probe), "test-remover")
|
||||
// remover ! RemoverActor.AddTask(RemoverActorTest.TestObject, Zone.Nowhere, Some(5 seconds))
|
||||
|
|
@ -236,7 +236,7 @@ import scala.concurrent.duration._
|
|||
// case msg => assert(false, s"$msg")
|
||||
// }
|
||||
// assert(ita == 2 && ija == 2)
|
||||
// probe.expectNoMsg(3 seconds) //long delay, longer than standard but not yet 5 seconds
|
||||
// probe.expectNoMessage(3 seconds) //long delay, longer than standard but not yet 5 seconds
|
||||
// remover ! RemoverActor.HurrySpecific(List(RemoverActorTest.TestObject, TestObject3), Zone.Nowhere) //multiple hurried, only one valid
|
||||
// //first
|
||||
// val reply3a = probe.receiveOne(300 milliseconds)
|
||||
|
|
@ -273,7 +273,7 @@ import scala.concurrent.duration._
|
|||
//
|
||||
// "RemoverActor" should {
|
||||
// "be able to hurry certain tasks by their zone" in {
|
||||
// expectNoMsg(500 milliseconds)
|
||||
// expectNoMessage(500 milliseconds)
|
||||
// val probe = TestProbe()
|
||||
// val remover = system.actorOf(Props(classOf[RemoverActorTest.TestRemover], probe), "test-remover")
|
||||
// remover ! RemoverActor.AddTask(RemoverActorTest.TestObject, Zone.Nowhere, Some(5 seconds))
|
||||
|
|
@ -289,7 +289,7 @@ import scala.concurrent.duration._
|
|||
// case msg => assert(false, s"$msg")
|
||||
// }
|
||||
// assert(ita == 3 && ija == 3)
|
||||
// probe.expectNoMsg(3 seconds) //long delay, longer than standard but not yet 5 seconds
|
||||
// probe.expectNoMessage(3 seconds) //long delay, longer than standard but not yet 5 seconds
|
||||
// remover ! RemoverActor.HurrySpecific(List(), Zone.Nowhere) //multiple hurried, only the two entries with Zone.Nowhere
|
||||
// //
|
||||
// val replies2 = probe.receiveN(10, 5 seconds)
|
||||
|
|
@ -332,7 +332,7 @@ import scala.concurrent.duration._
|
|||
//
|
||||
// "RemoverActor" should {
|
||||
// "be able to hurry all tasks to completion" in {
|
||||
// expectNoMsg(500 milliseconds)
|
||||
// expectNoMessage(500 milliseconds)
|
||||
// val probe = TestProbe()
|
||||
// val remover = system.actorOf(Props(classOf[RemoverActorTest.TestRemover], probe), "test-remover")
|
||||
// remover ! RemoverActor.AddTask(RemoverActorTest.TestObject, Zone.Nowhere, Some(20 seconds))
|
||||
|
|
@ -348,7 +348,7 @@ import scala.concurrent.duration._
|
|||
// case msg => assert(false, s"$msg")
|
||||
// }
|
||||
// assert(ita == 3 && ija == 3)
|
||||
// probe.expectNoMsg(3 seconds) //long delay, longer than standard but not yet longer than any of the tasks
|
||||
// probe.expectNoMessage(3 seconds) //long delay, longer than standard but not yet longer than any of the tasks
|
||||
// remover ! RemoverActor.HurryAll() //all hurried
|
||||
// //
|
||||
// val replies2 = probe.receiveN(15, 5 seconds)
|
||||
|
|
@ -378,7 +378,7 @@ import scala.concurrent.duration._
|
|||
//
|
||||
// "RemoverActor" should {
|
||||
// "be able to clear certain tasks" in {
|
||||
// expectNoMsg(500 milliseconds)
|
||||
// expectNoMessage(500 milliseconds)
|
||||
// val probe = TestProbe()
|
||||
// val remover = system.actorOf(Props(classOf[RemoverActorTest.TestRemover], probe), "test-remover")
|
||||
// remover ! RemoverActor.AddTask(RemoverActorTest.TestObject, Zone.Nowhere, Some(5 seconds))
|
||||
|
|
@ -393,7 +393,7 @@ import scala.concurrent.duration._
|
|||
// case msg => assert(false, s"$msg")
|
||||
// }
|
||||
// assert(ita == 2 && ija == 2)
|
||||
// probe.expectNoMsg(4 seconds) //long delay, longer than standard but not yet 5 seconds
|
||||
// probe.expectNoMessage(4 seconds) //long delay, longer than standard but not yet 5 seconds
|
||||
// remover ! RemoverActor.ClearSpecific(List(RemoverActorTest.TestObject), Zone.Nowhere) //cleared
|
||||
// //
|
||||
// val reply3 = probe.receiveOne(2 seconds)
|
||||
|
|
@ -407,7 +407,7 @@ import scala.concurrent.duration._
|
|||
// val reply7 = probe.receiveOne(500 milliseconds)
|
||||
// assert(reply7.isInstanceOf[RemoverActorTest.DeletionTaskRunAlert])
|
||||
// //wait
|
||||
// probe.expectNoMsg(2 seconds) //nothing more to do
|
||||
// probe.expectNoMessage(2 seconds) //nothing more to do
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
|
@ -418,7 +418,7 @@ import scala.concurrent.duration._
|
|||
//
|
||||
// "RemoverActor" should {
|
||||
// "be able to clear all tasks, with no more work on them" in {
|
||||
// expectNoMsg(500 milliseconds)
|
||||
// expectNoMessage(500 milliseconds)
|
||||
// val probe = TestProbe()
|
||||
// val remover = system.actorOf(Props(classOf[RemoverActorTest.TestRemover], probe), "test-remover")
|
||||
// remover ! RemoverActor.AddTask(RemoverActorTest.TestObject, Zone.Nowhere, Some(5 seconds))
|
||||
|
|
@ -433,10 +433,10 @@ import scala.concurrent.duration._
|
|||
// case msg => assert(false, s"$msg")
|
||||
// }
|
||||
// assert(ita == 2 && ija == 2)
|
||||
// probe.expectNoMsg(4 seconds) //long delay, longer than standard but not yet 5 seconds
|
||||
// probe.expectNoMessage(4 seconds) //long delay, longer than standard but not yet 5 seconds
|
||||
// remover ! RemoverActor.ClearAll() //cleared
|
||||
// //wait
|
||||
// probe.expectNoMsg(3 seconds) //nothing more to do
|
||||
// probe.expectNoMessage(3 seconds) //nothing more to do
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
|
@ -447,7 +447,7 @@ import scala.concurrent.duration._
|
|||
//
|
||||
// "RemoverActor" should {
|
||||
// "be able to hurry certain tasks" in {
|
||||
// expectNoMsg(500 milliseconds)
|
||||
// expectNoMessage(500 milliseconds)
|
||||
// val probe = TestProbe()
|
||||
// val remover = system.actorOf(Props(classOf[RemoverActorTest.TestRemover], probe), "test-remover")
|
||||
// remover ! RemoverActor.AddTask(RemoverActorTest.TestObject, Zone.Nowhere, Some(5 seconds))
|
||||
|
|
@ -462,7 +462,7 @@ import scala.concurrent.duration._
|
|||
// case msg => assert(false, s"$msg")
|
||||
// }
|
||||
// assert(ita == 2 && ija == 2)
|
||||
// probe.expectNoMsg(2 seconds)
|
||||
// probe.expectNoMessage(2 seconds)
|
||||
// remover ! akka.actor.PoisonPill
|
||||
// //
|
||||
// val replies2 = probe.receiveN(8, 5 seconds)
|
||||
|
|
|
|||
|
|
@ -165,7 +165,7 @@ class RouterTelepadActivationClearAllTest extends ActorTest {
|
|||
obj ! RouterTelepadActivation.AddTask(telepad2, Zone.Nowhere, Some(2 seconds))
|
||||
obj ! RouterTelepadActivation.AddTask(telepad3, Zone.Nowhere, Some(2 seconds))
|
||||
obj ! SupportActor.ClearAll()
|
||||
expectNoMsg(4 seconds)
|
||||
expectNoMessage(4 seconds)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ class VehicleService5Test extends ActorTest {
|
|||
val service = system.actorOf(Props(classOf[VehicleService], Zone.Nowhere), "v-service")
|
||||
service ! Service.Join("test")
|
||||
service ! "hello"
|
||||
expectNoMsg()
|
||||
expectNoMessage()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue