summaryrefslogtreecommitdiff
path: root/dbaccess/qa/unit/dbtest_base.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'dbaccess/qa/unit/dbtest_base.cxx')
-rw-r--r--dbaccess/qa/unit/dbtest_base.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/dbaccess/qa/unit/dbtest_base.cxx b/dbaccess/qa/unit/dbtest_base.cxx
index 9c1dd32973eb..0208649906ad 100644
--- a/dbaccess/qa/unit/dbtest_base.cxx
+++ b/dbaccess/qa/unit/dbtest_base.cxx
@@ -21,6 +21,7 @@
#include <com/sun/star/sdbc/XConnection.hpp>
#include <com/sun/star/sdbc/XDataSource.hpp>
#include <com/sun/star/sdbc/XStatement.hpp>
+#include <com/sun/star/util/XCloseable.hpp>
using namespace ::com::sun::star;
using namespace ::com::sun::star::beans;
@@ -45,6 +46,8 @@ public:
void createQueries(Reference< XDataSource > xDataSource);
void createQuery(OUString sQuery, bool bEscapeProcessing,
OUString sQueryName, Reference<XDataSource> xDataSource);
+
+ virtual void tearDown() override;
};
uno::Reference<XOfficeDatabaseDocument> DBTestBase::getDocumentForUrl(OUString const & url) {
@@ -178,4 +181,16 @@ void DBTestBase::createQuery(OUString sQuery, bool bEscapeProcessing, OUString s
xNameContainer->insertByName(sQueryName, Any(xQueryProp));
}
+void DBTestBase::tearDown()
+{
+ if (mxComponent)
+ {
+ // In order to close all windows
+ css::uno::Reference<util::XCloseable> xCloseable(mxComponent, css::uno::UNO_QUERY_THROW);
+ xCloseable->close(false);
+ }
+
+ UnoApiTest::tearDown();
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */