Tag: cws_src680_qiq User: fs Date: 2006/06/27 13:37:19 Modified: dba/dbaccess/qa/complex/dbaccess/QueryInQuery.java
Log: #i51143# more tests File Changes: Directory: /dba/dbaccess/qa/complex/dbaccess/ ============================================= File [changed]: QueryInQuery.java Url: http://dba.openoffice.org/source/browse/dba/dbaccess/qa/complex/dbaccess/QueryInQuery.java?r1=1.1.2.2&r2=1.1.2.3 Delta lines: +21 -2 -------------------- --- QueryInQuery.java 27 Jun 2006 08:06:12 -0000 1.1.2.2 +++ QueryInQuery.java 27 Jun 2006 20:37:17 -0000 1.1.2.3 @@ -4,9 +4,9 @@ * * $RCSfile: QueryInQuery.java,v $ * - * $Revision: 1.1.2.2 $ + * $Revision: 1.1.2.3 $ * - * last change: $Author: fs $ $Date: 2006/06/27 08:06:12 $ + * last change: $Author: fs $ $Date: 2006/06/27 20:37:17 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -42,6 +42,8 @@ import com.sun.star.sdb.XSingleSelectQueryComposer; import com.sun.star.sdbc.SQLException; import com.sun.star.uno.UnoRuntime; +import connectivity.tools.HsqlColumnDescriptor; +import connectivity.tools.HsqlTableDescriptor; import connectivity.tools.RowSet; public class QueryInQuery extends complexlib.ComplexTestCase @@ -159,6 +161,7 @@ */ public void checkNameCollisions() { + // create a query with a name which is used by a table boolean caughtExpected = false; try { @@ -168,6 +171,22 @@ catch ( IllegalArgumentException e ) {} catch ( ElementExistException e ) { caughtExpected = true; } assure( "creating queries with the name of an existing table should not be possible", + caughtExpected ); + + // create a table with a name which is used by a query + HsqlTableDescriptor table = new HsqlTableDescriptor( "query products", + new HsqlColumnDescriptor[] { + new HsqlColumnDescriptor( "ID", "INTEGER", true, true ), + new HsqlColumnDescriptor( "Name", "VARCHAR(50)" ) } ); + + caughtExpected = false; + try + { + m_database.getDatabase().createTableInSDBCX( table ); + } + catch ( SQLException e ) { caughtExpected = true; } + catch ( ElementExistException ex ) { } + assure( "creating tables with the name of an existing query should not be possible", caughtExpected ); } } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
