Skip to content

Commit 9c36321

Browse files
committed
updated documentation + stubs for drivers
1 parent 18e2171 commit 9c36321

File tree

9 files changed

+182
-1
lines changed

9 files changed

+182
-1
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
5+
<parent>
6+
<groupId>org.evomaster</groupId>
7+
<artifactId>evomaster-benchmark-jdk17-em-embedded</artifactId>
8+
<version>1.6.2-SNAPSHOT</version>
9+
</parent>
10+
11+
<artifactId>evomaster-benchmark-jdk17-em-embedded-grpc</artifactId>
12+
<packaging>pom</packaging>
13+
14+
15+
<modules>
16+
<module>signal-registration</module>
17+
</modules>
18+
19+
</project>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<artifactId>evomaster-benchmark-jdk17-em-embedded-grpc-signal-registration</artifactId>
8+
<packaging>jar</packaging>
9+
10+
<parent>
11+
<groupId>org.evomaster</groupId>
12+
<artifactId>evomaster-benchmark-jdk17-em-embedded-grpc</artifactId>
13+
<version>1.6.2-SNAPSHOT</version>
14+
</parent>
15+
16+
17+
<dependencies>
18+
19+
<dependency>
20+
<groupId>org.evomaster</groupId>
21+
<artifactId>evomaster-client-java-dependencies</artifactId>
22+
<version>${evomaster-version}</version>
23+
<type>pom</type>
24+
<scope>test</scope>
25+
</dependency>
26+
</dependencies>
27+
28+
29+
30+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package em.embedded.org.signal.registration;
2+
3+
public class EmbeddedEvoMasterController {
4+
5+
//TODO
6+
}

jdk_17_maven/em/embedded/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
<modules>
1515
<module>web</module>
16+
<module>grpc</module>
1617
</modules>
1718

1819
</project>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
5+
<parent>
6+
<groupId>org.evomaster</groupId>
7+
<artifactId>evomaster-benchmark-jdk17-em-external</artifactId>
8+
<version>1.6.2-SNAPSHOT</version>
9+
</parent>
10+
11+
<artifactId>evomaster-benchmark-jdk17-em-external-grpc</artifactId>
12+
<packaging>pom</packaging>
13+
14+
15+
<modules>
16+
<module>signal-registration</module>
17+
</modules>
18+
19+
</project>
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<artifactId>evomaster-benchmark-jdk17-em-external-grpc-signal-registration</artifactId>
8+
<packaging>jar</packaging>
9+
10+
<parent>
11+
<groupId>org.evomaster</groupId>
12+
<artifactId>evomaster-benchmark-jdk17-em-external-grpc</artifactId>
13+
<version>1.6.2-SNAPSHOT</version>
14+
</parent>
15+
16+
17+
<dependencies>
18+
19+
</dependencies>
20+
21+
<build>
22+
<plugins>
23+
<plugin>
24+
<groupId>org.apache.maven.plugins</groupId>
25+
<artifactId>maven-shade-plugin</artifactId>
26+
<executions>
27+
<execution>
28+
<phase>package</phase>
29+
<goals>
30+
<goal>shade</goal>
31+
</goals>
32+
<configuration>
33+
<finalName>signal-registration-evomaster-runner</finalName>
34+
<transformers>
35+
<transformer
36+
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
37+
<manifestEntries>
38+
<Main-Class>em.external.org.signal.registration.ExternalEvoMasterController
39+
</Main-Class>
40+
<Premain-Class>org.evomaster.client.java.instrumentation.InstrumentingAgent
41+
</Premain-Class>
42+
<Agent-Class>org.evomaster.client.java.instrumentation.InstrumentingAgent
43+
</Agent-Class>
44+
<Can-Redefine-Classes>true</Can-Redefine-Classes>
45+
<Can-Retransform-Classes>true</Can-Retransform-Classes>
46+
</manifestEntries>
47+
</transformer>
48+
</transformers>
49+
</configuration>
50+
</execution>
51+
</executions>
52+
</plugin>
53+
</plugins>
54+
</build>
55+
56+
57+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package em.external.org.signal.registration;
2+
3+
public class ExternalEvoMasterController {
4+
5+
//TODO
6+
}

jdk_17_maven/em/external/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
<modules>
1515
<module>web</module>
16+
<module>grpc</module>
1617
</modules>
1718

1819
</project>

notes_adding_suts.txt

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,46 @@ As there are quite a few things to keep in mind, we list here the most important
7979
of the SUT under "cs", eg, "jdk_17_maven/cs/grpc/NAME" would lead to embedded driver be under
8080
"jdk_17_maven/em/embedded/grpc/NAME".
8181

82-
- TODO
82+
- Maven: the artifactId for the new modules follow the same convention of using same folder names separated with "-",
83+
eg "evomaster-benchmark-jdk17-em-embedded-NAME" for an embedded driver under JDK 17.
84+
85+
- EMBEDDED: the driver should be called "EmbeddedEvoMasterController", under the package "em.embedded.X", where X is the
86+
main package name of the SUT.
87+
Should be under "src/main" and not "src/test".
88+
The pom file needs to import 2 dependencies:
89+
1) EM dependencies
90+
2) SUT as a library
91+
Regarding (1), this should be done by default in the pom file of "jdk_X_Y/cs".
92+
If you make a new "jdk_X_Y", then you need to copy&paste from another top module (settings are the same).
93+
Note, you might still want to override some dependencies in case of library conflicts, eg, you can resolve some of
94+
those issues by redefining the dependency imports by using <exclusions> tags.
95+
Regarding (2), this might be problematic if the default settings of the SUT do build a uber JAR that use a custom
96+
classloader, ie, the typical case of SpringBoot applications (will need to check if same issues with other frameworks
97+
such as Micronaut).
98+
Solving this "might" (eg depending on SpringBoot version) require modifications to the pom.xml (in case of Maven) of the SUT.
99+
In particular, might need to remove the <parent> declaration, and rather include it as a pom import
100+
under the <dependencyManagement> (that would fix all version issues for dependencies, but not for plugins... which
101+
would need to be fixed manually).
102+
Then, in the plugin used for creating the uber JAR, need to make sure to still build the original JAR as well
103+
(so need 2 different names, default based on module for original, and modified name for uber JAR).
104+
Note: for the actual writing of the "EmbeddedEvoMasterController", you can see the EM documentation for it.
105+
106+
- EXTERNAL: first, need to make sure to build an uber JAR in the SUT.
107+
It MUST BE in the form "NAME-sut.jar". Eg, for SpringBoot you can have a setting like:
108+
<configuration>
109+
<finalName>NAME</finalName>
110+
<classifier>sut</classifier>
111+
</configuration>
112+
(btw, recall that NAME is just a placeholder for the actual name...)
113+
The driver "ExternalEvoMasterController" needs to be under the package "em.external.PACKAGE", in similar way as
114+
for embedded driver.
115+
Unfortunately, we currently have no documentation on how to write External Drivers.
116+
An important difference here is that we need to build an uber JAR of the driver itself, named NAME-evomaster-runner.jar.
117+
This is done with the "maven-shade-plugin" plugin (can copy&paste an existing one, and update names in it).
118+
Those JAR files are needed by "dist.py", discussed next, to be able to run experiments.
119+
120+
- Distribution: the "dist.py" file needs to be updated with the new API. Usually, this is just adding 2 lines, one in
121+
which NAME-sut.jar is copied over into the "dist" folder, and one for NAME-evomaster-runner.jar
122+
123+
- If the SUT is a REST API, need to add its OpenAPI schema into "openapi-swagger" folder
124+

0 commit comments

Comments
 (0)