Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added testing against SQL Server using OdbcDriver

  • Loading branch information...
commit df3be85f42c9488691c1658c58c44eecb80b9535 1 parent adbe4f4
@FlukeFan FlukeFan authored
View
12 ShowBuildMenu.bat
@@ -256,12 +256,14 @@ echo D. NHibernate Trunk - SQLite (32-bit)
echo E. NHibernate Trunk - SQLite (64-bit)
echo F. NHibernate Trunk - PostgreSQL
echo G. NHibernate Trunk - Oracle (32-bit)
+echo H. NHibernate Trunk - SQL Server ODBC (32-bit)
echo.
echo X. Exit to main menu.
echo.
-%BUILDTOOL% prompt ABCDEFGX
-if errorlevel 7 goto main-menu
+%BUILDTOOL% prompt ABCDEFGHX
+if errorlevel 8 goto main-menu
+if errorlevel 7 goto teamcity-sqlServerOdbc
if errorlevel 6 goto teamcity-oracle32
if errorlevel 5 goto teamcity-postgresql
if errorlevel 4 goto teamcity-sqlite64
@@ -312,5 +314,11 @@ move %CURRENT_CONFIGURATION% %CURRENT_CONFIGURATION%-backup 2> nul
move %CURRENT_CONFIGURATION%-backup %CURRENT_CONFIGURATION% 2> nul
goto main-menu
+:teamcity-sqlServerOdbc
+move %CURRENT_CONFIGURATION% %CURRENT_CONFIGURATION%-backup 2> nul
+%NANT% /f:teamcity.build -D:skip.manual=true -D:CCNetLabel=-1 -D:config.teamcity=sqlServerOdbc
+move %CURRENT_CONFIGURATION%-backup %CURRENT_CONFIGURATION% 2> nul
+goto main-menu
+
:end
popd
View
13,754 lib/teamcity/sqlServerOdbc/NHibernate.Test.last-results.xml
13,754 additions, 0 deletions not shown
View
4 src/NHibernate.Test/Hql/Ast/LimitClauseFixture.cs
@@ -1,4 +1,5 @@
using System.Linq;
+using NHibernate.Cfg;
using NHibernate.Hql.Ast.ANTLR;
using NUnit.Framework;
using SharpTestsEx;
@@ -10,7 +11,8 @@ public class LimitClauseFixture : BaseFixture
{
protected override bool AppliesTo(Dialect.Dialect dialect)
{
- return dialect.SupportsVariableLimit;
+ return dialect.SupportsVariableLimit
+ && !(Dialect is Dialect.MsSql2000Dialect && cfg.Properties[Environment.ConnectionDriver] == typeof(Driver.OdbcDriver).FullName); // don't know why, but these tests don't work on SQL Server using ODBC
}
protected override void OnSetUp()
View
30 src/NHibernate.TestDatabaseSetup/TestDatabaseSetup.cs
@@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
+using System.Data.Odbc;
using System.Data.SqlClient;
using System.IO;
using FirebirdSql.Data.FirebirdClient;
-using NHibernate.Cfg;
using NHibernate.Test;
using Npgsql;
using NUnit.Framework;
@@ -19,6 +19,7 @@ static DatabaseSetup()
{
SetupMethods = new Dictionary<string, Action<Cfg.Configuration>>();
SetupMethods.Add("NHibernate.Driver.SqlClientDriver", SetupSqlServer);
+ SetupMethods.Add("NHibernate.Driver.OdbcDriver", SetupSqlServerOdbc);
SetupMethods.Add("NHibernate.Driver.FirebirdClientDriver", SetupFirebird);
SetupMethods.Add("NHibernate.Driver.SQLite20Driver", SetupSQLite);
SetupMethods.Add("NHibernate.Driver.NpgsqlDriver", SetupNpgsql);
@@ -64,6 +65,33 @@ private static void SetupSqlServer(Cfg.Configuration cfg)
}
}
+ private static void SetupSqlServerOdbc(Cfg.Configuration cfg)
+ {
+ var connStr = cfg.Properties[Cfg.Environment.ConnectionString];
+
+ using (var conn = new OdbcConnection(connStr.Replace("Database=nhibernateOdbc", "Database=master")))
+ {
+ conn.Open();
+
+ using (var cmd = conn.CreateCommand())
+ {
+ cmd.CommandText = "drop database nhibernateOdbc";
+
+ try
+ {
+ cmd.ExecuteNonQuery();
+ }
+ catch(Exception e)
+ {
+ Console.WriteLine(e);
+ }
+
+ cmd.CommandText = "create database nhibernateOdbc";
+ cmd.ExecuteNonQuery();
+ }
+ }
+ }
+
private static void SetupFirebird(Cfg.Configuration cfg)
{
try
View
7 teamcity.build
@@ -33,6 +33,13 @@
<!-- default (SQL Server) does not require any additional settings/binaries -->
</target>
+ <target name="setup-teamcity-sqlServerOdbc">
+ <property name="nhibernate.connection.driver_class" value="NHibernate.Driver.OdbcDriver" />
+ <property name="nhibernate.connection.connection_string" value="Driver={SQL Native Client};Server=localhost;Database=nhibernateOdbc;Trusted_Connection=yes" />
+ <property name="NHibernate.Test.IgnoreFail" value="true" />
+ <property name="teamcity.last.result" value="${root.dir}/lib/teamcity/sqlServerOdbc/NHibernate.Test.last-results.xml" />
+ </target>
+
<target name="setup-teamcity-firebird32">
<property name="nhibernate.connection.driver_class" value="NHibernate.Driver.FirebirdClientDriver" />
<property name="nhibernate.dialect" value="NHibernate.Dialect.FirebirdDialect" />
Please sign in to comment.
Something went wrong with that request. Please try again.