fixed NH21 integration ProxyFactoryFactory Bug

This commit is contained in:
eeichinger
2009-08-05 15:56:23 +00:00
parent 070c33503e
commit 9fb46fd5fb
27 changed files with 451 additions and 198 deletions

View File

@@ -27,12 +27,12 @@ using NHibernate.Dialect;
using NHibernate.Driver;
using Spring.Data.Common;
using NUnit.Framework;
#if NH_2_1
using Spring.Data.NHibernate.Bytecode;
#endif
using NUnit.Framework;
namespace Spring.Data.NHibernate
{
/// <summary>

View File

@@ -0,0 +1,34 @@
#region License
/*
* Copyright 2002-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#endregion
using System;
using NUnit.Framework;
namespace Spring.Data.NHibernate.Bytecode
{
/// <summary>
/// </summary>
/// <author>Erich Eichinger</author>
[TestFixture]
public class NHibernateTestImports : global::NHibernate.Test.Bytecode.ActivatorObjectFactoryFixture
{
}
}

View File

@@ -0,0 +1,114 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="hibernate-configuration"
type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate" />
<section name="log4net"
type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
</configSections>
<connectionStrings>
<add name="TestConnectionString"
connectionString="TestConnectionString-TestConnectionString" />
</connectionStrings>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"
applies-to="v1.1.4322">
<qualifyAssembly partialName="System.Web"
fullName="System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"
applies-to="v2.0.50727">
<qualifyAssembly partialName="System.Web"
fullName="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<!-- The assembly binding for FirebirdClient ADO.NET 2.0 DataProvider -->
<qualifyAssembly partialName="FirebirdSql.Data.FirebirdClient" fullName="FirebirdSql.Data.FirebirdClient, Version=2.1.0.0, Culture=neutral, PublicKeyToken=3750abcc3150b00c" />
<!-- Spring.NET uses a new version of NUnit -->
<dependentAssembly>
<assemblyIdentity name="nunit.framework" publicKeyToken="96d09a1eb7f44a77" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="2.5.1.9189"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<bytecode-provider type="lcg"/>
<reflection-optimizer use="true"/>
<session-factory name="NHibernate.Test">
<property name="connection.provider">NHibernate.Test.DebugConnectionProvider, NHibernate.Test</property>
<property name="cache.provider_class">NHibernate.Cache.HashtableCacheProvider, NHibernate</property>
<property name="cache.use_query_cache">true</property>
<property name="query.startup_check">false</property>
<!--
The valid strings for Isolation can be found in the documentation for the System.Data.IsolationLevel
Enumeration documentation.
Use the member names - not the values.
-->
<property name="adonet.batch_size">10</property>
<property name="connection.isolation">ReadCommitted</property>
<property name="hbm2ddl.keywords">none</property>
<property name="format_sql">true</property>
<!-- This is the System.Data.dll provider for MSSQL Server -->
<property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property>
<property name="dialect">NHibernate.Dialect.MsSql2005Dialect</property>
<property name="connection.connection_string">Server=SPRINGQA;initial catalog=nhibernate;Integrated Security=SSPI</property>
<property name="show_sql">false</property>
<property name="use_outer_join">true</property>
<property name="command_timeout">444</property>
<property name="query.substitutions">true 1, false 0, yes 'Y', no 'N'</property>
<property name="adonet.wrap_result_sets">false</property>
<!-- <property name="proxyfactory.factory_class">NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu</property>-->
<property name="proxyfactory.factory_class">Spring.Data.NHibernate.Bytecode.ProxyFactoryFactory, Spring.Data.NHibernate21</property>
</session-factory>
</hibernate-configuration>
<log4net>
<!-- Define some output appenders -->
<appender name="trace"
type="log4net.Appender.TraceAppender, log4net">
<layout type="log4net.Layout.PatternLayout,log4net">
<param name="ConversionPattern"
value="%d{ABSOLUTE} %-5p %c{1}:%L - %m%n" />
</layout>
</appender>
<appender name="console"
type="log4net.Appender.ConsoleAppender, log4net">
<layout type="log4net.Layout.PatternLayout,log4net">
<param name="ConversionPattern"
value="%d{ABSOLUTE} %-5p %c{1}:%L - %m%n" />
</layout>
</appender>
<root>
<priority value="WARN" />
<appender-ref ref="trace" />
<appender-ref ref="console" />
</root>
<logger name="NHibernate.Hql.Ast.ANTLR">
<priority value="OFF" />
</logger>
<logger name="NHibernate.SQL">
<level value="OFF" />
</logger>
<logger name="NHibernate.AdoNet.AbstractBatcher">
<level value="OFF" />
</logger>
<logger name="NHibernate.Tool.hbm2ddl.SchemaExport">
<level value="ERROR" />
</logger>
</log4net>
</configuration>

View File

@@ -8,12 +8,24 @@ BEGIN
END
GO
IF EXISTS (SELECT name FROM sys.databases WHERE name = N'NHibernate')
BEGIN
ALTER DATABASE NHibernate
SET SINGLE_USER
WITH ROLLBACK IMMEDIATE
DROP DATABASE NHibernate
END
GO
IF EXISTS (SELECT * FROM sys.server_principals WHERE name = N'springqa2')
DROP LOGIN [springqa2]
GO
CREATE DATABASE Spring
GO
CREATE DATABASE NHibernate
GO
CREATE LOGIN [springqa2] WITH PASSWORD=N'springqa2', DEFAULT_DATABASE=[Spring], DEFAULT_LANGUAGE=[us_english]
GO

View File

@@ -36,10 +36,18 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\lib\Net\2.0\Common.Logging.dll</HintPath>
</Reference>
<Reference Include="DotNetMock, Version=0.8.1.0, Culture=neutral, PublicKeyToken=65e474d141e25e07">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\lib\Net\2.0\DotNetMock.dll</HintPath>
</Reference>
<Reference Include="Iesi.Collections, Version=1.0.0.3, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
<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>
@@ -61,7 +69,10 @@
<HintPath>..\..\..\lib\Net\2.0\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.configuration" />
<Reference Include="System.Data" />
<Reference Include="System.Data.OracleClient" />
<Reference Include="System.Transactions" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
@@ -122,6 +133,13 @@
<Compile Include="..\Spring.Data.NHibernate.Integration.Tests\Data\NHibernate\TestObject.cs">
<Link>Data\NHibernate\TestObject.cs</Link>
</Compile>
<Compile Include="Data\NHibernate\Bytecode\AbstractInjectableUserTypeFixture.cs" />
<Compile Include="Data\NHibernate\Bytecode\Foo.cs" />
<Compile Include="Data\NHibernate\Bytecode\IDelimiter.cs" />
<Compile Include="Data\NHibernate\Bytecode\InjectableStringUserType.cs" />
<Compile Include="Data\NHibernate\Bytecode\InjectableUserTypeFixture.cs" />
<Compile Include="Data\NHibernate\Bytecode\NHibernateTestImports.cs" />
<Compile Include="Data\NHibernate\Bytecode\Product.cs" />
<Compile Include="Setup.cs" />
</ItemGroup>
<ItemGroup>
@@ -132,6 +150,9 @@
<EmbeddedResource Include="..\Spring.Data.NHibernate.Integration.Tests\Data\NHibernate\testObject.sql">
<Link>Data\NHibernate\testObject.sql</Link>
</EmbeddedResource>
<None Include="NHibernate.Test.dll.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Include="Spring.Data.NHibernate21.Integration.Tests.build" />
<None Include="Spring.Data.NHibernate21.Integration.Tests.dll.config" />
</ItemGroup>
@@ -145,7 +166,7 @@
<Name>Spring.Core.2008</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\src\Spring\Spring.Data.NHibernate21\Spring.Data.NHibernate21.2008.csproj">
<Project>{71368632-B8B7-4A6A-8C65-8DA848120C82}</Project>
<Project>{E57B4652-0231-49CB-B058-87E10EFE540D}</Project>
<Name>Spring.Data.NHibernate21.2008</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\src\Spring\Spring.Data\Spring.Data.2008.csproj">
@@ -174,6 +195,12 @@
<EmbeddedResource Include="Data\NHibernate\dbProviderTemplateTests.xml" />
<EmbeddedResource Include="Data\NHibernate\templateTests.xml" />
</ItemGroup>
<ItemGroup>
<Content Include="Data\NHibernate\Bytecode\Foo.Spechbm.xml" />
<Content Include="TestEnbeddedConfig.cfg.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

View File

@@ -55,10 +55,28 @@
<copy file="${project::get-base-directory()}/${project::get-name()}.dll.config"
tofile="${current.bin.dir}/${project::get-name()}.dll.config"/>
<copy todir="${current.bin.dir}" overwrite="true">
<fileset basedir="${project::get-base-directory()}">
<include name="NHibernate.Test.dll.config" />
<include name="TestEnbeddedConfig.cfg.xml" />
</fileset>
</copy>
</target>
<target name="test" depends="build">
<property name="test.assemblyfile" value="${project::get-name()}.dll" />
<call target="common.run-tests" if="${test.integration.data}" />
<property name="test.assemblyfile" value="NHibernate.Test.dll" />
<call target="common.run-tests" if="${test.integration.data}" />
<!-- cleanup after NH tests - they unfortunately generate a bunch of assemblies as well -->
<delete>
<fileset basedir="${current.bin.dir}">
<include name="*.hbm.xml"/>
<include name="My*.*"/>
</fileset>
</delete>
</target>
</project>

View File

@@ -9,6 +9,30 @@
</sectionGroup>
</configSections>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"
applies-to="v1.1.4322">
<qualifyAssembly partialName="System.Web"
fullName="System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"
applies-to="v2.0.50727">
<qualifyAssembly partialName="System.Web"
fullName="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</assemblyBinding>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<!-- The assembly binding for FirebirdClient ADO.NET 2.0 DataProvider -->
<qualifyAssembly partialName="FirebirdSql.Data.FirebirdClient" fullName="FirebirdSql.Data.FirebirdClient, Version=2.1.0.0, Culture=neutral, PublicKeyToken=3750abcc3150b00c" />
<!-- Spring.NET uses a new version of NUnit -->
<dependentAssembly>
<assemblyIdentity name="nunit.framework" publicKeyToken="96d09a1eb7f44a77" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-65535.65535.65535.65535" newVersion="2.5.1.9189"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
<common>
<logging>

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2" >
<session-factory name="NHibernate.Test">
<property name="connection.provider">NHibernate.Test.DebugConnectionProvider, NHibernate.Test</property>
<property name="cache.provider_class">NHibernate.Cache.HashtableCacheProvider, NHibernate</property>
<property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property>
<property name="connection.connection_string">Server=localhost;initial catalog=nhibernate;User Id=;Password=</property>
<property name="query.substitutions">true 1, false 0, yes 1, no 0</property>
<property name="dialect">NHibernate.Dialect.MsSql2000Dialect</property>
</session-factory>
</hibernate-configuration>

View File

@@ -91,12 +91,6 @@
<Link>Data\NHibernate\TestObject.cs</Link>
</Compile>
<Compile Include="AssemblyInfo.cs" />
<Compile Include="Data\NHibernate\Bytecode\AbstractInjectableUserTypeFixture.cs" />
<Compile Include="Data\NHibernate\Bytecode\Foo.cs" />
<Compile Include="Data\NHibernate\Bytecode\IDelimiter.cs" />
<Compile Include="Data\NHibernate\Bytecode\InjectableStringUserType.cs" />
<Compile Include="Data\NHibernate\Bytecode\InjectableUserTypeFixture.cs" />
<Compile Include="Data\NHibernate\Bytecode\Product.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Spring.Data.NHibernate21.Tests.build" />
@@ -114,7 +108,7 @@
<Name>Spring.Core.2008</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\src\Spring\Spring.Data.NHibernate21\Spring.Data.NHibernate21.2008.csproj">
<Project>{71368632-B8B7-4A6A-8C65-8DA848120C82}</Project>
<Project>{E57B4652-0231-49CB-B058-87E10EFE540D}</Project>
<Name>Spring.Data.NHibernate21.2008</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\src\Spring\Spring.Data\Spring.Data.2008.csproj">
@@ -133,9 +127,6 @@
<ItemGroup>
<EmbeddedResource Include="Data\NHibernate\TestObject.hbm.xml" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Data\NHibernate\Bytecode\Foo.Spechbm.xml" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.