예제 #1
0
  @Override
  @Test
  public void getConfirmationMessage() throws Exception {
    refactoring.setOldTableName("OLD_NAME");
    refactoring.setNewTableName("NEW_NAME");

    assertEquals("Table OLD_NAME renamed to NEW_NAME", refactoring.getConfirmationMessage());
  }
예제 #2
0
  @Override
  @Test
  public void generateStatement() throws Exception {
    RenameTableChange refactoring = new RenameTableChange();
    refactoring.setSchemaName("SCHEMA_NAME");
    refactoring.setOldTableName("OLD_NAME");
    refactoring.setNewTableName("NEW_NAME");

    SqlStatement[] sqlStatements = refactoring.generateStatements(new MockDatabase());
    assertEquals(1, sqlStatements.length);
    assertTrue(sqlStatements[0] instanceof RenameTableStatement);
    assertEquals("SCHEMA_NAME", ((RenameTableStatement) sqlStatements[0]).getSchemaName());
    assertEquals("OLD_NAME", ((RenameTableStatement) sqlStatements[0]).getOldTableName());
    assertEquals("NEW_NAME", ((RenameTableStatement) sqlStatements[0]).getNewTableName());
  }
예제 #3
0
 @Override
 @Test
 public void getRefactoringName() throws Exception {
   assertEquals("Rename Table", refactoring.getChangeMetaData().getDescription());
 }