Package org.rssowl.core.internal.persist.migration

Examples of org.rssowl.core.internal.persist.migration.Migrations$ChainedMigration


    ConfigurationFactory configFactory = new ConfigurationFactory() {
      public Configuration createConfiguration() {
        return DBManager.this.createConfiguration();
      }
    };
    Migration migration = new Migrations().getMigration(workspaceFormat, currentFormat);
    if (migration == null) {
      throw new PersistenceException("No migration found for originFormat: " + workspaceFormat + ", and destinationFormat: " + currentFormat);
    }

    /* Create a copy of the db file to use for the migration */
 
View Full Code Here


    ConfigurationFactory configFactory = new ConfigurationFactory() {
      public Configuration createConfiguration() {
        return DBManager.createConfiguration(false);
      }
    };
    Migration migration = new Migrations().getMigration(workspaceFormat, currentFormat);
    if (migration == null) {
      throw new PersistenceException("It was not possible to migrate your data to the current version of RSSOwl. Migrations are supported between final versions and between consecutive milestones. In other words, 2.0M7 to 2.0M8 and 2.0 to 2.1 are supported but 2.0M6 to 2.0M8 is not supported. In the latter case, you would need to launch 2.0M7 and then 2.0M8 to be able to use that version. Migration was attempted from originFormat: " + workspaceFormat + " to destinationFormat: " + currentFormat); //$NON-NLS-1$ //$NON-NLS-2$
    }

    final File dbFile = new File(getDBFilePath());
View Full Code Here

    ConfigurationFactory configFactory = new ConfigurationFactory() {
      public Configuration createConfiguration() {
        return DBManager.createConfiguration(false);
      }
    };
    Migration migration = new Migrations().getMigration(workspaceFormat, currentFormat);
    if (migration == null) {
      throw new PersistenceException("It was not possible to migrate your data to the current version of RSSOwl. Migrations are supported between final versions and between consecutive milestones. In other words, 2.0M7 to 2.0M8 and 2.0 to 2.1 are supported but 2.0M6 to 2.0M8 is not supported. In the latter case, you would need to launch 2.0M7 and then 2.0M8 to be able to use that version. Migration was attempted from originFormat: " + workspaceFormat + " to destinationFormat: " + currentFormat); //$NON-NLS-1$ //$NON-NLS-2$
    }

    final File dbFile = new File(getDBFilePath());
View Full Code Here

  /**
   * Test if no migration is possible
   */
  @Test
  public void testNoMigrationPossible() {
    Migrations migrations = new Migrations(new MigrationImpl(2, 3), new MigrationImpl(3, 4));
    Migration migration = migrations.getMigration(1, 4);
    assertNull(migration);
  }
View Full Code Here

  /**
   * Tests simple migration scenarios.
   */
  @Test
  public void testGetMigration() {
    Migrations migrations = new Migrations(new MigrationImpl(1, 2), new MigrationImpl(2, 3), new MigrationImpl(3, 4));
    Migration migration = migrations.getMigration(2, 4);
    assertEquals(ChainedMigration.class, migration.getClass());
    ChainedMigration chainedMigration = (ChainedMigration) migration;

    assertEquals(2, chainedMigration.getMigrations().size());
    assertEquals(migrations.getMigrations().get(1), chainedMigration.getMigrations().get(0));

    migration = migrations.getMigration(2, 3);
    assertFalse(migration instanceof ChainedMigration);
    assertEquals(migrations.getMigrations().get(1), migration);
  }
View Full Code Here

   * paths to the goal to make sure we choose the shortest one.
   */
  @Test
  public void testGetMigrationComplex() {
    /* More complex example */
    Migrations migrations = new Migrations(new MigrationImpl(1, 2), new MigrationImpl(2, 3),
        new MigrationImpl(3, 4), new MigrationImpl(4, 6), new MigrationImpl(3, 5),
        new MigrationImpl(2, 4), new MigrationImpl(5, 6), new MigrationImpl(7, 9),
        new MigrationImpl(7, 8), new MigrationImpl(8, 9), new MigrationImpl(6, 8));

    Migration migration = migrations.getMigration(2, 8);

    assertEquals(ChainedMigration.class, migration.getClass());
    ChainedMigration chainedMigration = (ChainedMigration) migration;
    assertEquals(3, chainedMigration.getMigrations().size());
    assertEquals(migrations.getMigrations().get(5), chainedMigration.getMigrations().get(0));
    assertEquals(migrations.getMigrations().get(3), chainedMigration.getMigrations().get(1));
    assertEquals(migrations.getMigrations().get(10), chainedMigration.getMigrations().get(2));
  }
View Full Code Here

TOP

Related Classes of org.rssowl.core.internal.persist.migration.Migrations$ChainedMigration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.