Kaydet (Commit) b56abcbf authored tarafından Vladimir Glazounov's avatar Vladimir Glazounov

INTEGRATION: CWS qadev21 (1.5.96); FILE MERGED

2005/01/13 11:28:04 cn 1.5.96.1: #i40562# closing data source while cleanup() is called
üst 95396008
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: ODatabaseForm.java,v $ * $RCSfile: ODatabaseForm.java,v $
* *
* $Revision: 1.5 $ * $Revision: 1.6 $
* *
* last change:$Date: 2003-11-18 16:27:32 $ * last change:$Date: 2005-02-24 17:42:37 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -270,6 +270,7 @@ public class ODatabaseForm extends TestCase { ...@@ -270,6 +270,7 @@ public class ODatabaseForm extends TestCase {
DBTools.DataSourceInfo srcInf = null; DBTools.DataSourceInfo srcInf = null;
boolean isMySQLDB = false; boolean isMySQLDB = false;
protected XConnection conn = null; protected XConnection conn = null;
private Object dbSrc = null;
protected void initialize(TestParameters tParam, PrintWriter log) { protected void initialize(TestParameters tParam, PrintWriter log) {
//log.println( "creating a draw document" ); //log.println( "creating a draw document" );
...@@ -309,7 +310,7 @@ public class ODatabaseForm extends TestCase { ...@@ -309,7 +310,7 @@ public class ODatabaseForm extends TestCase {
propInfo[0].Value = "util.dddriver.Driver"; propInfo[0].Value = "util.dddriver.Driver";
srcInf.Info = propInfo; srcInf.Info = propInfo;
Object dbSrc = srcInf.getDataSourceService(); dbSrc = srcInf.getDataSourceService();
dbTools.reRegisterDB(dbSourceName, dbSrc); dbTools.reRegisterDB(dbSourceName, dbSrc);
} catch (com.sun.star.uno.Exception e) { } catch (com.sun.star.uno.Exception e) {
log.println("Error while object test initialization :"); log.println("Error while object test initialization :");
...@@ -322,7 +323,7 @@ public class ODatabaseForm extends TestCase { ...@@ -322,7 +323,7 @@ public class ODatabaseForm extends TestCase {
try { try {
srcInf.URL = "sdbc:dbase:" + DBTools.dirToUrl(tmpDir); srcInf.URL = "sdbc:dbase:" + DBTools.dirToUrl(tmpDir);
Object dbSrc = srcInf.getDataSourceService(); dbSrc = srcInf.getDataSourceService();
dbTools.reRegisterDB(dbSourceName, dbSrc); dbTools.reRegisterDB(dbSourceName, dbSrc);
} catch (com.sun.star.uno.Exception e) { } catch (com.sun.star.uno.Exception e) {
log.println("Error while object test initialization :"); log.println("Error while object test initialization :");
...@@ -766,6 +767,7 @@ public class ODatabaseForm extends TestCase { ...@@ -766,6 +767,7 @@ public class ODatabaseForm extends TestCase {
* Closes connection of <code>RowSet</code> instance created. * Closes connection of <code>RowSet</code> instance created.
*/ */
protected void cleanup(TestParameters Param, PrintWriter log) { protected void cleanup(TestParameters Param, PrintWriter log) {
log.println("closing connection...");
try { try {
conn.close(); conn.close();
} catch (com.sun.star.uno.Exception e) { } catch (com.sun.star.uno.Exception e) {
...@@ -775,7 +777,20 @@ public class ODatabaseForm extends TestCase { ...@@ -775,7 +777,20 @@ public class ODatabaseForm extends TestCase {
log.println("Connection was already closed. It's OK."); log.println("Connection was already closed. It's OK.");
} }
log.println(" disposing xTextDoc ");
log.println("closing data source...");
try {
XCloseable closer = (XCloseable) UnoRuntime.queryInterface(
XCloseable.class, dbSrc);
closer.close(true);
} catch (com.sun.star.util.CloseVetoException e) {
log.println("couldn't close data source");
} catch (com.sun.star.lang.DisposedException e) {
log.println("couldn't close data source");
}
log.println("closing document...");
try { try {
XCloseable closer = (XCloseable) UnoRuntime.queryInterface( XCloseable closer = (XCloseable) UnoRuntime.queryInterface(
...@@ -787,8 +802,10 @@ public class ODatabaseForm extends TestCase { ...@@ -787,8 +802,10 @@ public class ODatabaseForm extends TestCase {
log.println("couldn't close document"); log.println("couldn't close document");
} }
log.println("revoking data source...");
try { try {
dbTools.revokeDB(dbSourceName); dbTools.revokeDB(dbSourceName);
} catch (com.sun.star.container.NoSuchElementException e){
} catch (com.sun.star.uno.Exception e) { } catch (com.sun.star.uno.Exception e) {
log.println("Error while object test cleaning up :"); log.println("Error while object test cleaning up :");
e.printStackTrace(log); e.printStackTrace(log);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment