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 {
6464 assertTrue (getDatabaseFile ().isFile ());
6565 }
6666
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-
8167 private void executeGenerateJavaTask () throws Exception {
8268 GradleRunner gradleRunner = GradleRunner .create ();
8369 gradleRunner .forwardOutput ();
Original file line number Diff line number Diff line change @@ -64,20 +64,6 @@ private void createDatabase() throws Exception {
6464 assertTrue (getDatabaseFile ().isFile ());
6565 }
6666
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-
8167 private void executeGenerateJavaTask () throws Exception {
8268 GradleRunner gradleRunner = GradleRunner .create ();
8369 gradleRunner .forwardOutput ();
Original file line number Diff line number Diff line change @@ -58,20 +58,6 @@ private void createDatabase() throws Exception {
5858 assertTrue (getDatabaseFile ().isFile ());
5959 }
6060
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-
7561 private void executeGenerateJavaTask () throws Exception {
7662 GradleRunner gradleRunner = GradleRunner .create ();
7763 gradleRunner .forwardOutput ();
Original file line number Diff line number Diff line change @@ -58,20 +58,6 @@ private void createDatabase() throws Exception {
5858 assertTrue (getDatabaseFile ().isFile ());
5959 }
6060
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-
7561 private void executeGenerateJavaTask () throws Exception {
7662 GradleRunner gradleRunner = GradleRunner .create ();
7763 gradleRunner .forwardOutput ();
Original file line number Diff line number Diff line change @@ -64,20 +64,6 @@ private void createDatabase() throws Exception {
6464 assertTrue (getDatabaseFile ().isFile ());
6565 }
6666
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-
8167 private void executeGenerateJavaTask () throws Exception {
8268 GradleRunner gradleRunner = GradleRunner .create ();
8369 gradleRunner .forwardOutput ();
Original file line number Diff line number Diff line change @@ -61,6 +61,20 @@ protected void editGradleBuildFile() throws Exception {
6161 Files .writeString (getGradleBuildFile ().toPath (), gradleBuildFileContents .toString ());
6262 }
6363
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+
6478 protected String constructH2DatabaseDependencyLine () {
6579 return " implementation 'com.h2database:h2:" + System .getenv ("H2_VERSION" ) + "'" ;
6680 }
You can’t perform that action at this time.
0 commit comments