public abstract class SutController extends Object implements SutHandler
| Constructor and Description |
|---|
SutController() |
| Modifier and Type | Method and Description |
|---|---|
ExtraHeuristicsDto |
computeExtraHeuristics() |
void |
enableComputeSqlHeuristicsOrExtractExecution(boolean enableSqlHeuristics,
boolean enableSqlExecution) |
void |
execInsertionsIntoDatabase(List<InsertionDto> insertions)
Execute the given data insertions into the database (if any)
|
abstract List<AdditionalInfo> |
getAdditionalInfoList() |
abstract Connection |
getConnection()
If the system under test (SUT) uses a SQL database, we need to have a
configured connection to access it.
|
String |
getControllerHost() |
int |
getControllerPort() |
int |
getControllerServerPort() |
abstract String |
getDatabaseDriverName()
If the system under test (SUT) uses a SQL database, we need to specify
the driver used to connect, eg.
|
List<ExtraHeuristicsDto> |
getExtraHeuristics() |
abstract List<AuthenticationDto> |
getInfoForAuthentication() |
abstract String |
getPackagePrefixesToCover()
a "," separated list of package prefixes or class names.
|
abstract SutInfoDto.OutputFormat |
getPreferredOutputFormat() |
abstract ProblemInfo |
getProblemInfo()
Depending of which kind of SUT we are dealing with (eg, REST, GraphQL or SPA frontend),
there is different info that must be provided
|
DbSchemaDto |
getSqlDatabaseSchema()
Extra information about the SQL Database Schema, if any is present.
|
abstract List<TargetInfo> |
getTargetInfos(Collection<Integer> ids) |
abstract UnitsInfoDto |
getUnitsInfoDto() |
protected UnitsInfoDto |
getUnitsInfoDto(UnitsInfoRecorder recorder) |
void |
handleSql(String sql)
Calculate heuristics based on intercepted SQL commands
|
void |
initSqlHandler()
This is needed only during test generation (not execution),
and it is automatically called by the EM controller after
the SUT is started.
|
abstract boolean |
isInstrumentationActivated()
Check if bytecode instrumentation is on.
|
abstract boolean |
isSutRunning()
Check if the system under test (SUT) is running and fully initialized
|
void |
newAction(ActionDto dto)
As some heuristics are based on which action (eg HTTP call, or click of button)
in the test sequence is executed, and their order, we need to keep track of which
action does cover what.
|
abstract void |
newActionSpecificHandler(ActionDto dto) |
abstract void |
newSearch()
Re-initialize all internal data to enable a completely new search phase
which should be independent from previous ones
|
void |
newTest()
Re-initialize some internal data needed before running a new test
|
abstract void |
newTestSpecificHandler() |
void |
resetExtraHeuristics() |
void |
setControllerHost(String controllerHost) |
void |
setControllerPort(int controllerPort) |
boolean |
startTheControllerServer()
Start the controller as a RESTful server.
|
boolean |
stopTheControllerServer() |
boolean |
verifySqlConnection()
Either there is no connection, or, if there is, then it must have P6Spy configured.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitresetStateOfSUT, setupForGeneratedTest, startSut, stopSutpublic final boolean startTheControllerServer()
public final boolean stopTheControllerServer()
public final int getControllerServerPort()
public final int getControllerPort()
public final void setControllerPort(int controllerPort)
public final String getControllerHost()
public final void setControllerHost(String controllerHost)
public void execInsertionsIntoDatabase(List<InsertionDto> insertions)
SutHandlerexecInsertionsIntoDatabase in interface SutHandlerinsertions - DTOs for each insertion to executepublic final void handleSql(String sql)
sql - command as a stringpublic final void enableComputeSqlHeuristicsOrExtractExecution(boolean enableSqlHeuristics,
boolean enableSqlExecution)
public final void initSqlHandler()
public final void resetExtraHeuristics()
public final List<ExtraHeuristicsDto> getExtraHeuristics()
public final ExtraHeuristicsDto computeExtraHeuristics()
public final DbSchemaDto getSqlDatabaseSchema()
getConnection()public final boolean verifySqlConnection()
public abstract void newSearch()
public final void newTest()
public final void newAction(ActionDto dto)
dto - the DTO with the information about the action (eg its index in the test)public abstract void newTestSpecificHandler()
public abstract void newActionSpecificHandler(ActionDto dto)
public abstract boolean isInstrumentationActivated()
public abstract boolean isSutRunning()
public abstract String getPackagePrefixesToCover()
public abstract List<AuthenticationDto> getInfoForAuthentication()
null if
* none is necessarypublic abstract Connection getConnection()
null if the SUT does not use any SQL databasepublic abstract String getDatabaseDriverName()
org.h2.Driver.
This is needed for when we intercept SQL commands with P6Spynull if the SUT does not use any SQL databasepublic abstract List<TargetInfo> getTargetInfos(Collection<Integer> ids)
public abstract List<AdditionalInfo> getAdditionalInfoList()
public abstract ProblemInfo getProblemInfo()
public abstract SutInfoDto.OutputFormat getPreferredOutputFormat()
public abstract UnitsInfoDto getUnitsInfoDto()
protected UnitsInfoDto getUnitsInfoDto(UnitsInfoRecorder recorder)
Copyright © 2016–2019. All rights reserved.