From: <max...@us...> - 2006-02-23 18:05:29
|
Update of /cvsroot/hibernate/HibernateExt/tools/src/test/org/hibernate/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15356/src/test/org/hibernate/tool Modified Files: JDBCMetaDataBinderTestCase.java Log Message: HBX-574 column exclude + fixed some tests Index: JDBCMetaDataBinderTestCase.java =================================================================== RCS file: /cvsroot/hibernate/HibernateExt/tools/src/test/org/hibernate/tool/JDBCMetaDataBinderTestCase.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- JDBCMetaDataBinderTestCase.java 6 Feb 2006 09:08:09 -0000 1.14 +++ JDBCMetaDataBinderTestCase.java 23 Feb 2006 18:05:22 -0000 1.15 @@ -67,7 +67,7 @@ * @param sqls * @throws SQLException */ - protected void executeDDL(String[] sqls) throws SQLException { + protected void executeDDL(String[] sqls, boolean ignoreErrors) throws SQLException { Configuration configuration = new Configuration(); Settings testSettings = configuration.buildSettings(); @@ -83,14 +83,18 @@ for (int i = 0; i < sqls.length; i++) { - String string = sqls[i]; - System.out.println("Execute: " + string); + String ddlsql = sqls[i]; + System.out.println("Execute: " + ddlsql); - try { - statement.execute(string); + try { + statement.execute(ddlsql); } - catch (SQLException se) { - throw se; + catch (SQLException se) { + if(ignoreErrors) { + System.err.println(se.toString() + " for " + ddlsql); + } else { + throw se; + } } } if (statement!=null) statement.close(); @@ -106,7 +110,7 @@ if(cfg==null) { // only do if we haven't done it before - to save time! try { - executeDDL(getDropSQL() ); + executeDDL(getDropSQL(), true); } catch (SQLException se) { System.err.println("Error while dropping - normally ok."); @@ -118,17 +122,14 @@ String[] sqls = getCreateSQL(); - executeDDL(sqls); + executeDDL(sqls, false); cfg.readFromJDBC(); } } - /* (non-Javadoc) - * @see junit.framework.TestCase#tearDown() - */ - protected void tearDown() throws Exception { - executeDDL(getDropSQL() ); + protected void tearDown() throws Exception { + executeDDL(getDropSQL(), true ); super.tearDown(); } /** |