Class Actor


  • public final class Actor
    extends java.lang.Object
    An Actor is the central class of the Shakespeare Framework. It is basically used for any interaction with the system under test.
    • Constructor Detail

      • Actor

        public Actor​(java.lang.String name)
        Parameters:
        name - a name used for logging and reporting
      • Actor

        public Actor()
        Picks a name from NAMES.
    • Method Detail

      • does

        public Actor does​(Task task)
        Parameters:
        task - the Task to be performed by this Actor
        Returns:
        this Actor
      • checks

        public <A> A checks​(Question<A> question)
        Type Parameters:
        A - the Class of the answer
        Parameters:
        question - the Question to be answered by this Actor
        Returns:
        the answer to the given Question
      • checks

        public <A> A checks​(RetryableQuestion<A> question)
        Type Parameters:
        A - the Class of the answer
        Parameters:
        question - the RetryableQuestion to be answered by this Actor
        Returns:
        the answer to the given Question
        Throws:
        TimeoutException - if no acceptable answer is given when the question's timeout is reached
      • remembers

        public <F extends Fact> F remembers​(java.lang.Class<F> factClass)
        Type Parameters:
        F - the required Fact Class
        Parameters:
        factClass - the Fact Class that should be remembered
        Returns:
        the Fact instance for the Actor's facts
        Throws:
        MissingFactException - if there's no instance of the requested Fact Class in the Actor's facts
      • informs

        public Actor informs​(Reporter... reporters)
        Parameters:
        reporters - Reporters that should be informed in the order they should be informed
        Returns:
        this Actor
      • getName

        public java.lang.String getName()
        Returns:
        name
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object