### Question:
Schema { public static String generateCreateIndexScript(Index index, DBType dbType) { StringBuilder sb = new StringBuilder("CREATE INDEX ").append(index).append(" ON ").append( index.column().table()).append("( " + index.column().columnName() + " )"); return sb.toString(); }  static String getDbDataType(Column column, DBType dbType); static String generateCreateTableScript(Table table, DBType dbType, List<Column> tableColumns); static String generateDropTableScript(Table table, DBType dbType); static String generateCreateIndexScript(Index index, DBType dbType); static boolean isHsqlConnection(Connection conn); static boolean isMySqlConnection(Connection conn);  }### Answer:
@Test public void testGenerateCreateScript() throws SQLException { Connection conn = getDirectConnection(); prepareDB(conn); ResultSet rs = conn.prepareStatement("SELECT COUNT(*) FROM " + TestTable.TEST_TABLE).executeQuery(); rs.next(); assertEquals(0, rs.getInt(1)); rs.close(); conn.prepareStatement( "INSERT INTO " + TestTable.TEST_TABLE + "(" + TestColumns.TEST_LONG + ", " + TestColumns.TEST_STRING + ")" + " VALUES(1, 'abcd')").executeUpdate(); rs = conn.prepareStatement("SELECT COUNT(*) FROM " + TestTable.TEST_TABLE).executeQuery(); rs.next(); assertEquals(1, rs.getInt(1)); rs.close(); boolean pkeyTest = false; try { conn.prepareStatement( "INSERT INTO " + TestTable.TEST_TABLE + "(" + TestColumns.TEST_LONG + ", " + TestColumns.TEST_STRING + ")" + " VALUES(1, 'abcd')").executeUpdate(); } catch (SQLException e) { pkeyTest = true; } assertEquals(true, pkeyTest); String indexStmt = Schema.generateCreateIndexScript(TestIndex.TEST_INDEX, DBType.HSQL); conn.prepareStatement(indexStmt).execute(); conn.prepareStatement("DROP TABLE " + TestTable.TEST_TABLE).execute(); dropSchema(conn); conn.close(); }