Skip to content

Commit

Permalink
Merge pull request #2 from nhibernate/master
Browse files Browse the repository at this point in the history
Syncing my fork
  • Loading branch information
djechelon committed Dec 29, 2014
2 parents dd66868 + fac75a2 commit af72f6d
Show file tree
Hide file tree
Showing 311 changed files with 27,125 additions and 27,102 deletions.
2 changes: 1 addition & 1 deletion Tools/nunit/nunit-x86.exe.config
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
-->
<startup useLegacyV2RuntimeActivationPolicy="true">
<!-- Comment out the next line to force use of .NET 4.0 -->
<supportedRuntime version="v2.0.50727" />
<!--<supportedRuntime version="v2.0.50727" />-->
<supportedRuntime version="v4.0.30319" />
</startup>

Expand Down
2 changes: 1 addition & 1 deletion Tools/nunit/nunit.exe.config
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
-->
<startup useLegacyV2RuntimeActivationPolicy="true">
<!-- Comment out the next line to force use of .NET 4.0 -->
<supportedRuntime version="v2.0.50727" />
<!--<supportedRuntime version="v2.0.50727" />-->
<supportedRuntime version="v4.0.30319" />
</startup>

Expand Down
2 changes: 1 addition & 1 deletion build-common/common.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
effectively SP0).
-->

<property name="project.version" value="4.0.1.GA" overwrite="false" />
<property name="project.version" value="4.0.2.GA" overwrite="false" />

<!-- This version number should be changed if, but only if, there are incompatible
changes compared to the previous version. -->
Expand Down
2 changes: 1 addition & 1 deletion doc/reference/modules/performance.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1149,7 +1149,7 @@ sessionFactory.EvictCollection("Eg.Cat.Kittens"); //evict all kitten collections
</para>

<para>
one-shot-delete apply to collections mapped <literal>inverse="true"</literal>.
Of course, one-shot-delete does not apply to collections mapped <literal>inverse="true"</literal>.
</para>

</sect2>
Expand Down
Binary file removed lib/net/SharpTestsEx.NUnit.dll
Binary file not shown.
772 changes: 0 additions & 772 deletions lib/net/SharpTestsEx.NUnit.xml

This file was deleted.

31 changes: 0 additions & 31 deletions lib/net/SharpTestsEx_License.txt

This file was deleted.

629 changes: 349 additions & 280 deletions lib/teamcity/firebird/NHibernate.Test.last-results.xml

Large diffs are not rendered by default.

382 changes: 294 additions & 88 deletions lib/teamcity/mysql/NHibernate.Test.last-results.xml

Large diffs are not rendered by default.

2,888 changes: 1,833 additions & 1,055 deletions lib/teamcity/oracle/NHibernate.Test.last-results.xml

Large diffs are not rendered by default.

11,205 changes: 5,031 additions & 6,174 deletions lib/teamcity/sqlServerCe/NHibernate.Test.last-results.xml

Large diffs are not rendered by default.

31,951 changes: 16,098 additions & 15,853 deletions lib/teamcity/sqlServerOdbc/NHibernate.Test.last-results.xml

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions releasenotes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@

Build 4.0.2.GA
=============================

** Bug
* [NH-2779] - Session.Get() can throw InvalidCastException when log-level is set to DEBUG
* [NH-2782] - Linq: selecting into a new array doesn't work
* [NH-2831] - NH cannot load mapping assembly from GAC
* [NH-3049] - Mapping by code to Field not working
* [NH-3222] - NHibernate Futures passes empty tuples to ResultSetTransformer
* [NH-3650] - ComponentAsId<T> used more than once, cache first mapping and produces subsequently a sql select wrong
* [NH-3709] - Fix Reference to One Shot Delete and Inverse Collections
* [NH-3710] - Use of SetLockMode with DetachedCriteria causes null reference exception

** Task
* [NH-3697] - Ignore Firebird in NHSpecificTest.NH1981
* [NH-3698] - NHSpecificTest.NH1989 fails for some drivers


Build 4.0.1.GA
=============================

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
<include name="NHibernate.DomainModel.dll" />
<include name="NHibernate.dll" />
<include name="nunit.framework.dll" />
<include name="SharpTestsEx.NUnit.dll" />
<include name="System.Linq.Dynamic.dll" />
</assemblyfileset>
<resourcefileset id="project.resources" prefix="NHibernate.Test.VisualBasic" dynamicprefix="false">
Expand Down
8 changes: 8 additions & 0 deletions src/NHibernate.Test/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,13 @@
</log4net>

<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="nunit.framework" publicKeyToken="96d09a1eb7f44a77" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-2.6.1.12217" newVersion="2.6.1.12217"/>
</dependentAssembly>
</assemblyBinding>
</runtime>

</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using NHibernate.Bytecode;
using NHibernate.Bytecode.Lightweight;
using NUnit.Framework;
using SharpTestsEx;
using Environment=NHibernate.Cfg.Environment;

namespace NHibernate.Test.Bytecode.Lightweight
Expand All @@ -15,7 +14,7 @@ public void NotConfiguredProxyFactoryFactory()
{
var bcp = new BytecodeProviderImpl();
IProxyFactoryFactory p = bcp.ProxyFactoryFactory;
p.Should().Be.InstanceOf<DefaultProxyFactoryFactory>();
Assert.That(p, Is.InstanceOf<DefaultProxyFactoryFactory>());
}

[Test]
Expand Down
7 changes: 3 additions & 4 deletions src/NHibernate.Test/CfgTest/AccessorsSerializableTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.Linq;
using NHibernate.Properties;
using NUnit.Framework;
using SharpTestsEx;

namespace NHibernate.Test.CfgTest
{
Expand All @@ -13,23 +12,23 @@ public class AccessorsSerializableTest
[Test, TestCaseSource("accessors")]
public void AllAccessorsAreMarkedAsSerializable(System.Type concreteAccessor)
{
concreteAccessor.Should().Have.Attribute<SerializableAttribute>();
Assert.That(concreteAccessor, Has.Attribute<SerializableAttribute>());
}

private static System.Type[] setters = typeof(ISetter).Assembly.GetTypes().Where(t => t.Namespace == typeof(ISetter).Namespace && t.GetInterfaces().Contains(typeof(ISetter))).ToArray();

[Test, TestCaseSource("setters")]
public void AllSettersAreMarkedAsSerializable(System.Type concreteAccessor)
{
concreteAccessor.Should().Have.Attribute<SerializableAttribute>();
Assert.That(concreteAccessor, Has.Attribute<SerializableAttribute>());
}

private static System.Type[] getters = typeof(IGetter).Assembly.GetTypes().Where(t => t.Namespace == typeof(IGetter).Namespace && t.GetInterfaces().Contains(typeof(IGetter))).ToArray();

[Test, TestCaseSource("getters")]
public void AllGettersAreMarkedAsSerializable(System.Type concreteAccessor)
{
concreteAccessor.Should().Have.Attribute<SerializableAttribute>();
Assert.That(concreteAccessor, Has.Attribute<SerializableAttribute>());
}
}
}
21 changes: 10 additions & 11 deletions src/NHibernate.Test/CfgTest/ConfigurationAddMappingEvents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using NHibernate.Cfg.Loquacious;
using NHibernate.Dialect;
using NUnit.Framework;
using SharpTestsEx;

namespace NHibernate.Test.CfgTest
{
Expand Down Expand Up @@ -45,15 +44,15 @@ public void WhenSubscribedToBeforeBindThenRaiseEventForEachMapping()
var listOfCalls = new List<BindMappingEventArgs>();
var configuration = new Configuration();
configuration.DataBaseIntegration(x => x.Dialect<MsSql2008Dialect>());
configuration.BeforeBindMapping += (sender, args) => { sender.Should().Be.SameInstanceAs(configuration); listOfCalls.Add(args); };
configuration.BeforeBindMapping += (sender, args) => { Assert.That(sender, Is.SameAs(configuration)); listOfCalls.Add(args); };

configuration.AddXmlString(ProductLineMapping);
configuration.AddXmlString(ModelMapping);

listOfCalls.Count.Should().Be(2);
listOfCalls.Select(x => x.FileName).All(x => x.Satisfy(filename => filename != null));
listOfCalls.Select(x => x.Mapping).All(x => x.Satisfy(mappingDoc => mappingDoc != null));
listOfCalls.Select(x => x.Dialect).All(x => x.Satisfy(dialect => dialect.GetType() == typeof(MsSql2008Dialect)));
Assert.That(listOfCalls.Count, Is.EqualTo(2));
Assert.That(listOfCalls.Select(x => x.FileName).All(x => x != null), Is.True);
Assert.That(listOfCalls.Select(x => x.Mapping).All(x => x != null), Is.True);
Assert.That(listOfCalls.Select(x => x.Dialect).All(x => x.GetType() == typeof (MsSql2008Dialect)), Is.True);
}

[Test]
Expand All @@ -62,15 +61,15 @@ public void WhenSubscribedToAfterBindThenRaiseEventForEachMapping()
var listOfCalls = new List<BindMappingEventArgs>();
var configuration = new Configuration();
configuration.DataBaseIntegration(x => x.Dialect<MsSql2008Dialect>());
configuration.AfterBindMapping += (sender, args) => { sender.Should().Be.SameInstanceAs(configuration); listOfCalls.Add(args); };
configuration.AfterBindMapping += (sender, args) => { Assert.That(sender, Is.SameAs(configuration)); listOfCalls.Add(args); };

configuration.AddXmlString(ProductLineMapping);
configuration.AddXmlString(ModelMapping);

listOfCalls.Count.Should().Be(2);
listOfCalls.Select(x => x.FileName).All(x => x.Satisfy(filename => filename != null));
listOfCalls.Select(x => x.Mapping).All(x => x.Satisfy(mappingDoc => mappingDoc != null));
listOfCalls.Select(x => x.Dialect).All(x => x.Satisfy(dialect => dialect.GetType() == typeof(MsSql2008Dialect)));
Assert.That(listOfCalls.Count, Is.EqualTo(2));
Assert.That(listOfCalls.Select(x => x.FileName).All(x => x != null), Is.True);
Assert.That(listOfCalls.Select(x => x.Mapping).All(x => x != null), Is.True);
Assert.That(listOfCalls.Select(x => x.Dialect).All(x => x.GetType() == typeof(MsSql2008Dialect)), Is.True);
}
}
}
3 changes: 1 addition & 2 deletions src/NHibernate.Test/CfgTest/ConfigurationSchemaFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using NHibernate.Cfg;
using NHibernate.Cfg.ConfigurationSchema;
using System.Xml;
using SharpTestsEx;

namespace NHibernate.Test.CfgTest
{
Expand All @@ -29,7 +28,7 @@ public void InvalidConfig()
public void FromAppConfigTest()
{
IHibernateConfiguration hc = ConfigurationManager.GetSection("hibernate-configuration") as IHibernateConfiguration;
hc.ByteCodeProviderType.Should().Be("lcg");
Assert.That(hc.ByteCodeProviderType, Is.EqualTo("lcg"));
Assert.IsTrue(hc.UseReflectionOptimizer);
Assert.AreEqual("NHibernate.Test", hc.SessionFactory.Name);
}
Expand Down
11 changes: 5 additions & 6 deletions src/NHibernate.Test/CfgTest/CustomBytecodeProviderTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using NHibernate.Bytecode;
using NHibernate.Properties;
using NUnit.Framework;
using SharpTestsEx;
using Environment = NHibernate.Cfg.Environment;

namespace NHibernate.Test.CfgTest
Expand Down Expand Up @@ -34,29 +33,29 @@ public override IReflectionOptimizer GetReflectionOptimizer(System.Type clazz, I
public void WhenNoShortCutUsedThenCanBuildBytecodeProvider()
{
var properties = new Dictionary<string, string> { { Environment.PropertyBytecodeProvider, typeof(MyByteCodeProvider).AssemblyQualifiedName } };
Executing.This(() => Environment.BuildBytecodeProvider(properties)).Should().NotThrow();
Assert.That(() => Environment.BuildBytecodeProvider(properties), Throws.Nothing);
}

[Test]
public void WhenNoShortCutUsedThenCanBuildInstanceOfConfiguredBytecodeProvider()
{
var properties = new Dictionary<string, string> { { Environment.PropertyBytecodeProvider, typeof(MyByteCodeProvider).AssemblyQualifiedName } };
Environment.BuildBytecodeProvider(properties).Should().Be.InstanceOf<MyByteCodeProvider>();
Assert.That(Environment.BuildBytecodeProvider(properties), Is.InstanceOf<MyByteCodeProvider>());
}

[Test]
public void WhenInvalidThenThrow()
{
var properties = new Dictionary<string, string> { { Environment.PropertyBytecodeProvider, typeof(InvalidByteCodeProvider).AssemblyQualifiedName } };
Executing.This(() => Environment.BuildBytecodeProvider(properties)).Should().Throw<HibernateByteCodeException>();
Assert.That(() => Environment.BuildBytecodeProvider(properties), Throws.TypeOf<HibernateByteCodeException>());
}

[Test]
public void WhenNoDefaultCtorThenThrow()
{
var properties = new Dictionary<string, string> { { Environment.PropertyBytecodeProvider, typeof(InvalidNoCtorByteCodeProvider).AssemblyQualifiedName } };
Executing.This(() => Environment.BuildBytecodeProvider(properties)).Should().Throw<HibernateByteCodeException>()
.And.Exception.InnerException.Message.Should().Contain("constructor was not found");
Assert.That(() => Environment.BuildBytecodeProvider(properties), Throws.TypeOf<HibernateByteCodeException>()
.And.InnerException.Message.ContainsSubstring("constructor was not found"));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
using NUnit.Framework;
using System.Data;
using NHibernate.Exceptions;
using SharpTestsEx;

namespace NHibernate.Test.CfgTest.Loquacious
{
Expand Down Expand Up @@ -39,29 +38,29 @@ public void FullConfiguration()
p.ProxyFactoryFactory<DefaultProxyFactoryFactory>();
});
configure.Mappings(m=>
{
m.DefaultCatalog = "MyCatalog";
m.DefaultSchema = "MySche";
});
{
m.DefaultCatalog = "MyCatalog";
m.DefaultSchema = "MySche";
});
configure.DataBaseIntegration(db =>
{
db.Dialect<MsSql2000Dialect>();
db.KeywordsAutoImport = Hbm2DDLKeyWords.AutoQuote;
db.Batcher<SqlClientBatchingBatcherFactory>();
db.BatchSize = 15;
db.ConnectionProvider<DebugConnectionProvider>();
db.Driver<SqlClientDriver>();
db.ConnectionReleaseMode = ConnectionReleaseMode.AfterTransaction;
db.IsolationLevel = IsolationLevel.ReadCommitted;
db.ConnectionString = "The connection string";
db.AutoCommentSql = true;
db.ExceptionConverter<SQLStateConverter>();
db.PrepareCommands = true;
db.Timeout = 10;
db.MaximumDepthOfOuterJoinFetching = 11;
db.HqlToSqlSubstitutions = "true 1, false 0, yes 'Y', no 'N'";
db.SchemaAction = SchemaAutoAction.Validate;
});
{
db.Dialect<MsSql2000Dialect>();
db.KeywordsAutoImport = Hbm2DDLKeyWords.AutoQuote;
db.Batcher<SqlClientBatchingBatcherFactory>();
db.BatchSize = 15;
db.ConnectionProvider<DebugConnectionProvider>();
db.Driver<SqlClientDriver>();
db.ConnectionReleaseMode = ConnectionReleaseMode.AfterTransaction;
db.IsolationLevel = IsolationLevel.ReadCommitted;
db.ConnectionString = "The connection string";
db.AutoCommentSql = true;
db.ExceptionConverter<SQLStateConverter>();
db.PrepareCommands = true;
db.Timeout = 10;
db.MaximumDepthOfOuterJoinFetching = 11;
db.HqlToSqlSubstitutions = "true 1, false 0, yes 'Y', no 'N'";
db.SchemaAction = SchemaAutoAction.Validate;
});

Assert.That(configure.Properties[Environment.SessionFactoryName], Is.EqualTo("SomeName"));
Assert.That(configure.Properties[Environment.CacheProvider],
Expand Down Expand Up @@ -102,7 +101,7 @@ public void FullConfiguration()
Assert.That(configure.Properties[Environment.MaxFetchDepth], Is.EqualTo("11"));
Assert.That(configure.Properties[Environment.QuerySubstitutions], Is.EqualTo("true 1, false 0, yes 'Y', no 'N'"));
Assert.That(configure.Properties[Environment.Hbm2ddlAuto], Is.EqualTo("validate"));
configure.Properties[Environment.LinqToHqlGeneratorsRegistry].Should().Be(typeof(DefaultLinqToHqlGeneratorsRegistry).AssemblyQualifiedName);
Assert.That(configure.Properties[Environment.LinqToHqlGeneratorsRegistry], Is.EqualTo(typeof(DefaultLinqToHqlGeneratorsRegistry).AssemblyQualifiedName));
}
}
}
Loading

0 comments on commit af72f6d

Please sign in to comment.