@Test public void testMigrate_previousVersion_LE_zero() { SchemaInfoTable schemaInfoTable = new SchemaInfoTable() { public int getVersionNo() { return 0; } public void setVersionNo(int versionNo) { } }; MigraterImpl migrater = new MigraterImpl(sqlUnitExecutor, schemaInfoTable, directory, "previous", "ut"); final List<File> dropFileList = new ArrayList<File>(); final List<File> createFileList = new ArrayList<File>(); migrater.migrate(new Migrater.Callback() { public void drop(SqlExecutionContext sqlExecutionContext, File file) { dropFileList.add(file); } public void create(SqlExecutionContext sqlExecutionContext, File file) { createFileList.add(file); } }); assertEquals(3, dropFileList.size()); File v000 = new File(baseDir, "v000"); File drop = new File(v000, "drop"); assertEquals(new File(drop, "aaa.sql"), dropFileList.get(0)); assertEquals(new File(drop, "bbb.sql"), dropFileList.get(1)); assertEquals(new File(drop, "ccc.sql"), dropFileList.get(2)); assertEquals(0, createFileList.size()); }
public void migrate(Callback callback) { int from = schemaInfoTable.getVersionNo(); int to = getDestVersion(from); logger.log("IS2JDBCGen0005", new Object[] { from, to }); migrateInternal(callback, from, to); logger.log("IS2JDBCGen0006", new Object[] { from, to }); }
MigraterImpl implements Migrater { public void migrate(Callback callback) { int from = schemaInfoTable.getVersionNo(); int to = getDestVersion(from); logger.log("IS2JDBCGen0005", new Object[] { from, to }); migrateInternal(callback, from, to); logger.log("IS2JDBCGen0006", new Object[] { from, to }); } }
MigraterImpl implements Migrater { public void migrate(Callback callback) { int from = schemaInfoTable.getVersionNo(); int to = getDestVersion(from); logger.log("IS2JDBCGen0005", new Object[] { from, to }); migrateInternal(callback, from, to); logger.log("IS2JDBCGen0006", new Object[] { from, to }); } MigraterImpl(SqlUnitExecutor sqlUnitExecutor,
            SchemaInfoTable schemaInfoTable,
            DdlVersionDirectoryTree ddlVersionDirectoryTree, String version,
            String env); }
MigraterImpl implements Migrater { public void migrate(Callback callback) { int from = schemaInfoTable.getVersionNo(); int to = getDestVersion(from); logger.log("IS2JDBCGen0005", new Object[] { from, to }); migrateInternal(callback, from, to); logger.log("IS2JDBCGen0006", new Object[] { from, to }); } MigraterImpl(SqlUnitExecutor sqlUnitExecutor,
            SchemaInfoTable schemaInfoTable,
            DdlVersionDirectoryTree ddlVersionDirectoryTree, String version,
            String env); void migrate(Callback callback); }
MigraterImpl implements Migrater { public void migrate(Callback callback) { int from = schemaInfoTable.getVersionNo(); int to = getDestVersion(from); logger.log("IS2JDBCGen0005", new Object[] { from, to }); migrateInternal(callback, from, to); logger.log("IS2JDBCGen0006", new Object[] { from, to }); } MigraterImpl(SqlUnitExecutor sqlUnitExecutor,
            SchemaInfoTable schemaInfoTable,
            DdlVersionDirectoryTree ddlVersionDirectoryTree, String version,
            String env); void migrate(Callback callback);  }