コード例 #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());
  }