LanguageTool: don't crash if REST protocol isn't set
[LibreOffice.git] / dbaccess / qa / unit / hsqldb.cxx
blob5ee011af276e15667487b403e158d690e906efd4
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
10 #include "dbtest_base.cxx"
12 #include <com/sun/star/sdb/XOfficeDatabaseDocument.hpp>
14 using namespace ::com::sun::star;
15 using namespace ::com::sun::star::sdb;
16 using namespace ::com::sun::star::sdbc;
17 using namespace ::com::sun::star::uno;
19 class HSQLDBTest : public DBTestBase
21 public:
22 void testEmptyDBConnection();
24 CPPUNIT_TEST_SUITE(HSQLDBTest);
25 CPPUNIT_TEST(testEmptyDBConnection);
26 CPPUNIT_TEST_SUITE_END();
29 /**
30 * Test the loading of an "empty" file, i.e. the embedded database has not yet
31 * been initialised (as occurs when a new .odb is created and opened by base).
33 void HSQLDBTest::testEmptyDBConnection()
35 auto const file = createTempCopy(u"hsqldb_empty.odb");
36 uno::Reference<XOfficeDatabaseDocument> xDocument = getDocumentForUrl(file.GetURL());
38 getConnectionForDocument(xDocument);
40 css::uno::Reference<css::lang::XComponent>(xDocument, css::uno::UNO_QUERY_THROW)->dispose();
43 CPPUNIT_TEST_SUITE_REGISTRATION(HSQLDBTest);
45 CPPUNIT_PLUGIN_IMPLEMENT();
47 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */