Class JUnit4MainRunner

  • All Implemented Interfaces:
    java.lang.Runnable

    public class JUnit4MainRunner
    extends com.dkfqs.tools.javatest.AbstractJavaTest
    A generic main program for executing JUnit 4 tests - which is normally started as Java OS process on measuring agents.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.dkfqs.tools.javatest.AbstractJavaTest

        com.dkfqs.tools.javatest.AbstractJavaTest.ResourceFiles
      • Nested classes/interfaces inherited from class java.lang.Thread

        java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String JUNIT_CONFIG_FILE_MAIN_ARG
      The required (main) argument name for the JUnit config execution file.
      static java.lang.String TESTJOB_PROPERTIES_FILE_NAME
      The name of the testjob properties file.
      • Fields inherited from class com.dkfqs.tools.javatest.AbstractJavaTest

        ABORT_TESTJOB_FILE_NAME, ENCODE_ALGORITHM_DECODE, ENCODE_ALGORITHM_ENCODE, ENCODE_ALGORITHM_NONE, ERROR_SEVERITY_ERROR, ERROR_SEVERITY_FATAL, ERROR_SEVERITY_WARNING, LOG_DEBUG, LOG_ERROR, LOG_FATAL, LOG_INFO, LOG_TRACE, LOG_WARN, SESSION_STATUS_END_OF_TEST, SESSION_STATUS_END_OF_USER, SESSION_STATUS_FAILED, SESSION_STATUS_SUCCESS, STATISTIC_TYPE_AVERAGE_AND_CURRENT_VALUE, STATISTIC_TYPE_CUMULATIVE_COUNTER_LONG, STATISTIC_TYPE_EFFICIENCY_RATIO_PERCENT, STATISTIC_TYPE_SAMPLE_EVENT_TIME_CHART, STATISTIC_TYPE_THROUGHPUT_TIME_CHART, stdoutLog, SUSPEND_TESTJOB_FILE_NAME, VALID_ENCODE_ALGORITHM_SET, VALID_SESSION_STATUS_SET
      • Fields inherited from class java.lang.Thread

        MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
    • Constructor Summary

      Constructors 
      Constructor Description
      JUnit4MainRunner​(int userNumber)
      Constructor: Create a new instance per simulated user.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void declareStatistics()  
      void executeUserEnd​(int userNumber)  
      int executeUserSession​(int userNumber, int sessionLoopNumber)  
      void executeUserSessionEnd​(int sessionStatus, int userNumber, int sessionLoopNumber)  
      void executeUserStart​(int userNumber)  
      static void main​(java.lang.String[] args)
      Main: Execute the JUnit tests as (real load) test.
      void onUserResume​(int userNumber)  
      void onUserSuspend​(int userNumber)  
      void onUserTestAbort​(int userNumber)  
      • Methods inherited from class com.dkfqs.tools.javatest.AbstractJavaTest

        abstractMain, addAverageDeltaAndCurrentValue, addCounterLong, addEfficiencyRatioDelta, addSampleError, addSampleError, addSampleLong, addSimulatedUser, addTestResultAnnotationExecEvent, addThroughputDelta, declareStatistic, getArgDataOutputDirectory, getArgDelayPerSessionLoopMillis, getArgJobDescription, getArgMaxSessionLoopsPerUser, getArgMaxTestDuration, getArgNumberOfUsers, getArgRampUpTime, getExecuteEndTimestamp, getExecuteStartTimestamp, getFileApiThread, getSessionLoopNumber, getStdoutLogAdapter, getTotalFailedSessions, getTotalPassedSessions, getUserNumber, isArgDebugExecution, isArgDebugMeasuring, isGlobalAbortFlag, logTestSpecificResourceFileNames, registerSampleStart, run, setSpecificPassedLoopTimeDuration, sleep, startUserThreads, waitUserThreadsEnd
      • Methods inherited from class java.lang.Thread

        activeCount, checkAccess, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, start, stop, suspend, toString, yield
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • JUNIT_CONFIG_FILE_MAIN_ARG

        public static final java.lang.String JUNIT_CONFIG_FILE_MAIN_ARG
        The required (main) argument name for the JUnit config execution file.
        See Also:
        Constant Field Values
      • TESTJOB_PROPERTIES_FILE_NAME

        public static final java.lang.String TESTJOB_PROPERTIES_FILE_NAME
        The name of the testjob properties file.
        See Also:
        Constant Field Values
    • Constructor Detail

      • JUnit4MainRunner

        public JUnit4MainRunner​(int userNumber)
                         throws java.io.IOException
        Constructor: Create a new instance per simulated user.
        Parameters:
        userNumber - the simulated user number
        Throws:
        java.io.IOException - if the user statistics out file cannot be created
    • Method Detail

      • main

        public static void main​(java.lang.String[] args)
        Main: Execute the JUnit tests as (real load) test.
        Parameters:
        args - the command line args
      • declareStatistics

        public void declareStatistics()
        Specified by:
        declareStatistics in class com.dkfqs.tools.javatest.AbstractJavaTest
      • executeUserStart

        public void executeUserStart​(int userNumber)
                              throws java.lang.Exception
        Specified by:
        executeUserStart in class com.dkfqs.tools.javatest.AbstractJavaTest
        Throws:
        java.lang.Exception
      • executeUserSession

        public int executeUserSession​(int userNumber,
                                      int sessionLoopNumber)
                               throws java.lang.Exception
        Specified by:
        executeUserSession in class com.dkfqs.tools.javatest.AbstractJavaTest
        Throws:
        java.lang.Exception
      • executeUserSessionEnd

        public void executeUserSessionEnd​(int sessionStatus,
                                          int userNumber,
                                          int sessionLoopNumber)
                                   throws java.lang.Exception
        Specified by:
        executeUserSessionEnd in class com.dkfqs.tools.javatest.AbstractJavaTest
        Throws:
        java.lang.Exception
      • onUserSuspend

        public void onUserSuspend​(int userNumber)
                           throws java.lang.Exception
        Specified by:
        onUserSuspend in class com.dkfqs.tools.javatest.AbstractJavaTest
        Throws:
        java.lang.Exception
      • onUserResume

        public void onUserResume​(int userNumber)
                          throws java.lang.Exception
        Specified by:
        onUserResume in class com.dkfqs.tools.javatest.AbstractJavaTest
        Throws:
        java.lang.Exception
      • executeUserEnd

        public void executeUserEnd​(int userNumber)
                            throws java.lang.Exception
        Specified by:
        executeUserEnd in class com.dkfqs.tools.javatest.AbstractJavaTest
        Throws:
        java.lang.Exception
      • onUserTestAbort

        public void onUserTestAbort​(int userNumber)
                             throws java.lang.Exception
        Specified by:
        onUserTestAbort in class com.dkfqs.tools.javatest.AbstractJavaTest
        Throws:
        java.lang.Exception