Skip to content

Commit e8faf59

Browse files
committed
HBX-2889: Write project path using Properties to fix functional tests on Windows
1 parent 9687f50 commit e8faf59

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

gradle/plugin/src/functionalTest/java/org/hibernate/tool/gradle/test/func/utils/FuncTestTemplate.java

+10-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,16 @@ protected File getHibernatePropertiesFile() {
3737
}
3838

3939
protected String getHibernatePropertiesContents() {
40-
return HIBERNATE_PROPERTIES_CONTENTS.replace("${projectDir}", projectDir.getAbsolutePath());
40+
try {
41+
Properties properties = new Properties();
42+
properties.load(new StringReader(HIBERNATE_PROPERTIES_CONTENTS));
43+
properties.setProperty("hibernate.connection.url", "jdbc:h2:" + new File(projectDir, DATABASE_PATH));
44+
StringWriter writer = new StringWriter();
45+
properties.store(writer, null);
46+
return writer.toString();
47+
} catch (IOException e) {
48+
throw new RuntimeException(e);
49+
}
4150
}
4251

4352
protected void copyDatabase() {

0 commit comments

Comments
 (0)