File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
gradle/plugin/src/functionalTest/java/org/hibernate/tool/gradle/test/func/utils Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 33import java .io .File ;
44import java .io .FileWriter ;
55import java .io .IOException ;
6+ import java .io .StringReader ;
7+ import java .io .StringWriter ;
68import java .io .Writer ;
79import java .net .URISyntaxException ;
810import java .nio .file .Files ;
11+ import java .util .Properties ;
912
1013import org .gradle .testkit .runner .BuildResult ;
1114import org .gradle .testkit .runner .GradleRunner ;
@@ -37,7 +40,16 @@ protected File getHibernatePropertiesFile() {
3740 }
3841
3942 protected String getHibernatePropertiesContents () {
40- return HIBERNATE_PROPERTIES_CONTENTS .replace ("${projectDir}" , projectDir .getAbsolutePath ());
43+ try {
44+ Properties properties = new Properties ();
45+ properties .load (new StringReader (HIBERNATE_PROPERTIES_CONTENTS ));
46+ properties .setProperty ("hibernate.connection.url" , "jdbc:h2:" + new File (projectDir , DATABASE_PATH ));
47+ StringWriter writer = new StringWriter ();
48+ properties .store (writer , null );
49+ return writer .toString ();
50+ } catch (IOException e ) {
51+ throw new RuntimeException (e );
52+ }
4153 }
4254
4355 protected void copyDatabase () {
You can’t perform that action at this time.
0 commit comments