Class ExternalSutController
- java.lang.Object
-
- org.evomaster.client.java.controller.internal.SutController
-
- org.evomaster.client.java.controller.ExternalSutController
-
- All Implemented Interfaces:
SutHandler
public abstract class ExternalSutController extends SutController
-
-
Field Summary
Fields Modifier and Type Field Description protected Processprocessstatic StringPROP_MUTE_SUTSystem property to avoid printing the console output of the SUT.
-
Constructor Summary
Constructors Constructor Description ExternalSutController()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description List<AdditionalInfo>getAdditionalInfoList()abstract StringgetBaseURL()abstract String[]getInputParameters()abstract String[]getJVMParameters()abstract StringgetLogMessageOfInitializedServer()abstract longgetMaxAwaitForInitializationInSeconds()abstract StringgetPathToExecutableJar()List<TargetInfo>getTargetInfos(Collection<Integer> ids)UnitsInfoDtogetUnitsInfoDto()booleanisInstrumentationActivated()Check if bytecode instrumentation is on.booleanisSutRunning()Check if the system under test (SUT) is running and fully initializedvoidnewActionSpecificHandler(ActionDto dto)voidnewSearch()Re-initialize all internal data to enable a completely new search phase which should be independent from previous onesvoidnewTestSpecificHandler()abstract voidpostStart()This method is going to be called after the SUT is started.abstract voidpostStop()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.abstract voidpreStart()If the SUT needs some third-party processes (eg a non-embedded database), here they can be configured and started.abstract voidpreStop()This method is going to be called before the SUT is stopped.voidsetInstrumentation(boolean instrumentation)voidsetupForGeneratedTest()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.protected voidstartExternalProcessPrinter()StringstartSut()Start a new instance of the SUT.voidstopSut()Stop the SUT-
Methods inherited from class org.evomaster.client.java.controller.internal.SutController
computeExtraHeuristics, enableComputeSqlHeuristicsOrExtractExecution, execInsertionsIntoDatabase, getConnection, getControllerHost, getControllerPort, getControllerServerPort, getDatabaseDriverName, getExtraHeuristics, getInfoForAuthentication, getPackagePrefixesToCover, getPreferredOutputFormat, getProblemInfo, getSqlDatabaseSchema, getUnitsInfoDto, handleSql, initSqlHandler, newAction, newTest, resetExtraHeuristics, setControllerHost, setControllerPort, startTheControllerServer, stopTheControllerServer, verifySqlConnection
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.evomaster.client.java.controller.SutHandler
resetStateOfSUT
-
-
-
-
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
-
-
Method Detail
-
setupForGeneratedTest
public final void setupForGeneratedTest()
Description copied from interface:SutHandlerThere 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:SutHandlerStart 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:SutControllerCheck if the system under test (SUT) is running and fully initialized- Specified by:
isSutRunningin classSutController- Returns:
- true if the SUT is running
-
stopSut
public void stopSut()
Description copied from interface:SutHandlerStop the SUT
-
isInstrumentationActivated
public final boolean isInstrumentationActivated()
Description copied from class:SutControllerCheck if bytecode instrumentation is on.- Specified by:
isInstrumentationActivatedin classSutController- Returns:
- true if the instrumentation is on
-
newSearch
public final void newSearch()
Description copied from class:SutControllerRe-initialize all internal data to enable a completely new search phase which should be independent from previous ones- Specified by:
newSearchin classSutController
-
newTestSpecificHandler
public final void newTestSpecificHandler()
- Specified by:
newTestSpecificHandlerin classSutController
-
getTargetInfos
public final List<TargetInfo> getTargetInfos(Collection<Integer> ids)
- Specified by:
getTargetInfosin classSutController
-
getAdditionalInfoList
public final List<AdditionalInfo> getAdditionalInfoList()
- Specified by:
getAdditionalInfoListin classSutController- Returns:
- additional info for each action in the test. The list is ordered based on the action index.
-
newActionSpecificHandler
public final void newActionSpecificHandler(ActionDto dto)
- Specified by:
newActionSpecificHandlerin classSutController
-
getUnitsInfoDto
public final UnitsInfoDto getUnitsInfoDto()
- Specified by:
getUnitsInfoDtoin classSutController
-
startExternalProcessPrinter
protected void startExternalProcessPrinter()
-
-