summaryrefslogtreecommitdiff
path: root/qadevOOo/tests/java/mod/_dbaccess/JoinViewAccessibility.java
diff options
context:
space:
mode:
Diffstat (limited to 'qadevOOo/tests/java/mod/_dbaccess/JoinViewAccessibility.java')
-rw-r--r--qadevOOo/tests/java/mod/_dbaccess/JoinViewAccessibility.java64
1 files changed, 32 insertions, 32 deletions
diff --git a/qadevOOo/tests/java/mod/_dbaccess/JoinViewAccessibility.java b/qadevOOo/tests/java/mod/_dbaccess/JoinViewAccessibility.java
index 8ec0c0db1bfa..b882e0242558 100644
--- a/qadevOOo/tests/java/mod/_dbaccess/JoinViewAccessibility.java
+++ b/qadevOOo/tests/java/mod/_dbaccess/JoinViewAccessibility.java
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -85,7 +85,7 @@ public class JoinViewAccessibility extends TestCase {
XComponent QueryComponent = null;
String user = "";
String password="";
-
+
/**
* Creates a new DataSource and stores it.
* Creates a connection and using it
@@ -104,13 +104,13 @@ public class JoinViewAccessibility extends TestCase {
PrintWriter log)
{
XInterface oObj = null;
-
+
Object oDBContext = null;
Object oDBSource = null;
Object newQuery = null;
Object toolkit = null;
XStorable store = null;
-
+
try
{
oDBContext = ((XMultiServiceFactory) Param.getMSF ())
@@ -126,24 +126,24 @@ public class JoinViewAccessibility extends TestCase {
e.printStackTrace (log);
throw new StatusException (Status.failed ("Couldn't create instance"));
}
-
+
String mysqlURL = (String) Param.get ("mysql.url");
-
+
if (mysqlURL == null)
{
throw new StatusException (Status.failed (
"Couldn't get 'mysql.url' from ini-file"));
}
-
+
user = (String) Param.get ("jdbc.user");
password = (String) Param.get ("jdbc.password");
-
+
if ((user == null) || (password == null))
{
throw new StatusException (Status.failed (
"Couldn't get 'jdbc.user' or 'jdbc.password' from ini-file"));
}
-
+
PropertyValue[] info = new PropertyValue[2];
info[0] = new PropertyValue ();
info[0].Name = "user";
@@ -151,10 +151,10 @@ public class JoinViewAccessibility extends TestCase {
info[1] = new PropertyValue ();
info[1].Name = "password";
info[1].Value = password;
-
+
XPropertySet propSetDBSource = (XPropertySet) UnoRuntime.queryInterface (
XPropertySet.class, oDBSource);
-
+
try
{
propSetDBSource.setPropertyValue ("URL", mysqlURL);
@@ -180,7 +180,7 @@ public class JoinViewAccessibility extends TestCase {
throw new StatusException (Status.failed (
"Couldn't set property value"));
}
-
+
try
{
log.println ("writing database file ...");
@@ -198,19 +198,19 @@ public class JoinViewAccessibility extends TestCase {
e.printStackTrace (log);
throw new StatusException (Status.failed ("Couldn't register object"));
}
-
+
isolConnection = (XIsolatedConnection) UnoRuntime.queryInterface (
XIsolatedConnection.class,
oDBSource);
-
+
XConnection connection = null;
XStatement statement = null;
-
+
final String tbl_name1 = "tst_table1";
final String tbl_name2 = "tst_table2";
final String col_name1 = "id1";
final String col_name2 = "id2";
-
+
try
{
connection = isolConnection.getIsolatedConnection (user, password);
@@ -241,16 +241,16 @@ public class JoinViewAccessibility extends TestCase {
throw new StatusException (Status.failed ("SQLException"));
}
}
-
+
XQueryDefinitionsSupplier querySuppl = (XQueryDefinitionsSupplier) UnoRuntime.queryInterface (
XQueryDefinitionsSupplier.class,
oDBSource);
-
+
XNameAccess defContainer = querySuppl.getQueryDefinitions ();
-
+
XPropertySet queryProp = (XPropertySet) UnoRuntime.queryInterface (
XPropertySet.class, newQuery);
-
+
try
{
final String query = "select * from " + tbl_name1 + ", " +
@@ -279,11 +279,11 @@ public class JoinViewAccessibility extends TestCase {
throw new StatusException (Status.failed (
"Couldn't set property value"));
}
-
+
XNameContainer queryContainer = (XNameContainer) UnoRuntime.queryInterface (
XNameContainer.class,
defContainer);
-
+
try
{
queryContainer.insertByName ("Query1", newQuery);
@@ -310,27 +310,27 @@ public class JoinViewAccessibility extends TestCase {
e.printStackTrace (log);
throw new StatusException (Status.failed ("Couldn't insert query"));
}
-
+
PropertyValue[] loadProps = new PropertyValue[3];
loadProps[0] = new PropertyValue ();
loadProps[0].Name = "QueryDesignView";
loadProps[0].Value = Boolean.TRUE;
-
+
loadProps[1] = new PropertyValue ();
loadProps[1].Name = "CurrentQuery";
loadProps[1].Value = "Query1";
-
+
loadProps[2] = new PropertyValue ();
loadProps[2].Name = "DataSource";
loadProps[2].Value = oDBSource;
-
+
QueryComponent = DesktopTools.loadDoc ((XMultiServiceFactory) Param.getMSF (),".component:DB/QueryDesign",loadProps);
-
+
xWindow = UnoRuntime.queryInterface(XModel.class, QueryComponent).
getCurrentController().getFrame().getContainerWindow();
-
+
XAccessible xRoot = AccessibilityTools.getAccessibleObject (xWindow);
-
+
AccessibilityTools.printAccessibleTree (log,xRoot, Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
oObj = AccessibilityTools.getAccessibleObjectForRole(xRoot, AccessibleRole.VIEW_PORT);
@@ -345,7 +345,7 @@ public class JoinViewAccessibility extends TestCase {
final XWindow queryWin = xWindow;
- tEnv.addObjRelation("EventProducer",
+ tEnv.addObjRelation("EventProducer",
new ifc.accessibility._XAccessibleEventBroadcaster.EventProducer() {
public void fireEvent() {
Rectangle rect = queryWin.getPosSize();
@@ -359,10 +359,10 @@ public class JoinViewAccessibility extends TestCase {
/**
* Closes the DatasourceAdministration dialog and Query Dialog.
*/
- protected void cleanup(TestParameters Param, PrintWriter log) {
+ protected void cleanup(TestParameters Param, PrintWriter log) {
try
{
-
+
log.println ("closing QueryComponent ...");
DesktopTools.closeDoc (QueryComponent);
log.println ("... done");