diff --git a/spring-batch-core/src/test/java/test/jdbc/datasource/DataSourceInitializer.java b/spring-batch-core/src/test/java/test/jdbc/datasource/DataSourceInitializer.java index 225e02195..2b9031f62 100644 --- a/spring-batch-core/src/test/java/test/jdbc/datasource/DataSourceInitializer.java +++ b/spring-batch-core/src/test/java/test/jdbc/datasource/DataSourceInitializer.java @@ -91,8 +91,10 @@ public class DataSourceInitializer implements InitializingBean { } private void doExecuteScript(final Resource scriptResource) { - if (scriptResource == null || !scriptResource.exists()) - return; + if (scriptResource == null || !scriptResource.exists()) { + throw new IllegalArgumentException("Script resource is null or does not exist"); + } + TransactionTemplate transactionTemplate = new TransactionTemplate(new DataSourceTransactionManager(dataSource)); transactionTemplate.execute(new TransactionCallback() { diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/launch/JobLauncherIntegrationTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/launch/JobLauncherIntegrationTests-context.xml index 3cc0a7735..8f42996a2 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/launch/JobLauncherIntegrationTests-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/launch/JobLauncherIntegrationTests-context.xml @@ -21,7 +21,8 @@ - schema-hsqldb.sql + org/springframework/batch/core/schema-drop-hsqldb.sql + org/springframework/batch/core/schema-hsqldb.sql