Author: fuzzylogic Date: Thu Dec 13 00:53:31 2007 New Revision: 603855 URL: http://svn.apache.org/viewvc?rev=603855&view=rev Log: DERBY-2484: change test fixture testNoUserDDLOnSystemTables to use assertStatementError instead of try/catch blocks. Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/SystemCatalogTest.java Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/SystemCatalogTest.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/SystemCatalogTest.java?rev=603855&r1=603854&r2=603855&view=diff ============================================================================== --- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/SystemCatalogTest.java (original) +++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/SystemCatalogTest.java Thu Dec 13 00:53:31 2007 @@ -56,68 +56,17 @@ public void testNoUserDDLOnSystemTables() throws SQLException { Statement s = createStatement(); - try{ - s.executeUpdate("drop table sys.systables"); - } catch (SQLException e) - { - assertSQLState("X0Y56", e); - } + assertStatementError("X0Y56", s, "drop table sys.systables"); + assertStatementError("42X62", s, "drop index sys.sysaliases_index2"); + assertStatementError("42X62", s, "create index trash on sys.systables(tableid)"); + assertStatementError("42X62", s, "create table sys.usertable(c1 int)"); + assertStatementError("42X62", s, "create view sys.userview as select * from sys.systables"); + assertStatementError("42X62", s, "alter table sys.systables drop column tablename"); + assertStatementError("42X62", s, "alter table sys.systables add column foo int"); + assertStatementError("42X62", s, "alter table sys.systables alter column tablename null"); + assertStatementError("42X62", s, "alter table sys.systables drop primary key"); - try{ - s.executeUpdate("drop index sys.sysaliases_index2"); - } catch (SQLException e) - { - assertSQLState("42X62", e); - } - - try{ - s.executeUpdate("create index trash on sys.systables(tableid)"); - } catch (SQLException e) - { - assertSQLState("42X62", e); - } - - try{ - s.executeUpdate("create table sys.usertable(c1 int)"); - } catch (SQLException e) - { - assertSQLState("42X62", e); - } - - try{ - s.executeUpdate("create view sys.userview as select * from sys.systables"); - } catch (SQLException e) - { - assertSQLState("42X62", e); - } - - try{ - s.executeUpdate("alter table sys.systables drop column tablename"); - } catch (SQLException e) - { - assertSQLState("42X62", e); - } - - try{ - s.executeUpdate("alter table sys.systables add column foo int"); - } catch (SQLException e) - { - assertSQLState("42X62", e); - } - - try{ - s.executeUpdate("alter table sys.systables alter column tablename null"); - } catch (SQLException e) - { - assertSQLState("42X62", e); - } - - try{ - s.executeUpdate("alter table sys.systables drop primary key"); - } catch (SQLException e) - { - assertSQLState("42X62", e); - } + s.close(); } /**