Skip to content

Commit e5d31ec

Browse files
committed
fix for DW issues
1 parent d7d9542 commit e5d31ec

4 files changed

Lines changed: 28 additions & 10 deletions

File tree

jdk_11_maven/em/embedded/graphql/timbuctoo/src/main/java/em/embedded/nl/knaw/huygens/EmbeddedEvoMasterController.java

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
package em.embedded.nl.knaw.huygens;
22

33

4+
import io.dropwizard.configuration.ResourceConfigurationSourceProvider;
5+
import io.dropwizard.setup.Bootstrap;
6+
import nl.knaw.huygens.timbuctoo.server.TimbuctooConfiguration;
47
import nl.knaw.huygens.timbuctoo.server.TimbuctooV4;
58
import org.evomaster.client.java.controller.AuthUtils;
69
import org.evomaster.client.java.controller.EmbeddedSutController;
@@ -16,10 +19,9 @@
1619
import java.nio.file.Files;
1720
import java.nio.file.Path;
1821
import java.nio.file.StandardCopyOption;
19-
import java.sql.Connection;
20-
import java.util.Collections;
2122
import java.util.List;
2223

24+
2325
/**
2426
* Class used to start/stop the SUT. This will be controller by the EvoMaster process
2527
*/
@@ -63,7 +65,8 @@ public String startSut() {
6365

6466
elasticsearch.start();
6567

66-
application = new TimbuctooV4();
68+
//application = new TimbuctooV4();
69+
application = new TimbuctooResource();
6770

6871
tmpFolder = "tmpFolder";
6972

@@ -74,7 +77,8 @@ public String startSut() {
7477
System.setProperty("dw.securityConfiguration.localAuthentication.permissionConfig",tmpFolder +"/permissionConfig.json");
7578
System.setProperty("dw.securityConfiguration.localAuthentication.loginsFilePath", tmpFolder+"/logins.json");
7679
System.setProperty("dw.securityConfiguration.localAuthentication.usersFilePath", tmpFolder + "/users.json");
77-
System.setProperty("dw.server.adminConnectors[0].port","8081");
80+
// System.setProperty("dw.server.adminConnectors[0].port","8081");
81+
// System.setProperty("dw.server.adminConnectors","[]");
7882
System.setProperty("dw.baseUri","http://localhost:0");
7983
System.setProperty("dw.collectionFilters.elasticsearch.hostname", "" + elasticsearch.getContainerIpAddress());
8084
System.setProperty("dw.collectionFilters.elasticsearch.port",""+elasticsearch.getMappedPort(9200));
@@ -88,7 +92,10 @@ public String startSut() {
8892

8993

9094
try {
91-
application.run("server", "em/embedded/graphql/timbuctoo/src/main/resources/timbuctoo_evomaster.yaml");
95+
application.run("server",
96+
//"em/embedded/graphql/timbuctoo/src/main/resources/timbuctoo_evomaster.yaml"
97+
"/timbuctoo_evomaster.yaml"
98+
);
9299
} catch (Exception e) {
93100
e.printStackTrace();
94101
return null;
@@ -188,3 +195,14 @@ private void deleteDir(File file) {
188195
}
189196
}
190197
}
198+
199+
200+
class TimbuctooResource extends TimbuctooV4{
201+
202+
@Override
203+
public void initialize(Bootstrap<TimbuctooConfiguration> bootstrap) {
204+
super.initialize(bootstrap);
205+
bootstrap.setConfigurationSourceProvider(new ResourceConfigurationSourceProvider());
206+
}
207+
208+
}

jdk_11_maven/em/embedded/graphql/timbuctoo/src/main/resources/timbuctoo_evomaster.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ server:
131131
applicationConnectors:
132132
- type: http #Note! if you change this you might or might not also want to change the baseUri
133133
# port: $#{timbuctoo_port} #Note! if you change this you might or might not also want to change the baseUri
134-
adminConnectors:
135-
- type: http
134+
adminConnectors: []
135+
#- type: http
136136
# port: $#{timbuctoo_adminPort}
137137
requestLog:
138138
appenders: [] #All requests are already logged using logging.LoggingFilter so the seperate requestlog is not needed

jdk_11_maven/em/external/graphql/timbuctoo/src/main/java/em/external/nl/knaw/huygens/ExternalEvoMasterController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public String[] getJVMParameters() {
131131
"-Ddw.securityConfiguration.localAuthentication.permissionConfig="+tmpFolder +"/permissionConfig.json",
132132
"-Ddw.securityConfiguration.localAuthentication.loginsFilePath="+tmpFolder+"/logins.json",
133133
"-Ddw.securityConfiguration.localAuthentication.usersFilePath="+tmpFolder + "/users.json",
134-
"-Ddw.server.adminConnectors[0].port="+(sutPort+1),
134+
// "-Ddw.server.adminConnectors[0].port="+(sutPort+1),
135135
"-Ddw.baseUri=http://localhost:0",
136136
"-Ddw.collectionFilters.elasticsearch.hostname="+elasticsearch.getContainerIpAddress(),
137137
"-Ddw.collectionFilters.elasticsearch.port="+elasticsearch.getMappedPort(9200),

jdk_11_maven/em/external/graphql/timbuctoo/src/main/resources/timbuctoo_evomaster.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ server:
131131
applicationConnectors:
132132
- type: http #Note! if you change this you might or might not also want to change the baseUri
133133
# port: $#{timbuctoo_port} #Note! if you change this you might or might not also want to change the baseUri
134-
adminConnectors:
135-
- type: http
134+
adminConnectors: []
135+
# - type: http
136136
# port: $#{timbuctoo_adminPort}
137137
requestLog:
138138
appenders: [] #All requests are already logged using logging.LoggingFilter so the seperate requestlog is not needed

0 commit comments

Comments
 (0)