Author: chatellier Date: 2011-03-17 10:28:18 +0000 (Thu, 17 Mar 2011) New Revision: 3166 Log: Use new topia migration service Added: isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/datastore/AutoMigrationIsisH2Config.java isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/datastore/migration/AutoDatabaseMigrationClass.java Removed: isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/datastore/TestIsisH2Config.java isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/datastore/migration/TestMigrationCallbackHandler.java Copied: isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/datastore/AutoMigrationIsisH2Config.java (from rev 3148, isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/datastore/TestIsisH2Config.java) =================================================================== --- isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/datastore/AutoMigrationIsisH2Config.java (rev 0) +++ isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/datastore/AutoMigrationIsisH2Config.java 2011-03-17 10:28:18 UTC (rev 3166) @@ -0,0 +1,47 @@ +/* + * #%L + * IsisFish + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2009 - 2010 Ifremer, CodeLutin + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-2.0.html>. + * #L% + */ + +package fr.ifremer.isisfish.datastore; + +import fr.ifremer.isisfish.datastore.migration.AutoDatabaseMigrationClass; + +/** + * Empty class used to access inherited static field. + * + * @author chatellier + * @version $Revision$ + * + * Last update : $Date$ + * By : $Author$ + */ +public class AutoMigrationIsisH2Config extends IsisH2Config { + + /** + * Override default migration with test one. + */ + public static void setTestMigrationCallBack() { + databaseMigrationClass = AutoDatabaseMigrationClass.class; + } +} Deleted: isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/datastore/TestIsisH2Config.java =================================================================== --- isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/datastore/TestIsisH2Config.java 2011-03-17 10:27:55 UTC (rev 3165) +++ isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/datastore/TestIsisH2Config.java 2011-03-17 10:28:18 UTC (rev 3166) @@ -1,50 +0,0 @@ -/* - * #%L - * IsisFish - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2009 - 2010 Ifremer, CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as - * published by the Free Software Foundation, either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/gpl-2.0.html>. - * #L% - */ - -package fr.ifremer.isisfish.datastore; - -import org.junit.Ignore; - -import fr.ifremer.isisfish.datastore.migration.TestMigrationCallbackHandler; - -/** - * Empty class used to access inherited static field. - * - * @author chatellier - * @version $Revision$ - * - * Last update : $Date$ - * By : $Author$ - */ - at Ignore -public class TestIsisH2Config extends IsisH2Config { - - /** - * Override default migration with test one. - */ - public static void setTestMigrationCallBack() { - databaseMigrationClass = TestMigrationCallbackHandler.class; - } -} Copied: isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/datastore/migration/AutoDatabaseMigrationClass.java (from rev 3148, isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/datastore/migration/TestMigrationCallbackHandler.java) =================================================================== --- isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/datastore/migration/AutoDatabaseMigrationClass.java (rev 0) +++ isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/datastore/migration/AutoDatabaseMigrationClass.java 2011-03-17 10:28:18 UTC (rev 3166) @@ -0,0 +1,51 @@ +/* + * #%L + * IsisFish + * + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2007 - 2011 Ifremer, CodeLutin, Chatellier Eric + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-2.0.html>. + * #L% + */ + +package fr.ifremer.isisfish.datastore.migration; + +import java.util.List; + +import org.nuiton.util.Version; + +/** + * Test migration callback for topia migration service. + * But for test purpose, don't ask user, always do migration. + * + * @author chatellier + * @version $Revision$ + * + * Last update : $Date$ + * By : $Author: chatellier $ + */ +public class AutoDatabaseMigrationClass extends DatabaseMigrationClass { + + /* + * @see org.nuiton.topia.migration.AbstractTopiaMigrationCallback#askUser(org.nuiton.util.Version, java.util.List) + */ + @Override + public boolean askUser(Version dbVersion, List<Version> versions) { + return true; + } +} Deleted: isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/datastore/migration/TestMigrationCallbackHandler.java =================================================================== --- isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/datastore/migration/TestMigrationCallbackHandler.java 2011-03-17 10:27:55 UTC (rev 3165) +++ isis-fish/branches/3.3.1/src/test/java/fr/ifremer/isisfish/datastore/migration/TestMigrationCallbackHandler.java 2011-03-17 10:28:18 UTC (rev 3166) @@ -1,55 +0,0 @@ -/* - * #%L - * IsisFish - * - * $Id$ - * $HeadURL$ - * %% - * Copyright (C) 2007 - 2010 Ifremer, CodeLutin - * %% - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as - * published by the Free Software Foundation, either version 2 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program. If not, see - * <http://www.gnu.org/licenses/gpl-2.0.html>. - * #L% - */ - -package fr.ifremer.isisfish.datastore.migration; - -import org.junit.Ignore; -import org.nuiton.topia.migration.DatabaseManager; - -/** - * Test migration callback for topia migration service. - * But for test purpose, don't ask user, always do migration. - * - * @author chatellier - * @version $Revision$ - * - * Last update : $Date$ - * By : $Author: chatellier $ - */ - at Ignore -public class TestMigrationCallbackHandler extends SwingMigrationCallbackHandler { - - /* - * @see org.nuiton.topia.migration.callback.MigrationCallbackHandler#doMigration(java.lang.String, java.lang.String) - */ - @Override - public MigrationChoice doMigration(DatabaseManager dbManager, - String dbVersion, String applicationVersion) { - - // test always perform migration without ask user - MigrationChoice result = migrate(dbManager, dbVersion, applicationVersion); - return result; - } -}