Class ScenarioHandler

  • All Implemented Interfaces:
    Runnable

    public class ScenarioHandler
    extends Thread
    Scenario handler thread.
    Author:
    michal.polkorab
    • Constructor Detail

      • ScenarioHandler

        public ScenarioHandler​(Deque<ClientEvent> scenario)
        Constructor.
        Parameters:
        scenario - Deque
      • ScenarioHandler

        public ScenarioHandler​(Deque<ClientEvent> scenario,
                               int freeze,
                               long sleepBetweenTries)
    • Method Detail

      • run

        public void run()
        Specified by:
        run in interface Runnable
        Overrides:
        run in class Thread
      • isEmpty

        public boolean isEmpty()
        Returns true if scenario is done / empty.
      • setScenario

        public void setScenario​(Deque<ClientEvent> scenario)
        Sets the scenario.
        Parameters:
        scenario - scenario filled with desired events
      • setCtx

        public void setCtx​(io.netty.channel.ChannelHandlerContext ctx)
        Sets the ChannelHandlerContext.
        Parameters:
        ctx - context which will be used for sending messages (SendEvents)
      • addOfMsg

        public void addOfMsg​(byte[] message)
        Adds a message.
        Parameters:
        message - received message that is compared to expected message
      • isScenarioFinished

        public boolean isScenarioFinished()
        Returns true is scenario is finished.
      • isFinishedOK

        public boolean isFinishedOK()