Class AbstractUsageScenario<T>

    • Constructor Detail

      • AbstractUsageScenario

        public AbstractUsageScenario()
        Instantiates a new UsageScenario using the simple class name as scenario name
      • AbstractUsageScenario

        public AbstractUsageScenario​(String name)
        Instantiates a new UsageScenario with the given name
        Parameters:
        name - the scenario name
      • AbstractUsageScenario

        public AbstractUsageScenario​(String name,
                                     int maximumTimeMs)
        Instantiates a new UsageScenario with the given name
        Parameters:
        name - the scenario name
        maximumTimeMs - the maximum time in milliseconds this scenario should take to run
    • Method Detail

      • name

        public final String name()
        Specified by:
        name in interface UsageScenario<T>
        Returns:
        the name of this scenario
      • maximumTime

        public final int maximumTime()
        Description copied from interface: UsageScenario
        The maximum time in milliseconds this scenario can run before issuing a warning.
        Specified by:
        maximumTime in interface UsageScenario<T>
        Returns:
        the warning time
      • successfulRunCount

        public final int successfulRunCount()
        Specified by:
        successfulRunCount in interface UsageScenario<T>
        Returns:
        the number of times this scenario has been successfully run
      • unsuccessfulRunCount

        public final int unsuccessfulRunCount()
        Specified by:
        unsuccessfulRunCount in interface UsageScenario<T>
        Returns:
        the number of times this scenario has been unsuccessfully run
      • totalRunCount

        public final int totalRunCount()
        Specified by:
        totalRunCount in interface UsageScenario<T>
        Returns:
        the total number of times this scenario has been run
      • clearExceptions

        public final void clearExceptions()
        Description copied from interface: UsageScenario
        Clears the exceptions that have been collected so far
        Specified by:
        clearExceptions in interface UsageScenario<T>
      • run

        public final void run​(T application)
        Description copied from interface: UsageScenario
        Runs this scenario with the given application
        Specified by:
        run in interface UsageScenario<T>
        Parameters:
        application - the application to use
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class Object
      • equals

        public final boolean equals​(Object obj)
        Overrides:
        equals in class Object
      • defaultWeight

        public int defaultWeight()
        Specified by:
        defaultWeight in interface UsageScenario<T>
        Returns:
        the default weight for this scenario, 1 by default
      • perform

        protected abstract void perform​(T application)
                                 throws Exception
        Runs a set of actions on the given application.
        Parameters:
        application - the application
        Throws:
        Exception - in case of an exception
      • prepare

        protected void prepare​(T application)
        Called before this scenario is run, override to prepare the application for each run
        Parameters:
        application - the application
      • cleanup

        protected void cleanup​(T application)
        Called after this scenario has been run, override to clean up the application after each run
        Parameters:
        application - the application