File tree Expand file tree Collapse file tree 6 files changed +14
-70
lines changed
gradle/plugin/src/functionalTest/java/org/hibernate/tool Expand file tree Collapse file tree 6 files changed +14
-70
lines changed Original file line number Diff line number Diff line change @@ -64,20 +64,6 @@ private void createDatabase() throws Exception {
64
64
assertTrue (getDatabaseFile ().isFile ());
65
65
}
66
66
67
- private void createHibernatePropertiesFile () throws Exception {
68
- File hibernatePropertiesFile = new File (getProjectDir (), "app/src/main/resources/hibernate.properties" );
69
- StringBuffer hibernatePropertiesFileContents = new StringBuffer ();
70
- hibernatePropertiesFileContents
71
- .append ("hibernate.connection.driver_class=org.h2.Driver\n " )
72
- .append ("hibernate.connection.url=" + constructJdbcConnectionString () + "\n " )
73
- .append ("hibernate.connection.username=\n " )
74
- .append ("hibernate.connection.password=\n " )
75
- .append ("hibernate.default_catalog=TEST\n " )
76
- .append ("hibernate.default_schema=PUBLIC\n " );
77
- Files .writeString (hibernatePropertiesFile .toPath (), hibernatePropertiesFileContents .toString ());
78
- assertTrue (hibernatePropertiesFile .exists ());
79
- }
80
-
81
67
private void executeGenerateJavaTask () throws Exception {
82
68
GradleRunner gradleRunner = GradleRunner .create ();
83
69
gradleRunner .forwardOutput ();
Original file line number Diff line number Diff line change @@ -64,20 +64,6 @@ private void createDatabase() throws Exception {
64
64
assertTrue (getDatabaseFile ().isFile ());
65
65
}
66
66
67
- private void createHibernatePropertiesFile () throws Exception {
68
- File hibernatePropertiesFile = new File (getProjectDir (), "app/src/main/resources/hibernate.properties" );
69
- StringBuffer hibernatePropertiesFileContents = new StringBuffer ();
70
- hibernatePropertiesFileContents
71
- .append ("hibernate.connection.driver_class=org.h2.Driver\n " )
72
- .append ("hibernate.connection.url=" + constructJdbcConnectionString () + "\n " )
73
- .append ("hibernate.connection.username=\n " )
74
- .append ("hibernate.connection.password=\n " )
75
- .append ("hibernate.default_catalog=TEST\n " )
76
- .append ("hibernate.default_schema=PUBLIC\n " );
77
- Files .writeString (hibernatePropertiesFile .toPath (), hibernatePropertiesFileContents .toString ());
78
- assertTrue (hibernatePropertiesFile .exists ());
79
- }
80
-
81
67
private void executeGenerateJavaTask () throws Exception {
82
68
GradleRunner gradleRunner = GradleRunner .create ();
83
69
gradleRunner .forwardOutput ();
Original file line number Diff line number Diff line change @@ -58,20 +58,6 @@ private void createDatabase() throws Exception {
58
58
assertTrue (getDatabaseFile ().isFile ());
59
59
}
60
60
61
- private void createHibernatePropertiesFile () throws Exception {
62
- File hibernatePropertiesFile = new File (getProjectDir (), "app/src/main/resources/hibernate.properties" );
63
- StringBuffer hibernatePropertiesFileContents = new StringBuffer ();
64
- hibernatePropertiesFileContents
65
- .append ("hibernate.connection.driver_class=org.h2.Driver\n " )
66
- .append ("hibernate.connection.url=" + constructJdbcConnectionString () + "\n " )
67
- .append ("hibernate.connection.username=\n " )
68
- .append ("hibernate.connection.password=\n " )
69
- .append ("hibernate.default_catalog=TEST\n " )
70
- .append ("hibernate.default_schema=PUBLIC\n " );
71
- Files .writeString (hibernatePropertiesFile .toPath (), hibernatePropertiesFileContents .toString ());
72
- assertTrue (hibernatePropertiesFile .exists ());
73
- }
74
-
75
61
private void executeGenerateJavaTask () throws Exception {
76
62
GradleRunner gradleRunner = GradleRunner .create ();
77
63
gradleRunner .forwardOutput ();
Original file line number Diff line number Diff line change @@ -58,20 +58,6 @@ private void createDatabase() throws Exception {
58
58
assertTrue (getDatabaseFile ().isFile ());
59
59
}
60
60
61
- private void createHibernatePropertiesFile () throws Exception {
62
- File hibernatePropertiesFile = new File (getProjectDir (), "app/src/main/resources/hibernate.properties" );
63
- StringBuffer hibernatePropertiesFileContents = new StringBuffer ();
64
- hibernatePropertiesFileContents
65
- .append ("hibernate.connection.driver_class=org.h2.Driver\n " )
66
- .append ("hibernate.connection.url=" + constructJdbcConnectionString () + "\n " )
67
- .append ("hibernate.connection.username=\n " )
68
- .append ("hibernate.connection.password=\n " )
69
- .append ("hibernate.default_catalog=TEST\n " )
70
- .append ("hibernate.default_schema=PUBLIC\n " );
71
- Files .writeString (hibernatePropertiesFile .toPath (), hibernatePropertiesFileContents .toString ());
72
- assertTrue (hibernatePropertiesFile .exists ());
73
- }
74
-
75
61
private void executeGenerateJavaTask () throws Exception {
76
62
GradleRunner gradleRunner = GradleRunner .create ();
77
63
gradleRunner .forwardOutput ();
Original file line number Diff line number Diff line change @@ -64,20 +64,6 @@ private void createDatabase() throws Exception {
64
64
assertTrue (getDatabaseFile ().isFile ());
65
65
}
66
66
67
- private void createHibernatePropertiesFile () throws Exception {
68
- File hibernatePropertiesFile = new File (getProjectDir (), "app/src/main/resources/hibernate.properties" );
69
- StringBuffer hibernatePropertiesFileContents = new StringBuffer ();
70
- hibernatePropertiesFileContents
71
- .append ("hibernate.connection.driver_class=org.h2.Driver\n " )
72
- .append ("hibernate.connection.url=" + constructJdbcConnectionString () + "\n " )
73
- .append ("hibernate.connection.username=\n " )
74
- .append ("hibernate.connection.password=\n " )
75
- .append ("hibernate.default_catalog=TEST\n " )
76
- .append ("hibernate.default_schema=PUBLIC\n " );
77
- Files .writeString (hibernatePropertiesFile .toPath (), hibernatePropertiesFileContents .toString ());
78
- assertTrue (hibernatePropertiesFile .exists ());
79
- }
80
-
81
67
private void executeGenerateJavaTask () throws Exception {
82
68
GradleRunner gradleRunner = GradleRunner .create ();
83
69
gradleRunner .forwardOutput ();
Original file line number Diff line number Diff line change @@ -61,6 +61,20 @@ protected void editGradleBuildFile() throws Exception {
61
61
Files .writeString (getGradleBuildFile ().toPath (), gradleBuildFileContents .toString ());
62
62
}
63
63
64
+ protected void createHibernatePropertiesFile () throws Exception {
65
+ File hibernatePropertiesFile = new File (getProjectDir (), "app/src/main/resources/hibernate.properties" );
66
+ StringBuffer hibernatePropertiesFileContents = new StringBuffer ();
67
+ hibernatePropertiesFileContents
68
+ .append ("hibernate.connection.driver_class=org.h2.Driver\n " )
69
+ .append ("hibernate.connection.url=" + constructJdbcConnectionString () + "\n " )
70
+ .append ("hibernate.connection.username=\n " )
71
+ .append ("hibernate.connection.password=\n " )
72
+ .append ("hibernate.default_catalog=TEST\n " )
73
+ .append ("hibernate.default_schema=PUBLIC\n " );
74
+ Files .writeString (hibernatePropertiesFile .toPath (), hibernatePropertiesFileContents .toString ());
75
+ assertTrue (hibernatePropertiesFile .exists ());
76
+ }
77
+
64
78
protected String constructH2DatabaseDependencyLine () {
65
79
return " implementation 'com.h2database:h2:" + System .getenv ("H2_VERSION" ) + "'" ;
66
80
}
You can’t perform that action at this time.
0 commit comments