Skip to content

Commit 096f6a4

Browse files
committed
fix shared cache folder
1 parent 2c5f3c2 commit 096f6a4

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

jdk_8_maven/em/external/rest/catwatch/src/main/java/em/external/org/zalando/ExternalEvoMasterController.java

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import org.evomaster.client.java.controller.api.dto.SutInfoDto;
1313
import org.h2.tools.Server;
1414

15+
import java.nio.file.Paths;
1516
import java.sql.Connection;
1617
import java.sql.DriverManager;
1718
import java.sql.SQLException;
@@ -61,6 +62,7 @@ public static void main(String[] args) {
6162
private final int timeoutSeconds;
6263
private final int sutPort;
6364
private final int dbPort;
65+
private final String cacheDir;
6466
private String jarLocation;
6567
private Connection sqlConnection;
6668
private List<DbSpecification> dbSpecification;
@@ -82,6 +84,11 @@ public ExternalEvoMasterController(int controllerPort, String jarLocation, int s
8284
this.jarLocation = jarLocation;
8385
this.timeoutSeconds = timeoutSeconds;
8486
setControllerPort(controllerPort);
87+
88+
89+
String base = Paths.get(jarLocation).toAbsolutePath().getParent().normalize().toString();
90+
cacheDir = base + "/temp/tmp_catwatch/cache_" + dbPort;
91+
8592
setJavaCommand(command);
8693
}
8794

@@ -95,19 +102,18 @@ private String dbUrl( ) {
95102

96103
@Override
97104
public String[] getInputParameters() {
98-
return new String[]{};
105+
return new String[]{
106+
};
99107
}
100108

101109
public String[] getJVMParameters() {
102110
return new String[]{
103111
"-Dserver.port=" + sutPort,
104-
// "-Dspring.datasource.url=" + dbUrl(false) + ";DB_CLOSE_DELAY=-1",
105-
// "-Dspring.datasource.driver-class-name=" + getDatabaseDriverName(),
106-
//FIXME: re-enable once fixed issue with Spring
107112
"-Dspring.datasource.url=" + dbUrl() + ";DB_CLOSE_DELAY=-1",
108113
"-Dspring.jpa.database-platform=org.hibernate.dialect.H2Dialect",
109114
"-Dspring.datasource.username=sa",
110-
"-Dspring.datasource.password"
115+
"-Dspring.datasource.password",
116+
"-Dcache.path="+cacheDir
111117
};
112118
}
113119

0 commit comments

Comments
 (0)