Skip to content

Commit 4b3e9e9

Browse files
committed
Update all Mongo controllers
1 parent 150a941 commit 4b3e9e9

9 files changed

Lines changed: 72 additions & 58 deletions

File tree

jdk_11_gradle/em/embedded/rest/reservations-api/src/main/java/em/embedded/reservationsapi/EmbeddedEvoMasterController.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,5 +139,7 @@ public SutInfoDto.OutputFormat getPreferredOutputFormat() {
139139
return SutInfoDto.OutputFormat.JAVA_JUNIT_4;
140140
}
141141

142+
@Override
143+
public Object getMongoConnection() {return mongoClient;}
142144

143145
}

jdk_11_gradle/em/external/rest/reservations-api/src/main/java/em/external/reservationsapi/ExternalEvoMasterController.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,4 +185,9 @@ public List<AuthenticationDto> getInfoForAuthentication() {
185185
public List<DbSpecification> getDbSpecifications() {
186186
return null;
187187
}
188+
189+
@Override
190+
public Object getMongoConnection() {
191+
return mongoClient;
192+
}
188193
}

jdk_17_gradle/em/embedded/rest/bibliothek/src/main/java/em/embedded/bibliothek/EmbeddedEvoMasterController.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,5 +142,6 @@ public SutInfoDto.OutputFormat getPreferredOutputFormat() {
142142
return SutInfoDto.OutputFormat.JAVA_JUNIT_4;
143143
}
144144

145-
145+
@Override
146+
public Object getMongoConnection() {return mongoClient;}
146147
}

jdk_17_gradle/em/external/rest/bibliothek/src/main/java/em/external/bibliothek/ExternalEvoMasterController.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,4 +186,7 @@ public List<AuthenticationDto> getInfoForAuthentication() {
186186
public List<DbSpecification> getDbSpecifications() {
187187
return null;
188188
}
189+
190+
@Override
191+
public Object getMongoConnection() {return mongoClient;}
189192
}

jdk_8_maven/em/embedded/rest/genome-nexus/src/main/java/em/embedded/org/cbioportal/genome_nexus/EmbeddedEvoMasterController.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,5 +140,6 @@ public SutInfoDto.OutputFormat getPreferredOutputFormat() {
140140
return SutInfoDto.OutputFormat.JAVA_JUNIT_4;
141141
}
142142

143-
143+
@Override
144+
public Object getMongoConnection() {return mongoClient;}
144145
}

jdk_8_maven/em/embedded/rest/gestaohospital/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<modelVersion>4.0.0</modelVersion>
66

77
<properties>
8-
<mongo.version>3.12.10</mongo.version>
8+
<mongo.version>3.8.2</mongo.version>
99
</properties>
1010

1111
<artifactId>evomaster-benchmark-em-embedded-rest-gestaohospital</artifactId>

jdk_8_maven/em/embedded/rest/gestaohospital/src/main/java/em/embedded/br/com/codenation/hospital/EmbeddedEvoMasterController.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
package em.embedded.br.com.codenation.hospital;
22

33
import br.com.codenation.hospital.GestaohospitalarApplication;
4-
import com.mongodb.MongoClient;
4+
import com.mongodb.client.MongoClient;
5+
import com.mongodb.client.MongoClients;
56
import org.evomaster.client.java.controller.EmbeddedSutController;
67
import org.evomaster.client.java.controller.InstrumentedSutStarter;
78
import org.evomaster.client.java.controller.api.dto.AuthenticationDto;
@@ -40,13 +41,14 @@ public static void main(String[] args) {
4041

4142
private static final int MONGODB_PORT = 27017;
4243

43-
private static final String MONGODB_VERSION = "3.2";
44+
private static final String MONGODB_VERSION = "6.0";
4445

4546
private static final String MONGODB_DATABASE_NAME = "HospitalDB";
4647

4748
private static final GenericContainer mongodbContainer = new GenericContainer("mongo:" + MONGODB_VERSION)
4849
.withExposedPorts(MONGODB_PORT);
4950

51+
private MongoClient mongoClient;
5052

5153
public EmbeddedEvoMasterController() {
5254
this(0);
@@ -61,6 +63,7 @@ public EmbeddedEvoMasterController(int port) {
6163
public String startSut() {
6264

6365
mongodbContainer.start();
66+
mongoClient = MongoClients.create("mongodb://" + mongodbContainer.getContainerIpAddress() + ":" + mongodbContainer.getMappedPort(MONGODB_PORT));
6467

6568
ctx = SpringApplication.run(GestaohospitalarApplication.class,
6669
new String[]{"--server.port=0",
@@ -102,9 +105,6 @@ public String getPackagePrefixesToCover() {
102105

103106
@Override
104107
public void resetStateOfSUT() {
105-
MongoClient mongoClient = new MongoClient(mongodbContainer.getContainerIpAddress(),
106-
mongodbContainer.getMappedPort(MONGODB_PORT));
107-
108108
mongoClient.getDatabase(MONGODB_DATABASE_NAME).drop();
109109
}
110110

@@ -130,8 +130,6 @@ public List<AuthenticationDto> getInfoForAuthentication() {
130130
}
131131

132132

133-
134-
135133
@Override
136134
public ProblemInfo getProblemInfo() {
137135
return new RestProblem(
@@ -145,5 +143,8 @@ public SutInfoDto.OutputFormat getPreferredOutputFormat() {
145143
return SutInfoDto.OutputFormat.JAVA_JUNIT_4;
146144
}
147145

148-
146+
@Override
147+
public Object getMongoConnection() {
148+
return mongoClient;
149+
}
149150
}

jdk_8_maven/em/external/rest/genome-nexus/src/main/java/em/external/org/cbioportal/genome_nexus/ExternalEvoMasterController.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,5 +202,6 @@ public List<DbSpecification> getDbSpecifications() {
202202
return dbSpecification;
203203
}
204204

205-
205+
@Override
206+
public Object getMongoConnection() {return mongoClient;}
206207
}

scripts/dist.py

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -116,71 +116,71 @@ def build_jdk_8_maven():
116116
callMaven(folder, JAVA_HOME_8)
117117

118118
# Copy JAR files
119-
#copy(folder + "/cs/rest/original/features-service/target/features-service-sut.jar", DIST)
120-
#copy(folder + "/em/external/rest/features-service/target/features-service-evomaster-runner.jar", DIST)
119+
copy(folder + "/cs/rest/original/features-service/target/features-service-sut.jar", DIST)
120+
copy(folder + "/em/external/rest/features-service/target/features-service-evomaster-runner.jar", DIST)
121121

122-
#copy(folder + "/cs/rest/original/scout-api/api/target/scout-api-sut.jar", DIST)
123-
#copy(folder + "/em/external/rest/scout-api/target/scout-api-evomaster-runner.jar", DIST)
122+
copy(folder + "/cs/rest/original/scout-api/api/target/scout-api-sut.jar", DIST)
123+
copy(folder + "/em/external/rest/scout-api/target/scout-api-evomaster-runner.jar", DIST)
124124

125-
#copy(folder + "/cs/rest/original/proxyprint/target/proxyprint-sut.jar", DIST)
126-
#copy(folder + "/em/external/rest/proxyprint/target/proxyprint-evomaster-runner.jar", DIST)
125+
copy(folder + "/cs/rest/original/proxyprint/target/proxyprint-sut.jar", DIST)
126+
copy(folder + "/em/external/rest/proxyprint/target/proxyprint-evomaster-runner.jar", DIST)
127127

128-
#copy(folder + "/cs/rest/original/catwatch/catwatch-backend/target/catwatch-sut.jar", DIST)
129-
#copy(folder + "/em/external/rest/catwatch/target/catwatch-evomaster-runner.jar", DIST)
128+
copy(folder + "/cs/rest/original/catwatch/catwatch-backend/target/catwatch-sut.jar", DIST)
129+
copy(folder + "/em/external/rest/catwatch/target/catwatch-evomaster-runner.jar", DIST)
130130

131-
#copy(folder + "/cs/rest/artificial/ncs/target/rest-ncs-sut.jar", DIST)
132-
#copy(folder + "/em/external/rest/ncs/target/rest-ncs-evomaster-runner.jar", DIST)
131+
copy(folder + "/cs/rest/artificial/ncs/target/rest-ncs-sut.jar", DIST)
132+
copy(folder + "/em/external/rest/ncs/target/rest-ncs-evomaster-runner.jar", DIST)
133133

134-
#copy(folder + "/cs/rest/artificial/scs/target/rest-scs-sut.jar", DIST)
135-
#copy(folder + "/em/external/rest/scs/target/rest-scs-evomaster-runner.jar", DIST)
134+
copy(folder + "/cs/rest/artificial/scs/target/rest-scs-sut.jar", DIST)
135+
copy(folder + "/em/external/rest/scs/target/rest-scs-evomaster-runner.jar", DIST)
136136

137-
#copy(folder + "/cs/rest/artificial/news/target/rest-news-sut.jar", DIST)
138-
#copy(folder + "/em/external/rest/news/target/rest-news-evomaster-runner.jar", DIST)
137+
copy(folder + "/cs/rest/artificial/news/target/rest-news-sut.jar", DIST)
138+
copy(folder + "/em/external/rest/news/target/rest-news-evomaster-runner.jar", DIST)
139139

140-
#copy(folder + "/cs/rest-gui/ocvn/web/target/ocvn-rest-sut.jar", DIST)
141-
#copy(folder + "/em/external/rest/ocvn/target/ocvn-rest-evomaster-runner.jar", DIST)
140+
copy(folder + "/cs/rest-gui/ocvn/web/target/ocvn-rest-sut.jar", DIST)
141+
copy(folder + "/em/external/rest/ocvn/target/ocvn-rest-evomaster-runner.jar", DIST)
142142

143-
#copy(folder + "/cs/rest/original/languagetool/languagetool-server/target/languagetool-sut.jar", DIST)
144-
#copy(folder + "/em/external/rest/languagetool/target/languagetool-evomaster-runner.jar", DIST)
143+
copy(folder + "/cs/rest/original/languagetool/languagetool-server/target/languagetool-sut.jar", DIST)
144+
copy(folder + "/em/external/rest/languagetool/target/languagetool-evomaster-runner.jar", DIST)
145145

146-
#copy(folder + "/cs/rest/original/restcountries/target/restcountries-sut.jar", DIST)
147-
#copy(folder + "/em/external/rest/restcountries/target/restcountries-evomaster-runner.jar", DIST)
146+
copy(folder + "/cs/rest/original/restcountries/target/restcountries-sut.jar", DIST)
147+
copy(folder + "/em/external/rest/restcountries/target/restcountries-evomaster-runner.jar", DIST)
148148

149149
copy(folder + "/cs/rest-gui/gestaohospital/target/gestaohospital-rest-sut.jar", DIST)
150150
copy(folder + "/em/external/rest/gestaohospital/target/gestaohospital-rest-evomaster-runner.jar", DIST)
151151

152-
#copy(folder + "/cs/rest-gui/genome-nexus/web/target/genome-nexus-sut.jar", DIST)
153-
#copy(folder + "/em/external/rest/genome-nexus/target/genome-nexus-evomaster-runner.jar", DIST)
152+
copy(folder + "/cs/rest-gui/genome-nexus/web/target/genome-nexus-sut.jar", DIST)
153+
copy(folder + "/em/external/rest/genome-nexus/target/genome-nexus-evomaster-runner.jar", DIST)
154154

155-
#copy(folder + "/cs/graphql/petclinic-graphql/target/petclinic-graphql-sut.jar", DIST)
156-
#copy(folder + "/em/external/graphql/petclinic-graphql/target/petclinic-graphql-evomaster-runner.jar", DIST)
155+
copy(folder + "/cs/graphql/petclinic-graphql/target/petclinic-graphql-sut.jar", DIST)
156+
copy(folder + "/em/external/graphql/petclinic-graphql/target/petclinic-graphql-evomaster-runner.jar", DIST)
157157

158-
#copy(folder + "/cs/graphql/graphql-ncs/target/graphql-ncs-sut.jar", DIST)
159-
#copy(folder + "/em/external/graphql/graphql-ncs/target/graphql-ncs-evomaster-runner.jar", DIST)
158+
copy(folder + "/cs/graphql/graphql-ncs/target/graphql-ncs-sut.jar", DIST)
159+
copy(folder + "/em/external/graphql/graphql-ncs/target/graphql-ncs-evomaster-runner.jar", DIST)
160160

161-
#copy(folder + "/cs/graphql/graphql-scs/target/graphql-scs-sut.jar", DIST)
162-
#copy(folder + "/em/external/graphql/graphql-scs/target/graphql-scs-evomaster-runner.jar", DIST)
161+
copy(folder + "/cs/graphql/graphql-scs/target/graphql-scs-sut.jar", DIST)
162+
copy(folder + "/em/external/graphql/graphql-scs/target/graphql-scs-evomaster-runner.jar", DIST)
163163

164164
# thrift RPC
165-
#copy(folder + "/cs/rpc/thrift/artificial/thrift-ncs/target/rpc-thrift-ncs-sut.jar", DIST)
166-
#copy(folder + "/em/external/thrift/ncs/target/rpc-thrift-ncs-evomaster-runner.jar", DIST)
165+
copy(folder + "/cs/rpc/thrift/artificial/thrift-ncs/target/rpc-thrift-ncs-sut.jar", DIST)
166+
copy(folder + "/em/external/thrift/ncs/target/rpc-thrift-ncs-evomaster-runner.jar", DIST)
167167

168-
#copy(folder + "/cs/rpc/thrift/artificial/thrift-scs/target/rpc-thrift-scs-sut.jar", DIST)
169-
#copy(folder + "/em/external/thrift/scs/target/rpc-thrift-scs-evomaster-runner.jar", DIST)
168+
copy(folder + "/cs/rpc/thrift/artificial/thrift-scs/target/rpc-thrift-scs-sut.jar", DIST)
169+
copy(folder + "/em/external/thrift/scs/target/rpc-thrift-scs-evomaster-runner.jar", DIST)
170170

171171
# grpc RPC
172-
#copy(folder + "/cs/rpc/grpc/artificial/grpc-ncs/target/rpc-grpc-ncs-sut.jar", DIST)
173-
#copy(folder + "/em/external/grpc/ncs/target/rpc-grpc-ncs-evomaster-runner.jar", DIST)
172+
copy(folder + "/cs/rpc/grpc/artificial/grpc-ncs/target/rpc-grpc-ncs-sut.jar", DIST)
173+
copy(folder + "/em/external/grpc/ncs/target/rpc-grpc-ncs-evomaster-runner.jar", DIST)
174174

175-
#copy(folder + "/cs/rpc/grpc/artificial/grpc-scs/target/rpc-grpc-scs-sut.jar", DIST)
176-
#copy(folder + "/em/external/grpc/scs/target/rpc-grpc-scs-evomaster-runner.jar", DIST)
175+
copy(folder + "/cs/rpc/grpc/artificial/grpc-scs/target/rpc-grpc-scs-sut.jar", DIST)
176+
copy(folder + "/em/external/grpc/scs/target/rpc-grpc-scs-evomaster-runner.jar", DIST)
177177

178-
#ind0 = os.environ.get('SUT_LOCATION_IND0', '')
179-
#if ind0 == '':
180-
#print("\nWARN: SUT_LOCATION_IND0 env variable is not defined")
181-
#else:
182-
#copy(ind0, os.path.join(DIST, "ind0-sut.jar"))
183-
#copy(folder + "/em/external/rest/ind0/target/ind0-evomaster-runner.jar", DIST)
178+
ind0 = os.environ.get('SUT_LOCATION_IND0', '')
179+
if ind0 == '':
180+
print("\nWARN: SUT_LOCATION_IND0 env variable is not defined")
181+
else:
182+
copy(ind0, os.path.join(DIST, "ind0-sut.jar"))
183+
copy(folder + "/em/external/rest/ind0/target/ind0-evomaster-runner.jar", DIST)
184184

185185

186186
####################
@@ -355,10 +355,10 @@ def makeZip():
355355
prepareDistFolder()
356356

357357
build_jdk_8_maven()
358-
#build_jdk_11_maven()
359-
#build_jdk_17_maven()
360-
#build_jdk_11_gradle()
361-
#build_jdk_17_gradle()
358+
build_jdk_11_maven()
359+
build_jdk_17_maven()
360+
build_jdk_11_gradle()
361+
build_jdk_17_gradle()
362362

363363
## Those are disabled for now... might support back in the future
364364
# build_js_npm()

0 commit comments

Comments
 (0)