Example #1
0
 @Test
 public void shouldDoNothingIfDatabaseHasAllMigrations() {
   mockery.checking(
       new Expectations() {
         {
           one(provider).getAppliedMigrations();
           will(returnValue(Arrays.asList("second", "first")));
         }
       });
   Migrations migrationsToApply = migrator.getMigrationsToApply();
   assertThat(migrationsToApply.size(), is(equalTo(0)));
   mockery.assertIsSatisfied();
 }
Example #2
0
 @Test
 public void shouldReturnNonExecutedMigrationsIfThereAreAnyPending() {
   mockery.checking(
       new Expectations() {
         {
           one(provider).getAppliedMigrations();
           will(returnValue(Arrays.asList("first")));
         }
       });
   Migrations migrationsToApply = migrator.getMigrationsToApply();
   assertThat(migrationsToApply.size(), is(equalTo(1)));
   assertThat(migrationsToApply.getAll().iterator().next(), is(equalTo(second)));
   mockery.assertIsSatisfied();
 }
Example #3
0
  public static List<AbstractMigrationRefactoring> forConcept(
      SNode callConcept, final SNode declarationConcept) {
    List<AbstractMigrationRefactoring> refactorings =
        ListSequence.fromList(new ArrayList<AbstractMigrationRefactoring>());

    MigrationConfig config = getMigrationConfig(callConcept, declarationConcept);
    ListSequence.fromList(refactorings)
        .addSequence(ListSequence.fromList(Migrations.migrateConcept(config)));
    ListSequence.fromList(refactorings)
        .addSequence(
            ListSequence.fromList(
                SpecialMigrations.migrateSpecializedLinkAccess(config, declarationConcept)));

    return refactorings;
  }
Example #4
0
  public static void main(String... args) throws Exception {
    Migrations.migrate();
    System.out.println("DB Migrated");

    new DinoServer().start();
  }