Class TestProcessingUnitRunner

  • All Implemented Interfaces:
    java.io.Serializable

    public class TestProcessingUnitRunner
    extends java.lang.Object
    implements java.io.Serializable
    Implements a simple processing unit runner. It's made to use in unit tests.
    See Also:
    Serialized Form
    • Constructor Detail

      • TestProcessingUnitRunner

        protected TestProcessingUnitRunner()
        Constructor
    • Method Detail

      • runAndAbort

        public long runAndAbort​(java.lang.Class<? extends IProcessingUnit> processingUnitClass,
                                java.util.List<Parameter> parameterList,
                                java.lang.Integer numberOfCyclesBeforeStop)
                         throws ValidationException,
                                ProcessingException
        Run processing unit and abort after some cycles
        Parameters:
        processingUnitClass - the processing unit class
        parameterList - the parameter list
        numberOfCyclesBeforeStop - the number of cycles before stop
        Returns:
        the number of cycles
        Throws:
        ValidationException - In case the processing can not be initilized
        ProcessingException - In case of an error in a processing
      • runWithSuspendAndResume

        public long runWithSuspendAndResume​(java.lang.Class<? extends IProcessingUnit> processingUnitClass,
                                            java.util.List<Parameter> parameterList,
                                            java.lang.Long suspendAfterCycles,
                                            java.lang.Long suspendSleepTime,
                                            java.lang.Integer maxNumberOfSuspends)
                                     throws ValidationException,
                                            ProcessingException
        Run processing unit
        Parameters:
        processingUnitClass - the processing unit class
        parameterList - the parameter list
        suspendAfterCycles - after the number of cycles it will suspended
        suspendSleepTime - the sleep time after suspending or null
        maxNumberOfSuspends - the max number of suspends
        Returns:
        the number of cycles
        Throws:
        ValidationException - In case the processing can not be initilized
        ProcessingException - In case of an error in a processing
      • getSuspendCounter

        public int getSuspendCounter()
        Gets the suspend counter
        Returns:
        the suspend counter
      • getProcessStatus

        public IProcessStatus getProcessStatus()
        Gets the last process status
        Returns:
        the last process status
      • getProcesingUnit

        public IProcessingUnit getProcesingUnit()
        Get the processing unit. IMPORTANT: Only to verify some results
        Returns:
        the processing unit