001    package liquibase.sqlgenerator.core;
002    
003    public abstract class CreateViewGeneratorTest {
004    //    @Test
005    //    public void execute_defaultSchema() throws Exception {
006    //        final String definition = "SELECT * FROM " + TABLE_NAME;
007    //
008    //        new DatabaseTestTemplate().testOnAvailableDatabases(
009    //                new SqlStatementDatabaseTest(null, new CreateViewStatement(null, VIEW_NAME, definition, false)) {
010    //                    protected void preExecuteAssert(DatabaseSnapshotGenerator snapshot) {
011    //                        assertNull(snapshot.getView(VIEW_NAME));
012    //                    }
013    //
014    //                    protected void postExecuteAssert(DatabaseSnapshotGenerator snapshot) {
015    //                        View view = snapshot.getView(VIEW_NAME);
016    //                        assertNotNull(view);
017    //                        assertEquals(2, view.getColumns().size());
018    //                    }
019    //
020    //                });
021    //    }
022    //
023    //    @Test
024    //    public void execute_altSchema() throws Exception {
025    //        final String definition = "SELECT * FROM " + TestContext.ALT_SCHEMA+"."+TABLE_NAME;
026    //        new DatabaseTestTemplate().testOnAvailableDatabases(
027    //                new SqlStatementDatabaseTest(TestContext.ALT_SCHEMA, new CreateViewStatement(TestContext.ALT_SCHEMA, VIEW_NAME, definition, false)) {
028    //                    protected boolean supportsTest(Database database) {
029    //                        return !(database instanceof HsqlDatabase  || database  instanceof H2Database || database instanceof OracleDatabase); //don't know why oracle isn't working
030    //                    }
031    //
032    //                    protected boolean expectedException(Database database, DatabaseException exception) {
033    //                        return !database.supportsSchemas();
034    //                    }
035    //
036    //                    protected void preExecuteAssert(DatabaseSnapshotGenerator snapshot) {
037    //                        assertNull(snapshot.getView(VIEW_NAME));
038    //                    }
039    //
040    //                    protected void postExecuteAssert(DatabaseSnapshotGenerator snapshot) {
041    //                        View view = snapshot.getView(VIEW_NAME);
042    //                        assertNotNull(view);
043    //                        assertEquals(2, view.getColumns().size());
044    //                    }
045    //
046    //                });
047    //    }
048    
049    }