From 06da1c9ff097d191d9a15b4dfcf2072439eb8cd6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Delaporte?=
<12201973+fredericDelaporte@users.noreply.github.com>
Date: Fri, 21 Sep 2018 21:05:08 +0200
Subject: [PATCH] Fix failing tests for SQL Anywhere
And add the Teamcity build
---
ShowBuildMenu.bat | 25 ++-
.../SQLAnywhere_installation.txt | 14 ++
.../SapSQLAnywhere.cfg.xml | 21 +++
src/NHibernate.DomainModel/ABCProxy.hbm.xml | 6 +-
.../Northwind/Mappings/Shipper.hbm.xml | 4 +-
.../Ado/GenericBatchingBatcherFixture.cs | 6 +-
.../Ado/GenericBatchingBatcherFixture.cs | 6 +-
.../ComponentWithUniqueConstraintTests.cs | 8 +-
.../Async/Criteria/CriteriaQueryTest.cs | 3 +
.../Async/Criteria/EntityProjectionsTest.cs | 10 +-
.../Lambda/FunctionsIntegrationFixture.cs | 3 +
.../Async/Criteria/ProjectionsTest.cs | 9 +
.../Seqidentity/SequenceIdentityFixture.cs | 10 +-
src/NHibernate.Test/Async/Hql/HQLFunctions.cs | 8 +-
.../NH3269/FixtureNonPublicProperty.cs | 8 +-
.../NH3269/FixturePublicProperty.cs | 8 +-
.../Dates/DateTimeOffsetFixture.cs | 4 +-
.../GH1565/LockEntityWithOuterJoinTest.cs | 2 +
.../Async/NHSpecificTest/Logs/LogsFixture.cs | 9 +-
.../Async/NHSpecificTest/NH1275/Fixture.cs | 14 +-
.../NHSpecificTest/NH1280/NH1280Fixture.cs | 5 +-
.../Async/NHSpecificTest/NH1773/Fixture.cs | 2 +-
.../Async/NHSpecificTest/NH2302/Fixture.cs | 4 +
.../Async/NHSpecificTest/NH3377/Fixture.cs | 5 +-
.../NHSpecificTest/SimpleComponentFixture.cs | 7 +-
.../SelfReferencingCollectionLoadTest.cs | 8 +-
.../SystemTransactionFixture.cs | 15 +-
.../Async/TypesTest/DecimalTypeFixture.cs | 3 +
.../ComponentWithUniqueConstraintTests.cs | 8 +-
.../Criteria/CriteriaQueryTest.cs | 3 +
.../Criteria/EntityProjectionsTest.cs | 12 +-
.../Lambda/FunctionsIntegrationFixture.cs | 3 +
.../Criteria/ProjectionsTest.cs | 9 +
...reSQL83DialectLinqReadonlyCreateScript.sql | Bin 1437758 -> 1437774 bytes
.../Seqidentity/SequenceIdentityFixture.cs | 10 +-
src/NHibernate.Test/Hql/HQLFunctions.cs | 8 +-
.../NH3269/FixtureNonPublicProperty.cs | 8 +-
.../NH3269/FixturePublicProperty.cs | 8 +-
.../Dates/DateTimeOffsetFixture.cs | 4 +-
.../GH1565/LockEntityWithOuterJoinTest.cs | 2 +
.../NHSpecificTest/Logs/LogsFixture.cs | 9 +-
.../NHSpecificTest/NH1275/Fixture.cs | 14 +-
.../NHSpecificTest/NH1280/NH1280Fixture.cs | 5 +-
.../NHSpecificTest/NH1773/Fixture.cs | 2 +-
.../NHSpecificTest/NH1810/Mappings.hbm.xml | 2 +-
.../NHSpecificTest/NH1813/Mappings.hbm.xml | 4 +-
.../NH1908ThreadSafety/Fixture.cs | 6 +-
.../NHSpecificTest/NH2192/Fixture.cs | 11 +-
.../NHSpecificTest/NH2302/Fixture.cs | 4 +
.../NHSpecificTest/NH2409/Mappings.hbm.xml | 2 +-
.../NHSpecificTest/NH3377/Fixture.cs | 5 +-
.../NHSpecificTest/NH3436/Fixture.cs | 5 +-
.../Properties/Mappings.hbm.xml | 4 +-
.../NHSpecificTest/SimpleComponentFixture.cs | 7 +-
.../SqlSimpleSelectBuilderFixture.cs | 4 +-
.../SelfReferencingCollectionLoadTest.cs | 8 +-
.../SystemTransactionFixture.cs | 15 +-
.../SystemTransactionFixtureBase.cs | 6 +-
src/NHibernate.Test/TestDialect.cs | 26 +++
.../SapSQLAnywhere17TestDialect.cs | 42 +++++
.../TypesTest/DecimalTypeFixture.cs | 3 +
.../TestDatabaseSetup.cs | 56 +++++-
.../Dialect/SapSQLAnywhere17Dialect.cs | 172 ++++++++++++------
.../Schema/SapSQLAnywhere17MetaData.cs | 163 +++++++++++++++++
.../Dialect/SybaseSQLAnywhere10Dialect.cs | 23 ++-
.../Dialect/SybaseSQLAnywhere11Dialect.cs | 9 +-
.../Dialect/SybaseSQLAnywhere12Dialect.cs | 28 ++-
src/NHibernate/SqlCommand/SqlStringBuilder.cs | 5 +-
teamcity.build | 6 +
69 files changed, 780 insertions(+), 168 deletions(-)
create mode 100644 lib/teamcity/SapSQLAnywhere/SQLAnywhere_installation.txt
create mode 100644 src/NHibernate.Config.Templates/SapSQLAnywhere.cfg.xml
create mode 100644 src/NHibernate.Test/TestDialects/SapSQLAnywhere17TestDialect.cs
create mode 100644 src/NHibernate/Dialect/Schema/SapSQLAnywhere17MetaData.cs
diff --git a/ShowBuildMenu.bat b/ShowBuildMenu.bat
index 29fe9622a7b..38ed467ae77 100644
--- a/ShowBuildMenu.bat
+++ b/ShowBuildMenu.bat
@@ -57,12 +57,14 @@ echo F. Add a test configuration for Oracle with managed driver.
echo G. Add a test configuration for SQL Server Compact.
echo H. Add a test configuration for MySql.
echo I. Add a test configuration for SAP HANA.
+echo J. Add a test configuration for SAP SQL Anywhere.
echo.
echo X. Exit to main menu.
echo.
-%BUILDTOOL% prompt ABCDEFGHIX
-if errorlevel 9 goto main-menu
+%BUILDTOOL% prompt ABCDEFGHIJX
+if errorlevel 10 goto main-menu
+if errorlevel 9 goto test-setup-anywhere
if errorlevel 8 goto test-setup-hana
if errorlevel 7 goto test-setup-mysql
if errorlevel 6 goto test-setup-sqlserverce
@@ -136,6 +138,13 @@ set LIB_FILES=
set LIB_FILES2=
goto test-setup-generic
+:test-setup-anywhere
+set CONFIG_NAME=SapSQLAnywhere
+set TEST_PLATFORM=AnyCPU
+set LIB_FILES=
+set LIB_FILES2=
+goto test-setup-generic
+
:test-setup-generic
set CFGNAME=
set /p CFGNAME=Enter a name for your test configuration or press enter to use default name:
@@ -221,12 +230,14 @@ echo I. NHibernate Trunk - Oracle Managed (64-bit)
echo J. NHibernate Trunk - SQL Server Compact (32-bit)
echo K. NHibernate Trunk - SQL Server Compact (64-bit)
echo L. NHibernate Trunk - SQL Server ODBC (32-bit)
+echo M. NHibernate Trunk - SAP SQL Anywhere
echo.
echo X. Exit to main menu.
echo.
-%BUILDTOOL% prompt ABCDEFGHIJKLX
-if errorlevel 12 goto main-menu
+%BUILDTOOL% prompt ABCDEFGHIJKLMX
+if errorlevel 13 goto main-menu
+if errorlevel 12 goto teamcity-anywhere
if errorlevel 11 goto teamcity-sqlServerOdbc
if errorlevel 10 goto teamcity-sqlServerCe64
if errorlevel 9 goto teamcity-sqlServerCe32
@@ -312,5 +323,11 @@ move "%CURRENT_CONFIGURATION%" "%CURRENT_CONFIGURATION%-backup" 2> nul
move "%CURRENT_CONFIGURATION%-backup" "%CURRENT_CONFIGURATION%" 2> nul
goto main-menu
+:teamcity-anywhere
+move "%CURRENT_CONFIGURATION%" "%CURRENT_CONFIGURATION%-backup" 2> nul
+%NANT% /f:teamcity.build -D:skip.manual=true -D:CCNetLabel=-1 -D:config.teamcity=sqlanywhere
+move "%CURRENT_CONFIGURATION%-backup" "%CURRENT_CONFIGURATION%" 2> nul
+goto main-menu
+
:end
popd
diff --git a/lib/teamcity/SapSQLAnywhere/SQLAnywhere_installation.txt b/lib/teamcity/SapSQLAnywhere/SQLAnywhere_installation.txt
new file mode 100644
index 00000000000..2c93b30c7cb
--- /dev/null
+++ b/lib/teamcity/SapSQLAnywhere/SQLAnywhere_installation.txt
@@ -0,0 +1,14 @@
+Installation steps for SAP SQL Anywhere 17 for NH TeamCity:
+1. Download SAP SQL Anywhere 17 from https://www.sap.com/products/sql-anywhere.html.
+ Please make sure you comply with it's license.
+
+2. Run the installer
+3. Ensure the MSDTC Windows service is enabled. All transaction scope tests, even
+ those normally not distributed, use it with SAP SQL Anywhere 17
+
+The NHibernate.TestDatabaseSetup should normally do on its own the following operations:
+1. Create the test database with default options
+2. Run the query
+ set option ansi_update_constraints = 'Off'
+ (Otherwise some tests will fail.)
+
diff --git a/src/NHibernate.Config.Templates/SapSQLAnywhere.cfg.xml b/src/NHibernate.Config.Templates/SapSQLAnywhere.cfg.xml
new file mode 100644
index 00000000000..9512fef12d6
--- /dev/null
+++ b/src/NHibernate.Config.Templates/SapSQLAnywhere.cfg.xml
@@ -0,0 +1,21 @@
+
+
+
+
+ NHibernate.Driver.SapSQLAnywhere17Driver
+
+
+ UID=DBA;PWD=sql;Server=localhost;DBN=nhibernate;DBF=c:\nhibernate.db;ASTOP=No;Enlist=false;
+
+ NHibernate.Dialect.SybaseSQLAnywhere12Dialect
+ true=1;false=0
+
+
diff --git a/src/NHibernate.DomainModel/ABCProxy.hbm.xml b/src/NHibernate.DomainModel/ABCProxy.hbm.xml
index 92e85cb547f..1edb5eff84f 100644
--- a/src/NHibernate.DomainModel/ABCProxy.hbm.xml
+++ b/src/NHibernate.DomainModel/ABCProxy.hbm.xml
@@ -10,8 +10,8 @@
-
-
+
+