Class ExternalSutController

    • Field Detail

      • PROP_MUTE_SUT

        public static final String PROP_MUTE_SUT
        System property to avoid printing the console output of the SUT.
        See Also:
        Constant Field Values
      • process

        protected volatile Process process
    • Constructor Detail

      • ExternalSutController

        public ExternalSutController()
    • Method Detail

      • setupForGeneratedTest

        public final void setupForGeneratedTest()
        Description copied from interface: SutHandler
        There might be different settings based on when the SUT is run during the search of EvoMaster, and when it is later started in the generated tests.
      • setInstrumentation

        public void setInstrumentation​(boolean instrumentation)
      • getInputParameters

        public abstract String[] getInputParameters()
        Returns:
        the input parameters with which the system under test should be started
      • getJVMParameters

        public abstract String[] getJVMParameters()
        Returns:
        the JVM parameters (eg -X and -D) with which the system under test should be started
      • getBaseURL

        public abstract String getBaseURL()
        Returns:
        the base URL of the running SUT, eg "http://localhost:8080". Note: this value will likely depend on how getInputParameters() has been implemented
      • getPathToExecutableJar

        public abstract String getPathToExecutableJar()
        Returns:
        a String representing either a relative or absolute path to the where the JAR of the system under test is located
      • getLogMessageOfInitializedServer

        public abstract String getLogMessageOfInitializedServer()
        Returns:
        a string subtext that should be present in the logs (std output) of the system under test to check if the server is up and ready.
      • getMaxAwaitForInitializationInSeconds

        public abstract long getMaxAwaitForInitializationInSeconds()
        Returns:
        how long (in seconds) we should wait at most to check if SUT is ready and initialized (this related to the getLogMessageOfInitializedServer() method)
      • preStart

        public abstract void preStart()
        If the SUT needs some third-party processes (eg a non-embedded database), here they can be configured and started. This method is going to be called before we start the SUT.
      • postStart

        public abstract void postStart()
        This method is going to be called after the SUT is started.
      • preStop

        public abstract void preStop()
        This method is going to be called before the SUT is stopped.
      • postStop

        public abstract void postStop()
        If the SUT needs some third-party processes (eg a non-embedded database), here we can shut them down once the SUT has been stopped.
      • startSut

        public String startSut()
        Description copied from interface: SutHandler
        Start a new instance of the SUT.
        This method must be blocking until the SUT is initialized.
        Returns:
        the base URL of the running SUT, eg "http://localhost:8080"
      • isSutRunning

        public boolean isSutRunning()
        Description copied from class: SutController
        Check if the system under test (SUT) is running and fully initialized
        Specified by:
        isSutRunning in class SutController
        Returns:
        true if the SUT is running
      • stopSut

        public void stopSut()
        Description copied from interface: SutHandler
        Stop the SUT
      • isInstrumentationActivated

        public final boolean isInstrumentationActivated()
        Description copied from class: SutController
        Check if bytecode instrumentation is on.
        Specified by:
        isInstrumentationActivated in class SutController
        Returns:
        true if the instrumentation is on
      • newSearch

        public final void newSearch()
        Description copied from class: SutController
        Re-initialize all internal data to enable a completely new search phase which should be independent from previous ones
        Specified by:
        newSearch in class SutController
      • startExternalProcessPrinter

        protected void startExternalProcessPrinter()