Kaydet (Commit) 752a1e27 authored tarafından Rene Engelhard's avatar Rene Engelhard Kaydeden (comit) Mike Kaganski

(try to) fix dbaccess firebird-related tests

after 1c5c9b84

Move headless check into test and add missing component file for firebird...
Also check for ENABLE_FIREBIRD_SDBC...

Change-Id: I27ea9fb08ebcce701a54686a8986e5071a8bcf96
Reviewed-on: https://gerrit.libreoffice.org/53940Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMichael Stahl <Michael.Stahl@cib.de>
üst e57462cd
...@@ -5,6 +5,8 @@ Settings for Firebird ...@@ -5,6 +5,8 @@ Settings for Firebird
#ifndef CONFIG_FIREBIRD_H #ifndef CONFIG_FIREBIRD_H
#define CONFIG_FIREBIRD_H #define CONFIG_FIREBIRD_H
#define ENABLE_FIREBIRD_SDBC 0
#define HAVE_FIREBIRD_30 0 #define HAVE_FIREBIRD_30 0
#endif #endif
...@@ -8769,6 +8769,7 @@ int fb_api_is_30(void) { return 0; } ...@@ -8769,6 +8769,7 @@ int fb_api_is_30(void) { return 0; }
BUILD_TYPE="$BUILD_TYPE FIREBIRD" BUILD_TYPE="$BUILD_TYPE FIREBIRD"
ENABLE_FIREBIRD_SDBC="TRUE" ENABLE_FIREBIRD_SDBC="TRUE"
AC_DEFINE(ENABLE_FIREBIRD_SDBC)
fi fi
fi fi
AC_SUBST(ENABLE_FIREBIRD_SDBC) AC_SUBST(ENABLE_FIREBIRD_SDBC)
......
...@@ -68,6 +68,7 @@ $(eval $(call gb_CppunitTest_use_components,dbaccess_RowSetClones,\ ...@@ -68,6 +68,7 @@ $(eval $(call gb_CppunitTest_use_components,dbaccess_RowSetClones,\
comphelper/util/comphelp \ comphelper/util/comphelp \
configmgr/source/configmgr \ configmgr/source/configmgr \
connectivity/source/drivers/hsqldb/hsqldb \ connectivity/source/drivers/hsqldb/hsqldb \
$(if $(ENABLE_FIREBIRD_SDBC),connectivity/source/drivers/firebird/firebird_sdbc) \
connectivity/source/drivers/jdbc/jdbc \ connectivity/source/drivers/jdbc/jdbc \
connectivity/source/manager/sdbc2 \ connectivity/source/manager/sdbc2 \
dbaccess/util/dba \ dbaccess/util/dba \
......
...@@ -47,6 +47,7 @@ $(eval $(call gb_CppunitTest_use_components,dbaccess_hsqldb_test,\ ...@@ -47,6 +47,7 @@ $(eval $(call gb_CppunitTest_use_components,dbaccess_hsqldb_test,\
configmgr/source/configmgr \ configmgr/source/configmgr \
connectivity/source/cpool/dbpool2 \ connectivity/source/cpool/dbpool2 \
connectivity/source/drivers/hsqldb/hsqldb \ connectivity/source/drivers/hsqldb/hsqldb \
$(if $(ENABLE_FIREBIRD_SDBC),connectivity/source/drivers/firebird/firebird_sdbc) \
connectivity/source/drivers/jdbc/jdbc \ connectivity/source/drivers/jdbc/jdbc \
connectivity/source/manager/sdbc2 \ connectivity/source/manager/sdbc2 \
dbaccess/util/dba \ dbaccess/util/dba \
......
...@@ -74,6 +74,8 @@ ...@@ -74,6 +74,8 @@
#include <iterator> #include <iterator>
#include <set> #include <set>
#include <config_firebird.h>
using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::sdbcx; using namespace ::com::sun::star::sdbcx;
using namespace ::com::sun::star::sdb; using namespace ::com::sun::star::sdb;
...@@ -581,25 +583,24 @@ Reference< XConnection > ODatabaseSource::buildLowLevelConnection(const OUString ...@@ -581,25 +583,24 @@ Reference< XConnection > ODatabaseSource::buildLowLevelConnection(const OUString
Reference< XDriverManager > xManager; Reference< XDriverManager > xManager;
OUString sMigrEnvVal; #if ENABLE_FIREBIRD_SDBC
osl_getEnvironment(OUString("DBACCESS_HSQL_MIGRATION").pData,
&sMigrEnvVal.pData);
bool bNeedMigration = false; bool bNeedMigration = false;
if(m_pImpl->m_sConnectURL == "sdbc:embedded:hsqldb") if(m_pImpl->m_sConnectURL == "sdbc:embedded:hsqldb")
{ {
OUString sSalUseVclplugin; OUString sMigrEnvVal;
osl_getEnvironment(OUString("SAL_USE_VCLPLUGIN").pData, osl_getEnvironment(OUString("DBACCESS_HSQL_MIGRATION").pData,
&sSalUseVclplugin.pData); &sMigrEnvVal.pData);
if(!sMigrEnvVal.isEmpty() || sSalUseVclplugin == "svp") if(!sMigrEnvVal.isEmpty())
bNeedMigration = true; bNeedMigration = true;
else else
{ {
MigrationWarnDialog aWarnDlg{nullptr}; MigrationWarnDialog aWarnDlg{nullptr};
bNeedMigration = aWarnDlg.run() == RET_OK; bNeedMigration = aWarnDlg.run() == RET_OK;
} }
if (bNeedMigration)
m_pImpl->m_sConnectURL = "sdbc:embedded:firebird";
} }
if(bNeedMigration) #endif
m_pImpl->m_sConnectURL = "sdbc:embedded:firebird";
try { try {
xManager.set( ConnectionPool::create( m_pImpl->m_aContext ), UNO_QUERY_THROW ); xManager.set( ConnectionPool::create( m_pImpl->m_aContext ), UNO_QUERY_THROW );
...@@ -712,6 +713,7 @@ Reference< XConnection > ODatabaseSource::buildLowLevelConnection(const OUString ...@@ -712,6 +713,7 @@ Reference< XConnection > ODatabaseSource::buildLowLevelConnection(const OUString
throwGenericSQLException( sMessage, static_cast< XDataSource* >( this ), makeAny( aContext ) ); throwGenericSQLException( sMessage, static_cast< XDataSource* >( this ), makeAny( aContext ) );
} }
#if ENABLE_FIREBIRD_SDBC
if( bNeedMigration ) if( bNeedMigration )
{ {
Reference< css::document::XDocumentSubStorageSupplier> xDocSup( Reference< css::document::XDocumentSubStorageSupplier> xDocSup(
...@@ -720,6 +722,7 @@ Reference< XConnection > ODatabaseSource::buildLowLevelConnection(const OUString ...@@ -720,6 +722,7 @@ Reference< XConnection > ODatabaseSource::buildLowLevelConnection(const OUString
xDocSup->getDocumentSubStorage("database",ElementModes::READWRITE) ); xDocSup->getDocumentSubStorage("database",ElementModes::READWRITE) );
importer.importHsqlDatabase(); importer.importHsqlDatabase();
} }
#endif
return xReturn; return xReturn;
} }
......
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