summaryrefslogtreecommitdiff
path: root/dbaccess/qa
diff options
context:
space:
mode:
authorFrank Schoenheit [fs] <frank.schoenheit@sun.com>2010-04-16 13:55:24 +0200
committerFrank Schoenheit [fs] <frank.schoenheit@sun.com>2010-04-16 13:55:24 +0200
commitb6693080a17418cf79b55f77add3bf7a84f00060 (patch)
tree2f2609e3549481a37d47fbf869224be6e0642b34 /dbaccess/qa
parent52cc8fded55d1761c6913a3704a03a7c137a7f3d (diff)
parentfd8c2dd9780e8b3f4e9d26783f477452ff62a17c (diff)
dba33f: merge with m76-branch
Diffstat (limited to 'dbaccess/qa')
-rw-r--r--dbaccess/qa/complex/dbaccess/DatabaseDocument.java2
-rwxr-xr-xdbaccess/qa/complex/dbaccess/SingleSelectQueryComposer.java33
2 files changed, 33 insertions, 2 deletions
diff --git a/dbaccess/qa/complex/dbaccess/DatabaseDocument.java b/dbaccess/qa/complex/dbaccess/DatabaseDocument.java
index d9b84153ff16..02fb820f3fd4 100644
--- a/dbaccess/qa/complex/dbaccess/DatabaseDocument.java
+++ b/dbaccess/qa/complex/dbaccess/DatabaseDocument.java
@@ -839,8 +839,8 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document.
final String otherURL = copyToTempFile(databaseDoc.getURL());
final XModel otherDoc = (XModel) UnoRuntime.queryInterface(XModel.class,
loader.loadComponentFromURL(otherURL, _BLANK, 0, impl_getDefaultLoadArgs()));
- impl_waitForEvent(m_globalEvents, "OnLoad", 5000, previousOnLoadEventPos + 1);
impl_raise(otherDoc);
+ impl_waitForEvent(m_globalEvents, "OnLoad", 5000, previousOnLoadEventPos + 1);
// ... and switch between the two
impl_startObservingEvents(context);
diff --git a/dbaccess/qa/complex/dbaccess/SingleSelectQueryComposer.java b/dbaccess/qa/complex/dbaccess/SingleSelectQueryComposer.java
index f795b0a3cc17..bb3636100849 100755
--- a/dbaccess/qa/complex/dbaccess/SingleSelectQueryComposer.java
+++ b/dbaccess/qa/complex/dbaccess/SingleSelectQueryComposer.java
@@ -52,6 +52,7 @@ public class SingleSelectQueryComposer extends CRMBasedTestCase
{
return new String[]
{
+ "testSetCommand",
"testAttributes",
"testSubQueries",
"testParameters",
@@ -128,6 +129,31 @@ public class SingleSelectQueryComposer extends CRMBasedTestCase
log.println(" (results in " + (String) m_composer.getQuery() + ")");
}
+ /** tests setCommand of the composer
+ */
+ public void testSetCommand()
+ {
+ log.println("testing SingleSelectQueryComposer's setCommand");
+
+ try
+ {
+ final String table = "SELECT * FROM \"customers\"";
+ m_composer.setCommand("customers",CommandType.TABLE);
+ assure("setCommand/getQuery TABLE inconsistent", m_composer.getQuery().equals(table));
+
+ m_database.getDatabase().getDataSource().createQuery("set command test", "SELECT * FROM \"orders for customer\" \"a\", \"customers\" \"b\" WHERE \"a\".\"Product Name\" = \"b\".\"Name\"");
+ m_composer.setCommand("set command test",CommandType.QUERY);
+ assure("setCommand/getQuery QUERY inconsistent", m_composer.getQuery().equals(m_database.getDatabase().getDataSource().getQueryDefinition("set command test").getCommand()));
+
+ final String sql = "SELECT * FROM \"orders for customer\" WHERE \"Product Name\" = 'test'";
+ m_composer.setCommand(sql,CommandType.COMMAND);
+ assure("setCommand/getQuery COMMAND inconsistent", m_composer.getQuery().equals(sql));
+ }
+ catch (Exception e)
+ {
+ assure("Exception caught: " + e, false);
+ }
+ }
/** tests accessing attributes of the composer (order, filter, group by, having)
*/
public void testAttributes()
@@ -136,6 +162,11 @@ public class SingleSelectQueryComposer extends CRMBasedTestCase
try
{
+ log.println("check setElementaryQuery");
+ final String simpleQuery2 = "SELECT * FROM \"customers\" WHERE \"Name\" = 'oranges'";
+ m_composer.setElementaryQuery(simpleQuery2);
+ assure("setElementaryQuery/getQuery inconsistent", m_composer.getQuery().equals(simpleQuery2));
+
log.println("check setQuery");
final String simpleQuery = "SELECT * FROM \"customers\"";
m_composer.setQuery(simpleQuery);
@@ -260,7 +291,7 @@ public class SingleSelectQueryComposer extends CRMBasedTestCase
filter.addProperty("Type", PropertyAttribute.MAYBEVOID, Integer.valueOf(DataType.LONGVARCHAR));
final XPropertySet column = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class,filter);
- m_composer.appendFilterByColumn(column, true);
+ m_composer.appendFilterByColumn(column, true,SQLFilterOperator.LIKE);
assure("At least one row should exist",m_database.getConnection().createStatement().executeQuery(m_composer.getQuery()).next());
}