コード例 #1
0
ファイル: MigratorTest.java プロジェクト: rafaeldff/vraptor
 @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();
 }
コード例 #2
0
ファイル: MigratorTest.java プロジェクト: rafaeldff/vraptor
 @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();
 }
コード例 #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;
  }
コード例 #4
0
ファイル: DinoServer.java プロジェクト: jakent/Dinosaur
  public static void main(String... args) throws Exception {
    Migrations.migrate();
    System.out.println("DB Migrated");

    new DinoServer().start();
  }