Skip to content

Commit ffdfa2a

Browse files
committed
Merge branch 'master' of https://github.com/EMResearch/EvoMaster into named-examples
# Conflicts: # core-tests/e2e-tests/spring/spring-rest-mongo/src/test/java/org/evomaster/e2etests/spring/rest/mongo/findoneby/MongoFindOneByEMTest.java
2 parents d28bba4 + c51be54 commit ffdfa2a

133 files changed

Lines changed: 3065 additions & 318 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ experiments/target/
5151

5252
/core-tests/e2e-tests/spring/spring-rest-openapi-v3/target
5353
/core-tests/e2e-tests/spring/spring-graphql/target
54+
/core-tests/e2e-tests/spring/spring-mcp-bb/target/
5455
/core-tests/e2e-tests/ci-utils/target
5556

5657
/core-tests/core-it/target/

client-java/controller-api/src/main/java/org/evomaster/client/java/controller/api/ControllerConstants.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ public class ControllerConstants {
3030

3131
public static final String MONGO_INSERTION = "/mongoInsertion";
3232

33+
public static final String REDIS_INSERTION = "/redisInsertion";
34+
3335
public static final String POST_SEARCH_ACTION = "/postSearchAction";
3436

3537
public static final String DERIVE_PARAMS = "/deriveParams";

client-java/controller-api/src/main/java/org/evomaster/client/java/controller/api/dto/ExtraHeuristicsDto.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.evomaster.client.java.controller.api.dto;
22

3+
import org.evomaster.client.java.controller.api.dto.database.execution.RedisExecutionsDto;
34
import org.evomaster.client.java.controller.api.dto.database.execution.SqlExecutionsDto;
45
import org.evomaster.client.java.controller.api.dto.database.execution.MongoExecutionsDto;
56
import java.util.ArrayList;
@@ -21,4 +22,6 @@ public class ExtraHeuristicsDto {
2122
public SqlExecutionsDto sqlSqlExecutionsDto;
2223

2324
public MongoExecutionsDto mongoExecutionsDto;
25+
26+
public RedisExecutionsDto redisExecutionsDto;
2427
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package org.evomaster.client.java.controller.api.dto.database.execution;
2+
3+
import java.util.ArrayList;
4+
import java.util.List;
5+
6+
/**
7+
* Each time a Redis command is executed, we keep track of those that return no data.
8+
* This class summarizes every failed command in a given execution.
9+
*/
10+
public class RedisExecutionsDto {
11+
12+
public RedisExecutionsDto() {}
13+
14+
public List<RedisFailedCommand> failedCommands = new ArrayList<>();
15+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package org.evomaster.client.java.controller.api.dto.database.execution;
2+
3+
/**
4+
* Each time a Redis command is executed and returns no data, we keep track of which keys were involved,
5+
* as well as relevant information such as the command type.
6+
*/
7+
public class RedisFailedCommand {
8+
9+
/**
10+
* Command keyword. Corresponds to a RedisCommandType label.
11+
*/
12+
public String command;
13+
14+
/**
15+
* Command type. Corresponds to a RedisCommandType dataType.
16+
*/
17+
public String type;
18+
19+
/**
20+
* Key involved. Could be null if the command does not have a key in the arguments. For example: KEYS (pattern).
21+
*/
22+
public String key;
23+
24+
public RedisFailedCommand() {}
25+
26+
public RedisFailedCommand(String command, String key, String type) {
27+
this.command = command;
28+
this.key = key;
29+
this.type = type;
30+
}
31+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package org.evomaster.client.java.controller.api.dto.database.operations;
2+
3+
import java.util.ArrayList;
4+
import java.util.List;
5+
6+
/**
7+
* Class used to execute Redis commands.
8+
* Each item in the insertions list corresponds to a command to be executed.
9+
*/
10+
public class RedisDatabaseCommandsDto {
11+
public List<RedisInsertionDto> insertions = new ArrayList<>();
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package org.evomaster.client.java.controller.api.dto.database.operations;
2+
3+
/**
4+
* Contains data to be inserted into Redis.
5+
*/
6+
public class RedisInsertionDto {
7+
8+
/** The Redis key.*/
9+
public String key;
10+
11+
/** The serialized value to set for that key. */
12+
public String value;
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package org.evomaster.client.java.controller.api.dto.database.operations;
2+
3+
import java.util.List;
4+
5+
/**
6+
* The execution result of {@link RedisDatabaseCommandsDto} that performs insertions.
7+
*/
8+
public class RedisInsertionResultsDto {
9+
10+
public RedisInsertionResultsDto() {}
11+
12+
/**
13+
* Whether the insertion at the index of a sequence of Redis insertions (i.e., {@link RedisDatabaseCommandsDto#insertions})
14+
* executed successfully.
15+
*/
16+
public List<Boolean> executionResults;
17+
}

client-java/controller/src/main/java/org/evomaster/client/java/controller/EmbeddedSutController.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,11 @@ public final void setExecutingInitMongo(boolean executingInitMongo) {
114114
ExecutionTracer.setExecutingInitMongo(executingInitMongo);
115115
}
116116

117+
@Override
118+
public final void setExecutingInitRedis(boolean executingInitRedis) {
119+
ExecutionTracer.setExecutingInitRedis(executingInitRedis);
120+
}
121+
117122
@Override
118123
public final void setExecutingAction(boolean executingAction){
119124
ExecutionTracer.setExecutingAction(executingAction);

client-java/controller/src/main/java/org/evomaster/client/java/controller/ExternalSutController.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,14 @@ public final void setExecutingInitMongo(boolean executingInitMongo) {
522522
ExecutionTracer.setExecutingInitMongo(executingInitMongo);
523523
}
524524

525+
@Override
526+
public final void setExecutingInitRedis(boolean executingInitRedis) {
527+
checkInstrumentation();
528+
serverController.setExecutingInitRedis(executingInitRedis);
529+
// sync executingInitRedis on the local ExecutionTracer
530+
ExecutionTracer.setExecutingInitRedis(executingInitRedis);
531+
}
532+
525533
@Override
526534
public final void setExecutingAction(boolean executingAction){
527535
checkInstrumentation();

0 commit comments

Comments
 (0)