Skip to content

Commit 6f886d3

Browse files
authored
Disable default caching in tests (#3177)
1 parent 556a4a7 commit 6f886d3

File tree

61 files changed

+49
-165
lines changed

Some content is hidden

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

61 files changed

+49
-165
lines changed

src/NHibernate.Test/Any/AnyTypeTest.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@ protected override string[] Mappings
1515
get { return new string[] {"Any.Person.hbm.xml"}; }
1616
}
1717

18-
protected override string CacheConcurrencyStrategy
19-
{
20-
get { return null; }
21-
}
22-
2318
[Test]
2419
public void FlushProcessing()
2520
{

src/NHibernate.Test/Async/Any/AnyTypeTest.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,6 @@ protected override string[] Mappings
2626
get { return new string[] {"Any.Person.hbm.xml"}; }
2727
}
2828

29-
protected override string CacheConcurrencyStrategy
30-
{
31-
get { return null; }
32-
}
33-
3429
[Test]
3530
public async Task FlushProcessingAsync()
3631
{

src/NHibernate.Test/Async/BulkManipulation/NativeSQLBulkOperationsWithCache.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ namespace NHibernate.Test.BulkManipulation
2525
[TestFixture]
2626
public class NativeSQLBulkOperationsWithCacheAsync : TestCase
2727
{
28+
protected override string CacheConcurrencyStrategy => "nonstrict-read-write";
29+
2830
protected override string MappingsAssembly => "NHibernate.Test";
2931

3032
protected override string[] Mappings => new[] { "BulkManipulation.Vehicle.hbm.xml" };

src/NHibernate.Test/Async/CacheTest/BatchableCacheFixture.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ public BatchableCacheFixtureAsync(BatchFetchStyle fetchStyle)
4444

4545
protected override string MappingsAssembly => "NHibernate.Test";
4646

47-
protected override string CacheConcurrencyStrategy => null;
48-
4947
protected override void Configure(Configuration configuration)
5048
{
5149
configuration.SetProperty(Environment.UseSecondLevelCache, "true");

src/NHibernate.Test/Async/CacheTest/BuildCacheFixture.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ public class BuildCacheFixtureAsync : TestCase
2929

3030
protected override string[] Mappings => new[] { "CacheTest.EntitiesInSameRegion.hbm.xml" };
3131

32-
// Disable the TestCase cache overrides.
33-
protected override string CacheConcurrencyStrategy => null;
34-
3532
protected override void Configure(Configuration configuration)
3633
{
3734
configuration.SetProperty(Environment.UseQueryCache, "true");

src/NHibernate.Test/Async/CacheTest/SerializingCacheFixture.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ public class SerializingCacheFixtureAsync : TestCase
2828

2929
protected override string MappingsAssembly => "NHibernate.Test";
3030

31-
protected override string CacheConcurrencyStrategy => null;
32-
3331
protected override void Configure(Configuration configuration)
3432
{
3533
configuration.SetProperty(Environment.UseSecondLevelCache, "true");

src/NHibernate.Test/Async/CompositeId/CompositeIdFixture.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,6 @@ protected override string[] Mappings
3838
}
3939
}
4040

41-
protected override string CacheConcurrencyStrategy
42-
{
43-
get { return null; }
44-
}
45-
4641
protected override bool AppliesTo(Dialect.Dialect dialect)
4742
{
4843
// Order uses a scalar sub-select formula.

src/NHibernate.Test/Async/Criteria/SelectModeTest/SelectModeTest.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ public class SelectModeTestAsync : TestCaseMappingByCode
3232
{
3333
private Guid _parentEntityComplexId;
3434

35+
protected override string CacheConcurrencyStrategy => "nonstrict-read-write";
36+
3537
[Test]
3638
public async Task SelectModeJoinOnlyAsync()
3739
{

src/NHibernate.Test/Async/Extralazy/ExtraLazyFixture.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,6 @@ protected override string[] Mappings
3232
get { return new[] {"Extralazy.UserGroup.hbm.xml"}; }
3333
}
3434

35-
protected override string CacheConcurrencyStrategy
36-
{
37-
get { return null; }
38-
}
39-
4035
protected override void Configure(Configuration configuration)
4136
{
4237
configuration.SetProperty(Cfg.Environment.GenerateStatistics, "true");

src/NHibernate.Test/Async/FetchLazyProperties/FetchLazyPropertiesFixture.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ namespace NHibernate.Test.FetchLazyProperties
2525
[TestFixture]
2626
public class FetchLazyPropertiesFixtureAsync : TestCase
2727
{
28+
protected override string CacheConcurrencyStrategy => "nonstrict-read-write";
29+
2830
protected override string MappingsAssembly
2931
{
3032
get { return "NHibernate.Test"; }

src/NHibernate.Test/Async/FilterTest/DynamicFilterTest.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ public class DynamicFilterTestAsync : TestCase
2828
private static readonly ILog log = LogManager.GetLogger(typeof(DynamicFilterTestAsync));
2929
private TestData testData;
3030

31+
protected override string CacheConcurrencyStrategy => "nonstrict-read-write";
32+
3133
protected override void OnSetUp()
3234
{
3335
testData = new TestData(this);

src/NHibernate.Test/Async/Futures/LinqFutureFixture.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ namespace NHibernate.Test.Futures
2020
[TestFixture]
2121
public class LinqFutureFixtureAsync : FutureFixture
2222
{
23+
protected override string CacheConcurrencyStrategy => "nonstrict-read-write";
24+
2325
protected override void OnTearDown()
2426
{
2527
using (var session = OpenSession())

src/NHibernate.Test/Async/Futures/QueryBatchFixture.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ public class QueryBatchFixtureAsync : TestCaseMappingByCode
2828
private Guid _parentId;
2929
private Guid _eagerId;
3030

31+
protected override string CacheConcurrencyStrategy => "nonstrict-read-write";
32+
3133
[Test]
3234
public async Task CanCombineCriteriaAndHqlInFutureAsync()
3335
{

src/NHibernate.Test/Async/GeneratedTest/TriggerGeneratedValuesWithoutCachingTest.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,5 @@ protected override bool AppliesTo(Dialect.Dialect dialect)
3030
{
3131
return dialect is MsSql2000Dialect || dialect is Oracle8iDialect;
3232
}
33-
34-
protected override string CacheConcurrencyStrategy
35-
{
36-
get { return null; }
37-
}
3833
}
3934
}

src/NHibernate.Test/Async/LazyGroup/LazyGroupFixture.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ namespace NHibernate.Test.LazyGroup
2222
[TestFixture]
2323
public class LazyGroupFixtureAsync : TestCase
2424
{
25+
protected override string CacheConcurrencyStrategy => "nonstrict-read-write";
26+
2527
protected override string MappingsAssembly => "NHibernate.Test";
2628

2729
protected override string[] Mappings => new[] { "LazyGroup.Mappings.hbm.xml" };

src/NHibernate.Test/Async/LazyOneToOne/LazyOneToOneTest.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,6 @@ protected override void Configure(Cfg.Configuration configuration)
4141
configuration.SetProperty(Environment.UseSecondLevelCache, "false");
4242
}
4343

44-
protected override string CacheConcurrencyStrategy
45-
{
46-
get { return null; }
47-
}
48-
4944
[Test]
5045
public async Task LazyAsync()
5146
{

src/NHibernate.Test/Async/LazyProperty/LazyPropertyFixture.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ protected override string[] Mappings
3636
get { return new[] { "LazyProperty.Mappings.hbm.xml" }; }
3737
}
3838

39-
protected override string CacheConcurrencyStrategy => null;
40-
4139
protected override DebugSessionFactory BuildSessionFactory()
4240
{
4341
using (var logSpy = new LogSpy(typeof(EntityMetamodel)))

src/NHibernate.Test/Async/NHSpecificTest/GH1754/Fixture.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ namespace NHibernate.Test.NHSpecificTest.GH1754
1919
[TestFixture]
2020
public class FixtureAsync : BugTestCase
2121
{
22-
// Disable second level cache
23-
protected override string CacheConcurrencyStrategy => null;
24-
2522
protected override void OnSetUp()
2623
{
2724
Sfi.Statistics.IsStatisticsEnabled = true;

src/NHibernate.Test/Async/NHSpecificTest/GH1756/UnsavedValueNoneFixture.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ namespace NHibernate.Test.NHSpecificTest.GH1756
1919
[TestFixture]
2020
public class UnsavedValueNoneFixtureAsync : BugTestCase
2121
{
22-
// disable second level cache enabled by default by the base class.
23-
protected override string CacheConcurrencyStrategy => null;
24-
2522
protected override void OnSetUp()
2623
{
2724
using (var session = OpenSession())

src/NHibernate.Test/Async/NHSpecificTest/GH2552/Fixture.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ namespace NHibernate.Test.NHSpecificTest.GH2552
2323
[TestFixture]
2424
public class FixtureAsync : BugTestCase
2525
{
26-
protected override string CacheConcurrencyStrategy => null;
27-
2826
protected override void Configure(NHCfg.Configuration configuration)
2927
{
3028
configuration.SetProperty(NHCfg.Environment.UseSecondLevelCache, "true");

src/NHibernate.Test/Async/NHSpecificTest/NH1093/Fixture.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@ protected override void Configure(Configuration configuration)
2727
configuration.SetProperty(Environment.UseSecondLevelCache, "true");
2828
}
2929

30-
protected override string CacheConcurrencyStrategy
31-
{
32-
get { return null; }
33-
}
34-
3530
private async Task CleanupAsync(CancellationToken cancellationToken = default(CancellationToken))
3631
{
3732
using (var s = OpenSession())

src/NHibernate.Test/Async/NHSpecificTest/NH1101/Fixture.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ namespace NHibernate.Test.NHSpecificTest.NH1101
1818
[TestFixture]
1919
public class FixtureAsync : BugTestCase
2020
{
21+
protected override string CacheConcurrencyStrategy => "nonstrict-read-write";
22+
2123
protected override void Configure(Cfg.Configuration configuration)
2224
{
2325
base.Configure(configuration);
@@ -76,4 +78,4 @@ public async Task BehaviorAsync()
7678
}
7779
}
7880
}
79-
}
81+
}

src/NHibernate.Test/Async/NHSpecificTest/NH1388/Fixture.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,5 @@ protected override void OnTearDown()
109109
tran.Commit();
110110
}
111111
}
112-
113-
protected override string CacheConcurrencyStrategy
114-
{
115-
get { return null; }
116-
}
117112
}
118113
}

src/NHibernate.Test/Async/NHSpecificTest/NH1483/Fixture.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ namespace NHibernate.Test.NHSpecificTest.NH1483
1919
[TestFixture]
2020
public class FixtureAsync : BugTestCase
2121
{
22+
protected override string CacheConcurrencyStrategy => "nonstrict-read-write";
23+
2224
protected override void OnTearDown()
2325
{
2426
DeleteAll(true);
@@ -152,4 +154,4 @@ public async Task LoadSubclassFromSecondLevelCacheAsBaseClassAsync()
152154
await (TestLoadFromSecondLevelCacheAsync<BaseClass>());
153155
}
154156
}
155-
}
157+
}

src/NHibernate.Test/Async/NHSpecificTest/NH3046/Fixture.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,5 @@ public async Task MemoryLeakAsync()
6060
}
6161
}
6262
}
63-
64-
protected override string CacheConcurrencyStrategy
65-
{
66-
get { return null; }
67-
}
6863
}
6964
}

src/NHibernate.Test/Async/NHSpecificTest/NH3079/Fixture.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ namespace NHibernate.Test.NHSpecificTest.NH3079
1818
[TestFixture]
1919
public class FixtureAsync : BugTestCase
2020
{
21-
// Disable second level cache
22-
protected override string CacheConcurrencyStrategy => null;
23-
2421
protected override void OnTearDown()
2522
{
2623
using (var s = OpenSession())

src/NHibernate.Test/Async/NHSpecificTest/NH750/Fixture.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,6 @@ protected override void OnTearDown()
2828
}
2929
}
3030

31-
protected override string CacheConcurrencyStrategy
32-
{
33-
get { return null; }
34-
}
35-
3631
protected override void Configure(Configuration configuration)
3732
{
3833
configuration.SetProperty(Cfg.Environment.UseSecondLevelCache, "false");

src/NHibernate.Test/Async/NHSpecificTest/NH995/Fixture.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ namespace NHibernate.Test.NHSpecificTest.NH995
1717
[TestFixture]
1818
public class FixtureAsync : BugTestCase
1919
{
20+
protected override string CacheConcurrencyStrategy => "nonstrict-read-write";
21+
2022
protected override void OnTearDown()
2123
{
2224
using (ISession s = OpenSession())

src/NHibernate.Test/Async/Pagination/PaginationFixture.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,6 @@ protected override void Configure(Configuration configuration)
3737
cfg.SetProperty(Environment.DefaultBatchFetchSize, "20");
3838
}
3939

40-
protected override string CacheConcurrencyStrategy
41-
{
42-
get { return null; }
43-
}
44-
4540
[Test]
4641
public async Task PagTestAsync()
4742
{
@@ -127,4 +122,4 @@ public async Task PagingWithLock_NH2255Async()
127122
}
128123
}
129124
}
130-
}
125+
}

src/NHibernate.Test/Async/SecondLevelCacheTest/NeverCachedEntityTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ namespace NHibernate.Test.SecondLevelCacheTest
2626
[TestFixture]
2727
public class NeverCachedEntityTestsAsync : TestCase
2828
{
29-
protected override string CacheConcurrencyStrategy => null;
3029
protected override string MappingsAssembly => "NHibernate.Test";
3130

3231
protected override string[] Mappings => new[] { "SecondLevelCacheTest.Item.hbm.xml" };

src/NHibernate.Test/BulkManipulation/NativeSQLBulkOperationsWithCache.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ namespace NHibernate.Test.BulkManipulation
1414
[TestFixture]
1515
public class NativeSQLBulkOperationsWithCache : TestCase
1616
{
17+
protected override string CacheConcurrencyStrategy => "nonstrict-read-write";
18+
1719
protected override string MappingsAssembly => "NHibernate.Test";
1820

1921
protected override string[] Mappings => new[] { "BulkManipulation.Vehicle.hbm.xml" };

src/NHibernate.Test/CacheTest/BatchableCacheFixture.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ public BatchableCacheFixture(BatchFetchStyle fetchStyle)
3232

3333
protected override string MappingsAssembly => "NHibernate.Test";
3434

35-
protected override string CacheConcurrencyStrategy => null;
36-
3735
protected override void Configure(Configuration configuration)
3836
{
3937
configuration.SetProperty(Environment.UseSecondLevelCache, "true");

src/NHibernate.Test/CacheTest/BuildCacheFixture.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ public class BuildCacheFixture : TestCase
1818

1919
protected override string[] Mappings => new[] { "CacheTest.EntitiesInSameRegion.hbm.xml" };
2020

21-
// Disable the TestCase cache overrides.
22-
protected override string CacheConcurrencyStrategy => null;
23-
2421
protected override void Configure(Configuration configuration)
2522
{
2623
configuration.SetProperty(Environment.UseQueryCache, "true");

src/NHibernate.Test/CacheTest/SerializingCacheFixture.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ public class SerializingCacheFixture : TestCase
1717

1818
protected override string MappingsAssembly => "NHibernate.Test";
1919

20-
protected override string CacheConcurrencyStrategy => null;
21-
2220
protected override void Configure(Configuration configuration)
2321
{
2422
configuration.SetProperty(Environment.UseSecondLevelCache, "true");

src/NHibernate.Test/CompositeId/CompositeIdFixture.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,6 @@ protected override string[] Mappings
2626
}
2727
}
2828

29-
protected override string CacheConcurrencyStrategy
30-
{
31-
get { return null; }
32-
}
33-
3429
protected override bool AppliesTo(Dialect.Dialect dialect)
3530
{
3631
// Order uses a scalar sub-select formula.

src/NHibernate.Test/Criteria/SelectModeTest/SelectModeTest.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ public class SelectModeTest : TestCaseMappingByCode
2121
{
2222
private Guid _parentEntityComplexId;
2323

24+
protected override string CacheConcurrencyStrategy => "nonstrict-read-write";
25+
2426
[Test]
2527
public void SelectModeJoinOnly()
2628
{

src/NHibernate.Test/Extralazy/ExtraLazyFixture.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@ protected override string[] Mappings
2121
get { return new[] {"Extralazy.UserGroup.hbm.xml"}; }
2222
}
2323

24-
protected override string CacheConcurrencyStrategy
25-
{
26-
get { return null; }
27-
}
28-
2924
protected override void Configure(Configuration configuration)
3025
{
3126
configuration.SetProperty(Cfg.Environment.GenerateStatistics, "true");

0 commit comments

Comments
 (0)