org.specs.mock

class ProtocolType

[source: org/specs/mock/ProtocolType.scala]

abstract class ProtocolType(repetition : CallConstraint)
extends AnyRef
The ProtocolType specifies if a sequence of ReceivedCall can match a sequence of SpecifiedCall
Direct Known Subclasses:
inAnyOrder, inSequence

Method Summary
abstract def constraints : java.lang.String
A string describing the constraints of this protocol type
It must be implemented by subclasses to provide a meaningful name to describe the protocol in error messages
abstract def consume (expected : scala.List[SpecifiedCall], received : scala.List[ReceivedCall]) : (scala.List[SpecifiedCall], scala.List[ReceivedCall])
Consumes the expected messages with the actual received ones
If the expected messages are not all consumed, there will be a failure message
override def equals (other : Any) : Boolean
def expectedDefs (expected : scala.List[SpecifiedCall]) : java.lang.String
def failures (expected : scala.List[SpecifiedCall], received : scala.List[ReceivedCall], exclusive : Boolean) : java.lang.String
def receivedMessages (received : scala.List[ReceivedCall]) : java.lang.String
Methods inherited from AnyRef
getClass, hashCode, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Method Details
abstract def constraints : java.lang.String
A string describing the constraints of this protocol type
It must be implemented by subclasses to provide a meaningful name to describe the protocol in error messages

abstract def consume(expected : scala.List[SpecifiedCall], received : scala.List[ReceivedCall]) : (scala.List[SpecifiedCall], scala.List[ReceivedCall])
Consumes the expected messages with the actual received ones
If the expected messages are not all consumed, there will be a failure message

def failures(expected : scala.List[SpecifiedCall], received : scala.List[ReceivedCall], exclusive : Boolean) : java.lang.String
Returns
error messages specifying if some expected calls have not been met.
also an error message when unexpected calls occured if exclusive is true
"" otherwise

def expectedDefs(expected : scala.List[SpecifiedCall]) : java.lang.String
Returns
a user message specifying the protocol constraints on the expected calls: for example "in any order m1; m2" or "in sequence m1; m2; m3"

def receivedMessages(received : scala.List[ReceivedCall]) : java.lang.String
Returns
a user message with the list of received messages

override def equals(other : Any) : Boolean


Copyright (c) 2007-2008. All Rights Reserved.