Tony CHEMIT pushed to branch develop-7.x at ultreiaio / ird-observe Commits: f9bdec58 by tchemit at 2019-01-04T14:09:52Z Fix at last tests database generation + try to update a little longline test db :( - - - - - 7 changed files: - services-local/src/test/java/fr/ird/observe/services/local/service/sql/MigrateTestsDatabases.java - test/src/main/resources/db/6.0/dataForTestLongline.sql.gz - test/src/main/resources/db/7.0/dataForTestLongline.sql.gz - test/src/main/resources/db/7.0/dataForTestSeine.sql.gz - test/src/main/resources/db/7.0/empty_h2.sql.gz - test/src/main/resources/db/7.0/empty_pg.sql.gz - test/src/main/resources/db/7.0/referentiel.sql.gz Changes: ===================================== services-local/src/test/java/fr/ird/observe/services/local/service/sql/MigrateTestsDatabases.java ===================================== @@ -38,12 +38,15 @@ import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; import org.nuiton.topia.persistence.jdbc.JdbcH2Helper; +import org.nuiton.topia.persistence.script.SqlScriptReader; +import org.nuiton.topia.persistence.script.SqlScriptWriter; import org.nuiton.topia.persistence.script.TopiaSqlScript; import org.nuiton.version.Version; import java.io.File; import java.io.IOException; import java.nio.file.Files; +import java.nio.file.Path; /** * Created on 25/12/15. @@ -154,7 +157,18 @@ public class MigrateTestsDatabases extends ServiceLocalTestSupport { } Files.createDirectories(scriptFile.toPath().getParent()); - dump.copy(scriptFile.toPath()); + copy(dump, scriptFile.toPath()); + + } + + public void copy(TopiaSqlScript reader, Path target) throws IOException { + try (SqlScriptWriter scriptWriter = SqlScriptWriter.builder(target).gzip().keepCommentLine().keepEmptyLine().build()) { + try (SqlScriptReader scriptReader = reader.getLocation()) { + for (String statement : scriptReader) { + scriptWriter.writeSql(statement); + } + } + } } } ===================================== test/src/main/resources/db/6.0/dataForTestLongline.sql.gz ===================================== Binary files a/test/src/main/resources/db/6.0/dataForTestLongline.sql.gz and b/test/src/main/resources/db/6.0/dataForTestLongline.sql.gz differ ===================================== test/src/main/resources/db/7.0/dataForTestLongline.sql.gz ===================================== Binary files a/test/src/main/resources/db/7.0/dataForTestLongline.sql.gz and b/test/src/main/resources/db/7.0/dataForTestLongline.sql.gz differ ===================================== test/src/main/resources/db/7.0/dataForTestSeine.sql.gz ===================================== Binary files a/test/src/main/resources/db/7.0/dataForTestSeine.sql.gz and b/test/src/main/resources/db/7.0/dataForTestSeine.sql.gz differ ===================================== test/src/main/resources/db/7.0/empty_h2.sql.gz ===================================== Binary files a/test/src/main/resources/db/7.0/empty_h2.sql.gz and b/test/src/main/resources/db/7.0/empty_h2.sql.gz differ ===================================== test/src/main/resources/db/7.0/empty_pg.sql.gz ===================================== Binary files a/test/src/main/resources/db/7.0/empty_pg.sql.gz and b/test/src/main/resources/db/7.0/empty_pg.sql.gz differ ===================================== test/src/main/resources/db/7.0/referentiel.sql.gz ===================================== Binary files a/test/src/main/resources/db/7.0/referentiel.sql.gz and b/test/src/main/resources/db/7.0/referentiel.sql.gz differ View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/f9bdec587a89226058dcbce75183... -- View it on GitLab: https://gitlab.com/ultreiaio/ird-observe/commit/f9bdec587a89226058dcbce75183... You're receiving this email because of your account on gitlab.com.