1 package liquibase.sqlgenerator.core; 2 3 public abstract class CreateSequenceGeneratorTest { 4 // // @Test 5 //// public void supports() throws Exception { 6 //// new DatabaseTestTemplate().testOnAvailableDatabases(new DatabaseTest() { 7 //// public void performTest(Database database) throws Exception { 8 //// if (database.supportsSequences()) { 9 //// assertTrue(createGeneratorUnderTest().supportsDatabase(database)); 10 //// } else { 11 //// assertFalse(createGeneratorUnderTest().supportsDatabase(database)); 12 //// } 13 //// } 14 //// }); 15 //// } 16 // 17 // @Test 18 // public void execute() throws Exception { 19 // new DatabaseTestTemplate().testOnAvailableDatabases( 20 // new SqlStatementDatabaseTest(null, new CreateSequenceStatement(null, SEQ_NAME)) { 21 // protected void preExecuteAssert(DatabaseSnapshotGenerator snapshot) { 22 // assertNull(snapshot.getSequence(SEQ_NAME)); 23 // } 24 // 25 // protected void postExecuteAssert(DatabaseSnapshotGenerator snapshot) { 26 // assertNotNull(snapshot.getSequence(SEQ_NAME)); 27 // } 28 // }); 29 // } 30 // 31 // @Test 32 // public void execute_withSchema() throws Exception { 33 // new DatabaseTestTemplate().testOnAvailableDatabases( 34 // new SqlStatementDatabaseTest(TestContext.ALT_SCHEMA, new CreateSequenceStatement(TestContext.ALT_SCHEMA, SEQ_NAME)) { 35 // protected void preExecuteAssert(DatabaseSnapshotGenerator snapshot) { 36 // assertNull(snapshot.getSequence(SEQ_NAME)); 37 // } 38 // 39 // protected void postExecuteAssert(DatabaseSnapshotGenerator snapshot) { 40 // assertNotNull(snapshot.getSequence(SEQ_NAME)); 41 // } 42 // }); 43 // } 44 // 45 // @Test 46 // public void execute_startValue() throws Exception { 47 // new DatabaseTestTemplate().testOnAvailableDatabases( 48 // new SqlStatementDatabaseTest(null, new CreateSequenceStatement(null, SEQ_NAME).setStartValue(1000)) { 49 // 50 // protected boolean expectedException(Database database, DatabaseException exception) { 51 // return database instanceof FirebirdDatabase; 52 // } 53 // 54 // protected void preExecuteAssert(DatabaseSnapshotGenerator snapshot) { 55 // assertNull(snapshot.getSequence(SEQ_NAME)); 56 // } 57 // 58 // protected void postExecuteAssert(DatabaseSnapshotGenerator snapshot) { 59 // assertNotNull(snapshot.getSequence(SEQ_NAME)); 60 // //todo: assert start value 61 // } 62 // }); 63 // } 64 // 65 // @Test 66 // public void execute_incrementBy() throws Exception { 67 // new DatabaseTestTemplate().testOnAvailableDatabases( 68 // new SqlStatementDatabaseTest(null, new CreateSequenceStatement(null, SEQ_NAME).setIncrementBy(5)) { 69 // 70 // protected boolean expectedException(Database database, DatabaseException exception) { 71 // return database instanceof FirebirdDatabase; 72 // } 73 // 74 // protected void preExecuteAssert(DatabaseSnapshotGenerator snapshot) { 75 // assertNull(snapshot.getSequence(SEQ_NAME)); 76 // } 77 // 78 // protected void postExecuteAssert(DatabaseSnapshotGenerator snapshot) { 79 // assertNotNull(snapshot.getSequence(SEQ_NAME)); 80 // //todo: assert increment by value 81 // } 82 // 83 // }); 84 // } 85 // 86 // @Test 87 // public void execute_minValue() throws Exception { 88 // new DatabaseTestTemplate().testOnAvailableDatabases( 89 // new SqlStatementDatabaseTest(null, new CreateSequenceStatement(null, SEQ_NAME).setMinValue(15)) { 90 // 91 // protected boolean expectedException(Database database, DatabaseException exception) { 92 // return database instanceof FirebirdDatabase || database instanceof HsqlDatabase || database instanceof H2Database; 93 // } 94 // 95 // protected void preExecuteAssert(DatabaseSnapshotGenerator snapshot) { 96 // assertNull(snapshot.getSequence(SEQ_NAME)); 97 // } 98 // 99 // protected void postExecuteAssert(DatabaseSnapshotGenerator snapshot) { 100 // assertNotNull(snapshot.getSequence(SEQ_NAME)); 101 // //todo: assert min valuevalue 102 // } 103 // }); 104 // } 105 // 106 // @Test 107 // public void execute_maxValue() throws Exception { 108 // new DatabaseTestTemplate().testOnAvailableDatabases(new SqlStatementDatabaseTest(null, new CreateSequenceStatement(null, SEQ_NAME).setMaxValue(50)) { 109 // 110 // protected boolean expectedException(Database database, DatabaseException exception) { 111 // return database instanceof FirebirdDatabase || database instanceof HsqlDatabase || database instanceof H2Database; 112 // } 113 // 114 // protected void preExecuteAssert(DatabaseSnapshotGenerator snapshot) { 115 // assertNull(snapshot.getSequence(SEQ_NAME)); 116 // } 117 // 118 // protected void postExecuteAssert(DatabaseSnapshotGenerator snapshot) { 119 // assertNotNull(snapshot.getSequence(SEQ_NAME)); 120 // //todo: assert max value 121 // } 122 // }); 123 // } 124 // 125 // @Test 126 // public void execute_order() throws Exception { 127 // new DatabaseTestTemplate().testOnAvailableDatabases(new SqlStatementDatabaseTest(null, new CreateSequenceStatement(null, SEQ_NAME).setOrdered(true)) { 128 // protected boolean expectedException(Database database, DatabaseException exception) { 129 // return !(database instanceof OracleDatabase || database instanceof DB2Database); 130 // } 131 // 132 // protected void preExecuteAssert(DatabaseSnapshotGenerator snapshot) { 133 // assertNull(snapshot.getSequence(SEQ_NAME)); 134 // } 135 // 136 // protected void postExecuteAssert(DatabaseSnapshotGenerator snapshot) { 137 // assertNotNull(snapshot.getSequence(SEQ_NAME)); 138 // //todo: assert max value 139 // } 140 // }); 141 // } 142 }