Allow configuration of BytecodeProvider with a LocalSessionFactory property

This commit is contained in:
lahma
2009-12-14 15:30:15 +00:00
parent 29410497a7
commit f3972d09d4
3 changed files with 46 additions and 12 deletions

View File

@@ -26,11 +26,13 @@ using NHibernate.Connection;
using NHibernate.Dialect;
using NHibernate.Driver;
using Spring.Context.Support;
using Spring.Data.Common;
using NUnit.Framework;
#if NH_2_1
using Spring.Data.NHibernate.Bytecode;
#endif
namespace Spring.Data.NHibernate
@@ -50,6 +52,8 @@ namespace Spring.Data.NHibernate
dbProvider.ConnectionString = "Data Source=(local);Database=Spring;Trusted_Connection=false";
LocalSessionFactoryObject sfo = new LocalSessionFactoryObject();
sfo.DbProvider = dbProvider;
sfo.ApplicationContext = new StaticApplicationContext();
IDictionary properties = new Hashtable();
properties.Add(Environment.Dialect, typeof(MsSql2000Dialect).AssemblyQualifiedName);
properties.Add(Environment.ConnectionDriver, typeof(SqlClientDriver).AssemblyQualifiedName);
@@ -70,6 +74,8 @@ namespace Spring.Data.NHibernate
#if NH_2_1
Assert.AreEqual(sfo.Configuration.Properties[Environment.ProxyFactoryFactoryClass], typeof(ProxyFactoryFactory).AssemblyQualifiedName);
// Spring's IBytecodeProvider should be the default
// Assert.AreEqual(typeof(BytecodeProvider), Environment.BytecodeProvider.GetType(), "default IBytecodeProvider was not Spring's BytecodeProvider");
#endif
}

View File

@@ -44,10 +44,6 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\lib\NHibernate21\net\2.0\Iesi.Collections.dll</HintPath>
</Reference>
<Reference Include="LinFu.DynamicProxy, Version=1.0.3.14911, Culture=neutral, PublicKeyToken=62a6874124340d6e, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\lib\NHibernate21\net\2.0\LinFu.DynamicProxy.dll</HintPath>
</Reference>
<Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\lib\NHibernate21\net\2.0\log4net.dll</HintPath>