polishing

This commit is contained in:
Juergen Hoeller
2010-08-07 16:52:16 +00:00
parent a8133a9917
commit 7cddb1c50e
2 changed files with 52 additions and 29 deletions

View File

@@ -1,18 +1,35 @@
/*
* Copyright 2002-2010 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.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.jdbc.datasource.init;
import static org.junit.Assert.assertEquals;
import java.sql.Connection;
import java.sql.SQLException;
import javax.sql.DataSource;
import static org.junit.Assert.*;
import org.junit.Test;
import org.springframework.core.io.ClassRelativeResourceLoader;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabase;
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;
/**
* @author Dave Syer
*/
public class DatabasePopulatorTests {
@Test
@@ -27,7 +44,8 @@ public class DatabasePopulatorTests {
Connection connection = db.getConnection();
try {
databasePopulator.populate(connection);
} finally {
}
finally {
connection.close();
}
assertDatabaseCreated(db);
@@ -39,4 +57,4 @@ public class DatabasePopulatorTests {
assertEquals("Keith", template.queryForObject("select NAME from T_TEST", String.class));
}
}
}