File tree 1 file changed +13
-1
lines changed
gradle/plugin/src/functionalTest/java/org/hibernate/tool/gradle/test/func/utils
1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 3
3
import java .io .File ;
4
4
import java .io .FileWriter ;
5
5
import java .io .IOException ;
6
+ import java .io .StringReader ;
7
+ import java .io .StringWriter ;
6
8
import java .io .Writer ;
7
9
import java .net .URISyntaxException ;
8
10
import java .nio .file .Files ;
11
+ import java .util .Properties ;
9
12
10
13
import org .gradle .testkit .runner .BuildResult ;
11
14
import org .gradle .testkit .runner .GradleRunner ;
@@ -37,7 +40,16 @@ protected File getHibernatePropertiesFile() {
37
40
}
38
41
39
42
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
+ }
41
53
}
42
54
43
55
protected void copyDatabase () {
You can’t perform that action at this time.
0 commit comments