Package org.shakespeareframework
Class Actor
- java.lang.Object
-
- org.shakespeareframework.Actor
-
public final class Actor extends java.lang.Object
AnActor
is the central class of the Shakespeare Framework. It is basically used for any interaction with the system under test.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Actor
can(Ability... abilities)
<A> A
checks(Question<A> question)
<A> A
checks(RetryableQuestion<A> question)
Actor
does(RetryableTask task)
Actor
does(Task task)
boolean
equals(java.lang.Object obj)
java.lang.String
getName()
int
hashCode()
Actor
informs(Reporter... reporters)
Actor
learns(Fact... facts)
<F extends Fact>
Fremembers(java.lang.Class<F> factClass)
java.lang.String
toString()
<A extends Ability>
Auses(java.lang.Class<A> abilityClass)
-
-
-
Constructor Detail
-
Actor
public Actor(java.lang.String name)
- Parameters:
name
- a name used for logging and reporting
-
Actor
public Actor()
Picks a name fromNAMES
.
-
-
Method Detail
-
does
public Actor does(RetryableTask task)
- Parameters:
task
- theRetryableTask
to be performed by thisActor
- Returns:
- this
Actor
- Throws:
TimeoutException
- if no acceptable answer is given when the question's timeout is reached
-
checks
public <A> A checks(Question<A> question)
-
checks
public <A> A checks(RetryableQuestion<A> question)
- Type Parameters:
A
- theClass
of the answer- Parameters:
question
- theRetryableQuestion
to be answered by thisActor
- Returns:
- the answer to the given Question
- Throws:
TimeoutException
- if no acceptable answer is given when the question's timeout is reached
-
can
public Actor can(Ability... abilities)
- Parameters:
abilities
-Ability
s theActor
mayuses(java.lang.Class<A>)
- Returns:
- this
Actor
-
uses
public <A extends Ability> A uses(java.lang.Class<A> abilityClass)
-
learns
public Actor learns(Fact... facts)
- Parameters:
facts
-Fact
s theActor
remembers(java.lang.Class<F>)
s- Returns:
- this
Actor
-
remembers
public <F extends Fact> F remembers(java.lang.Class<F> factClass)
-
getName
public java.lang.String getName()
- Returns:
name
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-