Skip to content

Commit e07c6ce

Browse files
Adjust code according to review
Partially address the review.
1 parent 212d109 commit e07c6ce

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+238
-356
lines changed

src/NHibernate.Config.Templates/HANA.cfg.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@ for your own use before compile tests in VisualStudio.
77
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2" >
88
<session-factory name="NHibernate.Test">
99
<property name="connection.driver_class">NHibernate.Driver.HanaDriver</property>
10+
<!-- Sap.Data.Hana does not support re-enlisting in the same transaction, wrecking many usages
11+
with NHibernate when both NHibernate and the connection performs auto-enlistment. -->
1012
<property name="connection.connection_string">
11-
Server=localhost:39015;UserID=nhibernate;Password=
13+
Server=localhost:39015;UserID=nhibernate;Password=;
14+
Enlist=false;
1215
</property>
1316
<property name="dialect">NHibernate.Dialect.HanaColumnStoreDialect</property>
1417
</session-factory>

src/NHibernate.Test/Async/Criteria/Lambda/FunctionsIntegrationFixture.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@ namespace NHibernate.Test.Criteria.Lambda
1919
[TestFixture]
2020
public class FunctionsIntegrationFixtureAsync : TestCase
2121
{
22-
protected override bool AppliesTo(Dialect.Dialect dialect)
23-
{
24-
return TestDialect.SupportsEmptyInsertsOrHasNonIdentityNativeGenerator;
25-
}
26-
2722
protected override string MappingsAssembly => "NHibernate.Test";
2823

2924
protected override IList Mappings => new[] { "Criteria.Lambda.Mappings.hbm.xml" };

src/NHibernate.Test/Async/Criteria/Lambda/IntegrationFixture.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,6 @@ namespace NHibernate.Test.Criteria.Lambda
2424
[TestFixture]
2525
public class IntegrationFixtureAsync : TestCase
2626
{
27-
protected override bool AppliesTo(Dialect.Dialect dialect)
28-
{
29-
return TestDialect.SupportsEmptyInsertsOrHasNonIdentityNativeGenerator;
30-
}
31-
3227
protected override string MappingsAssembly { get { return "NHibernate.Test"; } }
3328

3429
protected override IList Mappings
@@ -269,6 +264,9 @@ public async Task IsTypeAsync()
269264
[Test]
270265
public async Task OverrideEagerJoinAsync()
271266
{
267+
if (!TestDialect.SupportsEmptyInsertsOrHasNonIdentityNativeGenerator)
268+
Assert.Ignore("Support of empty inserts is required");
269+
272270
using (ISession s = OpenSession())
273271
using (ITransaction t = s.BeginTransaction())
274272
{

src/NHibernate.Test/Async/Criteria/Lambda/ProjectIntegrationFixture.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@ namespace NHibernate.Test.Criteria.Lambda
2020
[TestFixture]
2121
public class ProjectIntegrationFixtureAsync : TestCase
2222
{
23-
protected override bool AppliesTo(Dialect.Dialect dialect)
24-
{
25-
return TestDialect.SupportsEmptyInsertsOrHasNonIdentityNativeGenerator;
26-
}
27-
2823
protected override string MappingsAssembly
2924
{
3025
get { return "NHibernate.Test"; }

src/NHibernate.Test/Async/Criteria/Lambda/SimpleIntegrationFixture.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@ namespace NHibernate.Test.Criteria.Lambda
1717
[TestFixture]
1818
public class SimpleIntegrationFixtureAsync : TestCase
1919
{
20-
protected override bool AppliesTo(Dialect.Dialect dialect)
21-
{
22-
return TestDialect.SupportsEmptyInsertsOrHasNonIdentityNativeGenerator;
23-
}
24-
2520
protected override string MappingsAssembly
2621
{
2722
get { return "NHibernate.Test"; }

src/NHibernate.Test/Async/Criteria/Lambda/SubQueryIntegrationFixture.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@ namespace NHibernate.Test.Criteria.Lambda
1919
[TestFixture]
2020
public class SubQueryIntegrationFixtureAsync : TestCase
2121
{
22-
protected override bool AppliesTo(Dialect.Dialect dialect)
23-
{
24-
return TestDialect.SupportsEmptyInsertsOrHasNonIdentityNativeGenerator;
25-
}
26-
2722
protected override string MappingsAssembly
2823
{
2924
get { return "NHibernate.Test"; }

src/NHibernate.Test/Async/GenericTest/Overall/Fixture.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
using System;
1212
using System.Collections;
1313
using System.Collections.Generic;
14+
1415
using NUnit.Framework;
1516

1617
namespace NHibernate.Test.GenericTest.Overall
@@ -19,11 +20,6 @@ namespace NHibernate.Test.GenericTest.Overall
1920
[TestFixture]
2021
public class FixtureAsync : TestCase
2122
{
22-
protected override bool AppliesTo(Dialect.Dialect dialect)
23-
{
24-
return TestDialect.SupportsEmptyInsertsOrHasNonIdentityNativeGenerator;
25-
}
26-
2723
protected override IList Mappings
2824
{
2925
get { return new[] { "GenericTest.Overall.Mappings.hbm.xml" }; }
@@ -57,6 +53,9 @@ public async Task CRUDAsync()
5753
[Test]
5854
public async Task CRUDABAsync()
5955
{
56+
if (!TestDialect.SupportsEmptyInsertsOrHasNonIdentityNativeGenerator)
57+
Assert.Ignore("Support of empty inserts is required");
58+
6059
var entity = new A<B>
6160
{
6261
Property = new B { Prop = 2 },

src/NHibernate.Test/Async/Legacy/FooBarTest.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
using NHibernate.Dialect;
2525
using NHibernate.DomainModel;
2626
using NHibernate.Criterion;
27-
using NHibernate.Id;
2827
using NHibernate.Proxy;
2928
using NHibernate.Type;
3029
using NHibernate.Util;
@@ -43,11 +42,6 @@ private static byte[] GetBytes(string str)
4342
return Encoding.Unicode.GetBytes(str);
4443
}
4544

46-
protected override bool AppliesTo(Dialect.Dialect dialect)
47-
{
48-
return TestDialect.SupportsEmptyInsertsOrHasNonIdentityNativeGenerator;
49-
}
50-
5145
protected override IList Mappings
5246
{
5347
get

src/NHibernate.Test/Async/Legacy/FumTest.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@ public class FumTestAsync : TestCase
2929
{
3030
protected static short fumKeyShort = 1;
3131

32-
protected override bool AppliesTo(Dialect.Dialect dialect)
33-
{
34-
return TestDialect.SupportsEmptyInsertsOrHasNonIdentityNativeGenerator;
35-
}
36-
3732
protected override IList Mappings
3833
{
3934
get

src/NHibernate.Test/Async/Legacy/MasterDetailTest.cs

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@ namespace NHibernate.Test.Legacy
3030
[TestFixture]
3131
public class MasterDetailTestAsync : TestCase
3232
{
33-
protected override bool AppliesTo(Dialect.Dialect dialect)
34-
{
35-
return TestDialect.SupportsEmptyInsertsOrHasNonIdentityNativeGenerator;
36-
}
37-
3833
protected override IList Mappings
3934
{
4035
get
@@ -57,6 +52,9 @@ protected override IList Mappings
5752
[Test]
5853
public async Task ParentChildrenAsync()
5954
{
55+
if (!TestDialect.SupportsEmptyInsertsOrHasNonIdentityNativeGenerator)
56+
Assert.Ignore("Support of empty inserts is required");
57+
6058
ISession session = OpenSession();
6159

6260
M parent = new M();
@@ -847,6 +845,9 @@ public async Task MixNativeAssignedAsync()
847845
[Test]
848846
public async Task CollectionReplaceOnUpdateAsync()
849847
{
848+
if (!TestDialect.SupportsEmptyInsertsOrHasNonIdentityNativeGenerator)
849+
Assert.Ignore("Support of empty inserts is required");
850+
850851
ISession s = OpenSession();
851852
ITransaction t = s.BeginTransaction();
852853
Category c = new Category();
@@ -892,6 +893,9 @@ public async Task CollectionReplaceOnUpdateAsync()
892893
[Test]
893894
public async Task CollectionReplace2Async()
894895
{
896+
if (!TestDialect.SupportsEmptyInsertsOrHasNonIdentityNativeGenerator)
897+
Assert.Ignore("Support of empty inserts is required");
898+
895899
ISession s = OpenSession();
896900
ITransaction t = s.BeginTransaction();
897901
Category c = new Category();
@@ -931,6 +935,9 @@ public async Task CollectionReplace2Async()
931935
[Test]
932936
public async Task CollectionReplaceAsync()
933937
{
938+
if (!TestDialect.SupportsEmptyInsertsOrHasNonIdentityNativeGenerator)
939+
Assert.Ignore("Support of empty inserts is required");
940+
934941
ISession s = OpenSession();
935942
ITransaction t = s.BeginTransaction();
936943
Category c = new Category();
@@ -976,6 +983,9 @@ public async Task CollectionReplaceAsync()
976983
[Test]
977984
public async Task CategoriesAsync()
978985
{
986+
if (!TestDialect.SupportsEmptyInsertsOrHasNonIdentityNativeGenerator)
987+
Assert.Ignore("Support of empty inserts is required");
988+
979989
Category c = new Category();
980990
c.Name = Category.RootCategory;
981991
Category c1 = new Category();
@@ -1017,6 +1027,9 @@ public async Task CategoriesAsync()
10171027
[Test]
10181028
public async Task CollectionRefreshAsync()
10191029
{
1030+
if (!TestDialect.SupportsEmptyInsertsOrHasNonIdentityNativeGenerator)
1031+
Assert.Ignore("Support of empty inserts is required");
1032+
10201033
ISession s = OpenSession();
10211034
Category c = new Category();
10221035
IList<Category> list = new List<Category>();
@@ -1060,6 +1073,9 @@ public async Task CollectionRefreshAsync()
10601073
[Test]
10611074
public async Task CachedCollectionRefreshAsync()
10621075
{
1076+
if (!TestDialect.SupportsEmptyInsertsOrHasNonIdentityNativeGenerator)
1077+
Assert.Ignore("Support of empty inserts is required");
1078+
10631079
ISession s = OpenSession();
10641080
Category c = new Category();
10651081
IList<Category> list = new List<Category>();
@@ -1245,6 +1261,9 @@ public async Task QueuedBagAddsAsync()
12451261
[Test]
12461262
public async Task PolymorphicCriteriaAsync()
12471263
{
1264+
if (!TestDialect.SupportsEmptyInsertsOrHasNonIdentityNativeGenerator)
1265+
Assert.Ignore("Support of empty inserts is required");
1266+
12481267
ISession s = OpenSession();
12491268
ITransaction txn = s.BeginTransaction();
12501269
Category f = new Category();

0 commit comments

Comments
 (0)