File tree 12 files changed +30
-20
lines changed
NHibernate.Config.Templates
NHibernate.Example.Web/Infrastructure
NHibernate.TestDatabaseSetup
12 files changed +30
-20
lines changed Original file line number Diff line number Diff line change 2
2
<project xmlns =" http://nant.sf.net/release/0.85-rc3/nant.xsd" >
3
3
<property name =" nhibernate.dialect" value =" NHibernate.Dialect.MsSql2008Dialect" overwrite =" false" />
4
4
<property name =" nhibernate.command_timeout" value =" 444" overwrite =" false" />
5
- <property name =" nhibernate.connection.driver_class" value =" NHibernate.Driver.SqlClientDriver " overwrite =" false" />
5
+ <property name =" nhibernate.connection.driver_class" value =" NHibernate.Driver.Sql2008ClientDriver " overwrite =" false" />
6
6
<property name =" nhibernate.connection.connection_string" value =" Server=.\SQLExpress;initial catalog=nhibernate;Integrated Security=SSPI" overwrite =" false" />
7
7
</project >
Original file line number Diff line number Diff line change 15
15
<property name =" format_sql" >true</property >
16
16
17
17
<!-- This is the System.Data.dll provider for MSSQL Server -->
18
- <property name =" connection.driver_class" >NHibernate.Driver.SqlClientDriver </property >
18
+ <property name =" connection.driver_class" >NHibernate.Driver.Sql2008ClientDriver </property >
19
19
<property name =" dialect" >NHibernate.Dialect.MsSql2008Dialect</property >
20
20
<property name =" connection.connection_string" >Server=.\SQLExpress;initial catalog=nhibernate;Integrated Security=SSPI</property >
21
21
<property name =" show_sql" >false</property >
Original file line number Diff line number Diff line change @@ -7,10 +7,10 @@ for your own use before compile tests in VisualStudio.
7
7
<!-- This is the System.Data.dll provider for SQL Server -->
8
8
<hibernate-configuration xmlns =" urn:nhibernate-configuration-2.2" >
9
9
<session-factory name =" NHibernate.Test" >
10
- <property name =" connection.driver_class" >NHibernate.Driver.SqlClientDriver </property >
10
+ <property name =" connection.driver_class" >NHibernate.Driver.Sql2008ClientDriver </property >
11
11
<property name =" connection.connection_string" >
12
12
Server=(local);initial catalog=nhibernate;Integrated Security=SSPI
13
13
</property >
14
14
<property name =" dialect" >NHibernate.Dialect.MsSql2008Dialect</property >
15
15
</session-factory >
16
- </hibernate-configuration >
16
+ </hibernate-configuration >
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ public AppSessionFactory(Microsoft.Extensions.Logging.ILoggerFactory loggerFacto
24
24
{
25
25
db . ConnectionString = @"Server=(local)\SQLEXPRESS;initial catalog=nhibernate;Integrated Security=true" ;
26
26
db . Dialect < MsSql2008Dialect > ( ) ;
27
- db . Driver < SqlClientDriver > ( ) ;
27
+ db . Driver < Sql2008ClientDriver > ( ) ;
28
28
} )
29
29
. AddMapping ( domainMapping ) ;
30
30
Configuration . SessionFactory ( ) . GenerateStatistics ( ) ;
@@ -37,4 +37,4 @@ public ISession OpenSession()
37
37
return SessionFactory . OpenSession ( ) ;
38
38
}
39
39
}
40
- }
40
+ }
Original file line number Diff line number Diff line change 30
30
31
31
<property name =" dialect" >NHibernate.Dialect.MsSql2008Dialect</property >
32
32
33
- <property name =" connection.driver_class" >NHibernate.Driver.SqlClientDriver </property > <!-- Shouldn't be necessary, but is required by some tests -->
33
+ <property name =" connection.driver_class" >NHibernate.Driver.Sql2008ClientDriver </property > <!-- Shouldn't be necessary, but is required by some tests -->
34
34
<property name =" connection.connection_string_name" >TestConnectionString</property >
35
35
<property name =" connection.provider" >NHibernate.Test.DebugConnectionProvider, NHibernate.Test</property >
36
36
<property name =" connection.isolation" >ReadCommitted</property > <!-- See System.Data.IsolationLevel for valid values -->
Original file line number Diff line number Diff line change 10
10
11
11
using System . Linq ;
12
12
using NHibernate . Cfg ;
13
+ using NHibernate . Driver ;
13
14
using NHibernate . Hql . Ast . ANTLR ;
15
+ using NHibernate . Util ;
14
16
using NUnit . Framework ;
15
17
16
18
namespace NHibernate . Test . Hql . Ast
@@ -22,7 +24,8 @@ public class LimitClauseFixtureAsync : BaseFixture
22
24
protected override bool AppliesTo ( Dialect . Dialect dialect )
23
25
{
24
26
return dialect . SupportsVariableLimit
25
- && ! ( 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
27
+ && ! ( Dialect is Dialect . MsSql2000Dialect && // don't know why, but these tests don't work on SQL Server using ODBC
28
+ typeof ( OdbcDriver ) . IsAssignableFrom ( ReflectHelper . ClassForName ( cfg . GetProperty ( Environment . ConnectionDriver ) ) ) ) ;
26
29
}
27
30
28
31
protected override void OnSetUp ( )
@@ -186,4 +189,4 @@ public async Task TakeWithParameterAsync()
186
189
s . Close ( ) ;
187
190
}
188
191
}
189
- }
192
+ }
Original file line number Diff line number Diff line change 12
12
using NHibernate . AdoNet ;
13
13
using NHibernate . Cfg ;
14
14
using NHibernate . Driver ;
15
+ using NHibernate . Util ;
15
16
using NUnit . Framework ;
16
17
17
18
namespace NHibernate . Test . NHSpecificTest . NH1144
@@ -36,7 +37,7 @@ protected override void Configure(Configuration configuration)
36
37
[ Test ]
37
38
public async Task CanSaveInSingleBatchAsync ( )
38
39
{
39
- if ( configuration . Properties [ Environment . ConnectionDriver ] . Contains ( typeof ( OracleDataClientDriver ) . Name ) == false )
40
+ if ( ! typeof ( OracleDataClientDriver ) . IsAssignableFrom ( ReflectHelper . ClassForName ( cfg . GetProperty ( Environment . ConnectionDriver ) ) ) )
40
41
{
41
42
Assert . Ignore ( "Only applicable for Oracle Data Client driver" ) ;
42
43
}
@@ -85,4 +86,4 @@ public async Task CanSaveInSingleBatchAsync()
85
86
Assert . IsTrue ( executedBatch ) ;
86
87
}
87
88
}
88
- }
89
+ }
Original file line number Diff line number Diff line change 13
13
using NHibernate . Cfg ;
14
14
using NHibernate . Dialect ;
15
15
using NHibernate . Driver ;
16
+ using NHibernate . Util ;
16
17
using NUnit . Framework ;
17
18
18
19
namespace NHibernate . Test . NHSpecificTest . NH3202
@@ -26,7 +27,7 @@ protected override void Configure(Configuration configuration)
26
27
if ( ! ( Dialect is MsSql2008Dialect ) )
27
28
Assert . Ignore ( "Test is for MS SQL Server dialect only (custom dialect)." ) ;
28
29
29
- if ( ! Environment . ConnectionDriver . Contains ( "SqlClientDriver" ) )
30
+ if ( ! typeof ( SqlClientDriver ) . IsAssignableFrom ( ReflectHelper . ClassForName ( cfg . GetProperty ( Environment . ConnectionDriver ) ) ) )
30
31
Assert . Ignore ( "Test is for MS SQL Server driver only (custom driver is used)." ) ;
31
32
32
33
cfg . SetProperty ( Environment . Dialect , typeof ( OffsetStartsAtOneTestDialect ) . AssemblyQualifiedName ) ;
Original file line number Diff line number Diff line change 1
1
using System . Linq ;
2
2
using NHibernate . Cfg ;
3
+ using NHibernate . Driver ;
3
4
using NHibernate . Hql . Ast . ANTLR ;
5
+ using NHibernate . Util ;
4
6
using NUnit . Framework ;
5
7
6
8
namespace NHibernate . Test . Hql . Ast
@@ -11,7 +13,8 @@ public class LimitClauseFixture : BaseFixture
11
13
protected override bool AppliesTo ( Dialect . Dialect dialect )
12
14
{
13
15
return dialect . SupportsVariableLimit
14
- && ! ( 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
16
+ && ! ( Dialect is Dialect . MsSql2000Dialect && // don't know why, but these tests don't work on SQL Server using ODBC
17
+ typeof ( OdbcDriver ) . IsAssignableFrom ( ReflectHelper . ClassForName ( cfg . GetProperty ( Environment . ConnectionDriver ) ) ) ) ;
15
18
}
16
19
17
20
protected override void OnSetUp ( )
@@ -175,4 +178,4 @@ public void TakeWithParameter()
175
178
s . Close ( ) ;
176
179
}
177
180
}
178
- }
181
+ }
Original file line number Diff line number Diff line change 2
2
using NHibernate . AdoNet ;
3
3
using NHibernate . Cfg ;
4
4
using NHibernate . Driver ;
5
+ using NHibernate . Util ;
5
6
using NUnit . Framework ;
6
7
7
8
namespace NHibernate . Test . NHSpecificTest . NH1144
@@ -25,7 +26,7 @@ protected override void Configure(Configuration configuration)
25
26
[ Test ]
26
27
public void CanSaveInSingleBatch ( )
27
28
{
28
- if ( configuration . Properties [ Environment . ConnectionDriver ] . Contains ( typeof ( OracleDataClientDriver ) . Name ) == false )
29
+ if ( ! typeof ( OracleDataClientDriver ) . IsAssignableFrom ( ReflectHelper . ClassForName ( cfg . GetProperty ( Environment . ConnectionDriver ) ) ) )
29
30
{
30
31
Assert . Ignore ( "Only applicable for Oracle Data Client driver" ) ;
31
32
}
@@ -74,4 +75,4 @@ public void CanSaveInSingleBatch()
74
75
Assert . IsTrue ( executedBatch ) ;
75
76
}
76
77
}
77
- }
78
+ }
Original file line number Diff line number Diff line change 3
3
using NHibernate . Cfg ;
4
4
using NHibernate . Dialect ;
5
5
using NHibernate . Driver ;
6
+ using NHibernate . Util ;
6
7
using NUnit . Framework ;
7
8
8
9
namespace NHibernate . Test . NHSpecificTest . NH3202
@@ -15,7 +16,7 @@ protected override void Configure(Configuration configuration)
15
16
if ( ! ( Dialect is MsSql2008Dialect ) )
16
17
Assert . Ignore ( "Test is for MS SQL Server dialect only (custom dialect)." ) ;
17
18
18
- if ( ! Environment . ConnectionDriver . Contains ( "SqlClientDriver" ) )
19
+ if ( ! typeof ( SqlClientDriver ) . IsAssignableFrom ( ReflectHelper . ClassForName ( cfg . GetProperty ( Environment . ConnectionDriver ) ) ) )
19
20
Assert . Ignore ( "Test is for MS SQL Server driver only (custom driver is used)." ) ;
20
21
21
22
cfg . SetProperty ( Environment . Dialect , typeof ( OffsetStartsAtOneTestDialect ) . AssemblyQualifiedName ) ;
Original file line number Diff line number Diff line change 2
2
<configuration >
3
3
<configSections >
4
4
<section name =" hibernate-configuration"
5
- type =" NHibernate.Cfg.ConfigurationSectionHandler, NHibernate" />
5
+ type =" NHibernate.Cfg.ConfigurationSectionHandler, NHibernate" />
6
6
</configSections >
7
7
8
8
<hibernate-configuration xmlns =" urn:nhibernate-configuration-2.2" >
9
9
<session-factory name =" NHibernate.TestDatabaseSetup" >
10
- <property name =" connection.driver_class" >NHibernate.Driver.SqlClientDriver </property >
11
- <property name =" connection.connection_string" >
10
+ <property name =" connection.driver_class" >NHibernate.Driver.Sql2008ClientDriver </property >
11
+ <property name =" connection.connection_string" >
12
12
Server=.\SQLExpress;initial catalog=master;Integrated Security=SSPI
13
13
</property >
14
14
</session-factory >
You can’t perform that action at this time.
0 commit comments