summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorAndrzej J.R. Hunt <andrzej@ahunt.org>2013-09-13 14:00:09 +0100
committerAndrzej J.R. Hunt <andrzej@ahunt.org>2013-09-27 18:09:18 +0100
commit24320dca8565a1b801dd6cc578e9592dff4d972d (patch)
treea3f400f1cce8d183fcb3c11e965714b622a942c8 /dbaccess
parent1301f29e108fa5ba1e59c7c1fedf907a75756d15 (diff)
Implement hsqldb loading test.
Change-Id: I7dc6390b1061585054d1fa435414cae245122a1c
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/CppunitTest_dbaccess_hsqldb_test.mk79
-rw-r--r--dbaccess/Module_dbaccess.mk5
-rw-r--r--dbaccess/qa/unit/data/hsqldb_empty.odbbin0 -> 2345 bytes
-rw-r--r--dbaccess/qa/unit/hsqldb.cxx52
4 files changed, 136 insertions, 0 deletions
diff --git a/dbaccess/CppunitTest_dbaccess_hsqldb_test.mk b/dbaccess/CppunitTest_dbaccess_hsqldb_test.mk
new file mode 100644
index 000000000000..66b44018d9e8
--- /dev/null
+++ b/dbaccess/CppunitTest_dbaccess_hsqldb_test.mk
@@ -0,0 +1,79 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_CppunitTest_CppunitTest,dbaccess_hsqldb_test))
+
+$(eval $(call gb_CppunitTest_use_external,dbaccess_hsqldb_test,boost_headers))
+
+$(eval $(call gb_CppunitTest_add_exception_objects,dbaccess_hsqldb_test, \
+ dbaccess/qa/unit/hsqldb \
+))
+
+$(eval $(call gb_CppunitTest_use_libraries,dbaccess_hsqldb_test, \
+ comphelper \
+ cppu \
+ cppuhelper \
+ dbaxml \
+ dbtools \
+ firebird_sdbc \
+ jvmfwk \
+ sal \
+ subsequenttest \
+ utl \
+ test \
+ tk \
+ unotest \
+ xo \
+ $(gb_UWINAPI) \
+))
+
+$(eval $(call gb_CppunitTest_use_api,dbaccess_hsqldb_test,\
+ offapi \
+ oovbaapi \
+ udkapi \
+))
+
+$(eval $(call gb_CppunitTest_use_ure,dbaccess_hsqldb_test))
+
+$(eval $(call gb_CppunitTest_use_components,dbaccess_hsqldb_test,\
+ basic/util/sb \
+ comphelper/util/comphelp \
+ configmgr/source/configmgr \
+ connectivity/source/cpool/dbpool2 \
+ connectivity/source/drivers/hsqldb/hsqldb \
+ connectivity/source/drivers/jdbc/jdbc \
+ connectivity/source/manager/sdbc2 \
+ dbaccess/util/dba \
+ dbaccess/source/filter/xml/dbaxml \
+ dbaccess/util/dbu \
+ fileaccess/source/fileacc \
+ filter/source/config/cache/filterconfig1 \
+ framework/util/fwk \
+ i18npool/util/i18npool \
+ linguistic/source/lng \
+ package/source/xstor/xstor \
+ package/util/package2 \
+ sax/source/expatwrap/expwrap \
+ sfx2/util/sfx \
+ svl/source/fsstor/fsstorage \
+ svl/util/svl \
+ toolkit/util/tk \
+ ucb/source/core/ucb1 \
+ ucb/source/ucp/file/ucpfile1 \
+ unotools/util/utl \
+ xmloff/util/xo \
+))
+
+$(eval $(call gb_CppunitTest_use_configuration,dbaccess_hsqldb_test))
+
+$(eval $(call gb_CppunitTest_use_filter_configuration,dbaccess_hsqldb_test))
+
+$(eval $(call gb_CppunitTest_use_unittest_configuration,dbaccess_hsqldb_test))
+
+# vim: set noet sw=4 ts=4:
diff --git a/dbaccess/Module_dbaccess.mk b/dbaccess/Module_dbaccess.mk
index eb1dbbc73360..ce439c042a0b 100644
--- a/dbaccess/Module_dbaccess.mk
+++ b/dbaccess/Module_dbaccess.mk
@@ -41,6 +41,11 @@ $(eval $(call gb_Module_add_check_targets,dbaccess,\
CppunitTest_dbaccess_dialog_save \
))
+ifeq ($(ENABLE_JAVA),TRUE)
+$(eval $(call gb_Module_add_check_targets,dbaccess,\
+ CppunitTest_dbaccess_hsqldb_test \
+))
+endif
# disable test because it still fails in some situations
# CppunitTest_dbaccess_macros_test \
diff --git a/dbaccess/qa/unit/data/hsqldb_empty.odb b/dbaccess/qa/unit/data/hsqldb_empty.odb
new file mode 100644
index 000000000000..087c26113120
--- /dev/null
+++ b/dbaccess/qa/unit/data/hsqldb_empty.odb
Binary files differ
diff --git a/dbaccess/qa/unit/hsqldb.cxx b/dbaccess/qa/unit/hsqldb.cxx
new file mode 100644
index 000000000000..5ac7b45cd21f
--- /dev/null
+++ b/dbaccess/qa/unit/hsqldb.cxx
@@ -0,0 +1,52 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include "dbtest_base.cxx"
+
+#include <com/sun/star/sdb/XOfficeDatabaseDocument.hpp>
+#include <com/sun/star/sdbc/XColumnLocate.hpp>
+#include <com/sun/star/sdbc/XConnection.hpp>
+#include <com/sun/star/sdbc/XResultSet.hpp>
+#include <com/sun/star/sdbc/XRow.hpp>
+#include <com/sun/star/sdbc/XStatement.hpp>
+
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::sdb;
+using namespace ::com::sun::star::sdbc;
+using namespace ::com::sun::star::uno;
+
+class HSQLDBTest
+ : public DBTestBase
+{
+public:
+ void testEmptyDBConnection();
+ void testIntegerDatabase();
+
+ CPPUNIT_TEST_SUITE(HSQLDBTest);
+ CPPUNIT_TEST(testEmptyDBConnection);
+ CPPUNIT_TEST_SUITE_END();
+};
+
+/**
+ * Test the loading of an "empty" file, i.e. the embedded database has not yet
+ * been initialised (as occurs when a new .odb is created and opened by base).
+ */
+void HSQLDBTest::testEmptyDBConnection()
+{
+ uno::Reference< XOfficeDatabaseDocument > xDocument =
+ getDocumentForFileName("hsqldb_empty.odb");
+
+ getConnectionForDocument(xDocument);
+}
+
+CPPUNIT_TEST_SUITE_REGISTRATION(HSQLDBTest);
+
+CPPUNIT_PLUGIN_IMPLEMENT();
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */