summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dbaccess/qa/unit/dbtest_base.cxx15
-rw-r--r--dbaccess/qa/unit/firebird.cxx10
2 files changed, 15 insertions, 10 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: */
diff --git a/dbaccess/qa/unit/firebird.cxx b/dbaccess/qa/unit/firebird.cxx
index 089f152ee2d5..5f2f4077125e 100644
--- a/dbaccess/qa/unit/firebird.cxx
+++ b/dbaccess/qa/unit/firebird.cxx
@@ -15,7 +15,6 @@
#include <com/sun/star/sdbc/XResultSet.hpp>
#include <com/sun/star/sdbc/XRow.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::sdb;
@@ -48,9 +47,6 @@ void FirebirdTest::testEmptyDBConnection()
getDocumentForUrl(maTempFile.GetURL());
getConnectionForDocument(xDocument);
-
- css::uno::Reference<util::XCloseable> xCloseable(mxComponent, css::uno::UNO_QUERY_THROW);
- xCloseable->close(false);
}
/**
@@ -90,9 +86,6 @@ void FirebirdTest::testIntegerDatabase()
xRow->getString(xColumnLocate->findColumn(u"_VARCHAR"_ustr)));
CPPUNIT_ASSERT(!xResultSet->next()); // Should only be one row
-
- css::uno::Reference<util::XCloseable> xCloseable(mxComponent, css::uno::UNO_QUERY_THROW);
- xCloseable->close(false);
}
void FirebirdTest::testTdf132924()
@@ -118,9 +111,6 @@ void FirebirdTest::testTdf132924()
// - Actual : The column name 'TestId' is not valid
CPPUNIT_ASSERT_EQUAL(sal_Int16(1), xRow->getShort(xColumnLocate->findColumn(u"TestId"_ustr)));
CPPUNIT_ASSERT_EQUAL(u"TestName"_ustr, xRow->getString(xColumnLocate->findColumn(u"TestName"_ustr)));
-
- css::uno::Reference<util::XCloseable> xCloseable(mxComponent, css::uno::UNO_QUERY_THROW);
- xCloseable->close(false);
}
CPPUNIT_TEST_SUITE_REGISTRATION(FirebirdTest);