View Javadoc

1   package liquibase.sqlgenerator.core;
2   
3   public abstract class CreateViewGeneratorTest {
4   //    @Test
5   //    public void execute_defaultSchema() throws Exception {
6   //        final String definition = "SELECT * FROM " + TABLE_NAME;
7   //
8   //        new DatabaseTestTemplate().testOnAvailableDatabases(
9   //                new SqlStatementDatabaseTest(null, new CreateViewStatement(null, VIEW_NAME, definition, false)) {
10  //                    protected void preExecuteAssert(DatabaseSnapshotGenerator snapshot) {
11  //                        assertNull(snapshot.getView(VIEW_NAME));
12  //                    }
13  //
14  //                    protected void postExecuteAssert(DatabaseSnapshotGenerator snapshot) {
15  //                        View view = snapshot.getView(VIEW_NAME);
16  //                        assertNotNull(view);
17  //                        assertEquals(2, view.getColumns().size());
18  //                    }
19  //
20  //                });
21  //    }
22  //
23  //    @Test
24  //    public void execute_altSchema() throws Exception {
25  //        final String definition = "SELECT * FROM " + TestContext.ALT_SCHEMA+"."+TABLE_NAME;
26  //        new DatabaseTestTemplate().testOnAvailableDatabases(
27  //                new SqlStatementDatabaseTest(TestContext.ALT_SCHEMA, new CreateViewStatement(TestContext.ALT_SCHEMA, VIEW_NAME, definition, false)) {
28  //                    protected boolean supportsTest(Database database) {
29  //                        return !(database instanceof HsqlDatabase  || database  instanceof H2Database || database instanceof OracleDatabase); //don't know why oracle isn't working
30  //                    }
31  //
32  //                    protected boolean expectedException(Database database, DatabaseException exception) {
33  //                        return !database.supportsSchemas();
34  //                    }
35  //
36  //                    protected void preExecuteAssert(DatabaseSnapshotGenerator snapshot) {
37  //                        assertNull(snapshot.getView(VIEW_NAME));
38  //                    }
39  //
40  //                    protected void postExecuteAssert(DatabaseSnapshotGenerator snapshot) {
41  //                        View view = snapshot.getView(VIEW_NAME);
42  //                        assertNotNull(view);
43  //                        assertEquals(2, view.getColumns().size());
44  //                    }
45  //
46  //                });
47  //    }
48  
49  }