View Javadoc

1   package liquibase.change.core;
2   
3   import liquibase.change.AbstractChangeTest;
4   import static org.junit.Assert.*;
5   import org.junit.Test;
6   
7   public abstract class CreateProcedureChangeTest extends AbstractChangeTest {
8   
9       @Override
10      @Test
11      public void getRefactoringName() throws Exception {
12          assertEquals("Create Procedure", new CreateProcedureChange().getChangeMetaData().getDescription());
13      }
14  
15  //    @Test
16  //    public void generateStatement() throws Exception {
17  //        new DatabaseTestTemplate().testOnAllDatabases(new DatabaseTest() {
18  //            public void performTest(Database database) throws Exception {
19  //                CreateProcedureChange change = new CreateProcedureChange();
20  //                change.setProcedureBody("CREATE PROC PROCBODY HERE");
21  //                change.setComments("Comments go here");
22  //
23  //                SqlStatement[] sqlStatements = change.generateStatements(database);
24  //                assertEquals(1, sqlStatements.length);
25  //                assertTrue(sqlStatements[0] instanceof RawSqlStatement);
26  //
27  //                assertEquals("CREATE PROC PROCBODY HERE", ((RawSqlStatement) sqlStatements[0]).getSqlStatement(database));
28  //
29  //                if (database instanceof OracleDatabase) {
30  //                    assertEquals("\n/", sqlStatements[0].getEndDelimiter(database));
31  //                } else {
32  //                    assertEquals(";", sqlStatements[0].getEndDelimiter(database));
33  //                }
34  //            }
35  //        });
36  //    }
37  
38      @Override
39      @Test
40      public void getConfirmationMessage() throws Exception {
41          CreateProcedureChange refactoring = new CreateProcedureChange();
42          assertEquals("Stored procedure created", refactoring.getConfirmationMessage());
43      }
44  }