@ -1,5 +1,5 @@
@@ -1,5 +1,5 @@
/ *
* Copyright 2002 - 2014 the original author or authors .
* Copyright 2002 - 2015 the original author or authors .
*
* Licensed under the Apache License , Version 2 . 0 ( the "License" ) ;
* you may not use this file except in compliance with the License .
@ -18,6 +18,7 @@ package org.springframework.jdbc.datasource.init;
@@ -18,6 +18,7 @@ package org.springframework.jdbc.datasource.init;
import java.sql.SQLException ;
import org.junit.Before ;
import org.junit.Test ;
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType ;
@ -28,8 +29,8 @@ import static org.springframework.jdbc.datasource.init.ScriptUtils.*;
@@ -28,8 +29,8 @@ import static org.springframework.jdbc.datasource.init.ScriptUtils.*;
* Integration tests for { @link ScriptUtils } .
*
* @author Sam Brannen
* @see ScriptUtilsUnitTests
* @since 4 . 0 . 3
* @see ScriptUtilsUnitTests
* /
public class ScriptUtilsIntegrationTests extends AbstractDatabaseInitializationTests {
@ -37,11 +38,23 @@ public class ScriptUtilsIntegrationTests extends AbstractDatabaseInitializationT
@@ -37,11 +38,23 @@ public class ScriptUtilsIntegrationTests extends AbstractDatabaseInitializationT
return EmbeddedDatabaseType . HSQL ;
}
@Before
public void setUpSchema ( ) throws SQLException {
executeSqlScript ( db . getConnection ( ) , usersSchema ( ) ) ;
}
@Test
public void executeSqlScriptContainingMuliLineComments ( ) throws SQLException {
executeSqlScript ( db . getConnection ( ) , usersSchema ( ) ) ;
executeSqlScript ( db . getConnection ( ) , resource ( "test-data-with-multi-line-comments.sql" ) ) ;
assertUsersDatabaseCreated ( "Hoeller" , "Brannen" ) ;
}
/ * *
* @since 4 . 2
* /
@Test
public void executeSqlScriptContainingSingleQuotesNestedInsideDoubleQuotes ( ) throws SQLException {
executeSqlScript ( db . getConnection ( ) , resource ( "users-data-with-single-quotes-nested-in-double-quotes.sql" ) ) ;
assertUsersDatabaseCreated ( "Hoeller" , "Brannen" ) ;
}