File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed
gradle/plugin/src/functionalTest/java/org/hibernate/tool/it/gradle Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -117,15 +117,18 @@ protected void createHibernatePropertiesFile() throws Exception {
117117 }
118118
119119 protected void createDatabase () throws Exception {
120- Connection connection = DriverManager .getConnection (constructJdbcConnectionString ());
121- Statement statement = connection .createStatement ();
122- for (String sql : getDatabaseCreationScript ()) {
123- statement .execute (sql );
120+ String [] sqls = getDatabaseCreationScript ();
121+ if ((sqls != null ) && (sqls .length > 0 )) {
122+ Connection connection = DriverManager .getConnection (constructJdbcConnectionString ());
123+ Statement statement = connection .createStatement ();
124+ for (String sql : sqls ) {
125+ statement .execute (sql );
126+ }
127+ statement .close ();
128+ connection .close ();
129+ assertTrue (getDatabaseFile ().exists ());
130+ assertTrue (getDatabaseFile ().isFile ());
124131 }
125- statement .close ();
126- connection .close ();
127- assertTrue (getDatabaseFile ().exists ());
128- assertTrue (getDatabaseFile ().isFile ());
129132 }
130133
131134 protected String constructH2DatabaseDependencyLine () {
You can’t perform that action at this time.
0 commit comments