Class EMController
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjavax.ws.rs.core.ResponsederiveParams(List<org.evomaster.client.java.controller.api.dto.problem.param.DerivedParamChangeReqDto> dtos) javax.ws.rs.core.ResponseexecuteDatabaseCommand(org.evomaster.client.java.controller.api.dto.database.operations.DatabaseCommandDto dto, javax.servlet.http.HttpServletRequest httpServletRequest) javax.ws.rs.core.ResponseexecuteMongoInsertion(org.evomaster.client.java.controller.api.dto.database.operations.MongoDatabaseCommandDto dto, javax.servlet.http.HttpServletRequest httpServletRequest) javax.ws.rs.core.ResponseexecuteRedisInsertion(org.evomaster.client.java.controller.api.dto.database.operations.RedisDatabaseCommandsDto dto, javax.servlet.http.HttpServletRequest httpServletRequest) Only used for debugging/testingjavax.ws.rs.core.ResponsegetControllerInfoDto(javax.servlet.http.HttpServletRequest httpServletRequest, String methodReplacementCategories) javax.ws.rs.core.ResponsegetSutInfo(javax.servlet.http.HttpServletRequest httpServletRequest) javax.ws.rs.core.ResponsegetTestResults(String idList, boolean killSwitch, boolean fullyCovered, boolean descriptiveIds, boolean queryFromDatabase, javax.servlet.http.HttpServletRequest httpServletRequest) Return the coverage of the test executed so far, plus the extra heuristics.javax.ws.rs.core.ResponsegetTestResultsWithIdsInBody(List<Integer> idList, boolean killSwitch, boolean fullyCovered, boolean descriptiveIds, boolean queryFromDatabase, javax.servlet.http.HttpServletRequest httpServletRequest) Same as the GET variant, but with the ids of the targets in the body payload instead of in the URI.javax.ws.rs.core.Responsejavax.ws.rs.core.ResponsenewAction(org.evomaster.client.java.controller.api.dto.ActionDto dto, boolean queryFromDatabase, javax.servlet.http.HttpServletRequest httpServletRequest) javax.ws.rs.core.ResponsenewSearch(javax.servlet.http.HttpServletRequest httpServletRequest) javax.ws.rs.core.ResponsepostSearchAction(org.evomaster.client.java.controller.api.dto.PostSearchActionDto dto, javax.servlet.http.HttpServletRequest httpServletRequest) static voidOnly used debugging/testingjavax.ws.rs.core.ResponserunSut(org.evomaster.client.java.controller.api.dto.SutRunDto dto, javax.servlet.http.HttpServletRequest httpServletRequest) javax.ws.rs.core.ResponsescheduleTasksCommand(org.evomaster.client.java.controller.api.dto.problem.rpc.ScheduleTaskInvocationsDto command, boolean killSwitch, boolean queryFromDatabase, javax.servlet.http.HttpServletRequest httpServletRequest)
-
Constructor Details
-
EMController
-
-
Method Details
-
getConnectedClientsSoFar
Only used for debugging/testing- Returns:
- host:port of all clients connected so far
-
resetConnectedClientsSoFar
public static void resetConnectedClientsSoFar()Only used debugging/testing -
getWarning
@Path("/") @GET @Produces("text/html") public javax.ws.rs.core.Response getWarning() -
getSutInfo
@Path("/infoSUT") @GET public javax.ws.rs.core.Response getSutInfo(@Context javax.servlet.http.HttpServletRequest httpServletRequest) -
getControllerInfoDto
@Path("/controllerInfo") @GET public javax.ws.rs.core.Response getControllerInfoDto(@Context javax.servlet.http.HttpServletRequest httpServletRequest, @QueryParam("methodReplacementCategories") String methodReplacementCategories) -
newSearch
@Path("/newSearch") @POST public javax.ws.rs.core.Response newSearch(@Context javax.servlet.http.HttpServletRequest httpServletRequest) -
postSearchAction
@Path("/postSearchAction") @POST @Consumes("application/json;charset=utf8;version=1") public javax.ws.rs.core.Response postSearchAction(org.evomaster.client.java.controller.api.dto.PostSearchActionDto dto, @Context javax.servlet.http.HttpServletRequest httpServletRequest) -
runSut
@Path("/runSUT") @PUT @Consumes("application/json;charset=utf8;version=1") public javax.ws.rs.core.Response runSut(org.evomaster.client.java.controller.api.dto.SutRunDto dto, @Context javax.servlet.http.HttpServletRequest httpServletRequest) -
getTestResults
@Path("/testResults") @GET public javax.ws.rs.core.Response getTestResults(@QueryParam("ids") @DefaultValue("") String idList, @QueryParam("killSwitch") @DefaultValue("false") boolean killSwitch, @QueryParam("fullyCovered") @DefaultValue("false") boolean fullyCovered, @QueryParam("descriptiveIds") @DefaultValue("false") boolean descriptiveIds, @QueryParam("queryFromDatabase") @DefaultValue("true") boolean queryFromDatabase, @Context javax.servlet.http.HttpServletRequest httpServletRequest) Return the coverage of the test executed so far, plus the extra heuristics.This is kept as the compatibility form of the endpoint. EvoMaster Core no longer calls it: it uses the POST variant below, because the ids of the targets do not always fit in a URI. It is still part of the public contract of the Driver, though, and is what any Core older than this change talks to. It is also the only form usable by hand, eg with curl, to inspect a running Driver.
Both forms share the exact same logic: see
computeTestResults(java.util.Set<java.lang.Integer>, boolean, boolean, boolean, boolean). -
getTestResultsWithIdsInBody
@Path("/testResults") @POST @Consumes("application/json") public javax.ws.rs.core.Response getTestResultsWithIdsInBody(List<Integer> idList, @QueryParam("killSwitch") @DefaultValue("false") boolean killSwitch, @QueryParam("fullyCovered") @DefaultValue("false") boolean fullyCovered, @QueryParam("descriptiveIds") @DefaultValue("false") boolean descriptiveIds, @QueryParam("queryFromDatabase") @DefaultValue("true") boolean queryFromDatabase, @Context javax.servlet.http.HttpServletRequest httpServletRequest) Same as the GET variant, but with the ids of the targets in the body payload instead of in the URI. This is the form EvoMaster Core uses.A search can easily end up asking for thousands of targets at once. Their ids do not fit in the request line: Jetty rejects with a 414 anything above 8192 bytes, well before the request reaches this class. Sending them in the body has no such limit.
A POST for what is a read is not great REST, but there is no alternative: a GET carrying a body cannot be sent by the HTTP client in use (the JDK rewrites the method to POST on its own as soon as anything is written to the connection).
- Parameters:
idList- the ids of the targets to return fitness score for. As in the GET variant, an empty (or missing) list means "return everything".
-
scheduleTasksCommand
@Path("/scheduleTasksCommand") @Consumes("application/json") @POST public javax.ws.rs.core.Response scheduleTasksCommand(org.evomaster.client.java.controller.api.dto.problem.rpc.ScheduleTaskInvocationsDto command, @QueryParam("killSwitch") @DefaultValue("false") boolean killSwitch, @QueryParam("queryFromDatabase") @DefaultValue("true") boolean queryFromDatabase, @Context javax.servlet.http.HttpServletRequest httpServletRequest) -
deriveParams
@Path("/deriveParams") @Consumes("application/json") @POST public javax.ws.rs.core.Response deriveParams(List<org.evomaster.client.java.controller.api.dto.problem.param.DerivedParamChangeReqDto> dtos) -
newAction
@Path("/newAction") @Consumes("application/json") @PUT public javax.ws.rs.core.Response newAction(org.evomaster.client.java.controller.api.dto.ActionDto dto, @QueryParam("queryFromDatabase") @DefaultValue("true") boolean queryFromDatabase, @Context javax.servlet.http.HttpServletRequest httpServletRequest) -
executeDatabaseCommand
@Path("/databaseCommand") @Consumes("application/json;charset=utf8;version=1") @POST public javax.ws.rs.core.Response executeDatabaseCommand(org.evomaster.client.java.controller.api.dto.database.operations.DatabaseCommandDto dto, @Context javax.servlet.http.HttpServletRequest httpServletRequest) -
executeMongoInsertion
@Path("/mongoInsertion") @Consumes("application/json;charset=utf8;version=1") @POST public javax.ws.rs.core.Response executeMongoInsertion(org.evomaster.client.java.controller.api.dto.database.operations.MongoDatabaseCommandDto dto, @Context javax.servlet.http.HttpServletRequest httpServletRequest) -
executeRedisInsertion
@Path("/redisInsertion") @Consumes("application/json;charset=utf8;version=1") @POST public javax.ws.rs.core.Response executeRedisInsertion(org.evomaster.client.java.controller.api.dto.database.operations.RedisDatabaseCommandsDto dto, @Context javax.servlet.http.HttpServletRequest httpServletRequest)
-