Skip to content

Disable default caching in tests #3177

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions src/NHibernate.Test/Any/AnyTypeTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ protected override string[] Mappings
get { return new string[] {"Any.Person.hbm.xml"}; }
}

protected override string CacheConcurrencyStrategy
{
get { return null; }
}

[Test]
public void FlushProcessing()
{
Expand Down
5 changes: 0 additions & 5 deletions src/NHibernate.Test/Async/Any/AnyTypeTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ protected override string[] Mappings
get { return new string[] {"Any.Person.hbm.xml"}; }
}

protected override string CacheConcurrencyStrategy
{
get { return null; }
}

[Test]
public async Task FlushProcessingAsync()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ namespace NHibernate.Test.BulkManipulation
[TestFixture]
public class NativeSQLBulkOperationsWithCacheAsync : TestCase
{
protected override string CacheConcurrencyStrategy => "nonstrict-read-write";

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

protected override string[] Mappings => new[] { "BulkManipulation.Vehicle.hbm.xml" };
Expand Down
2 changes: 0 additions & 2 deletions src/NHibernate.Test/Async/CacheTest/BatchableCacheFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ public BatchableCacheFixtureAsync(BatchFetchStyle fetchStyle)

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

protected override string CacheConcurrencyStrategy => null;

protected override void Configure(Configuration configuration)
{
configuration.SetProperty(Environment.UseSecondLevelCache, "true");
Expand Down
3 changes: 0 additions & 3 deletions src/NHibernate.Test/Async/CacheTest/BuildCacheFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ public class BuildCacheFixtureAsync : TestCase

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

// Disable the TestCase cache overrides.
protected override string CacheConcurrencyStrategy => null;

protected override void Configure(Configuration configuration)
{
configuration.SetProperty(Environment.UseQueryCache, "true");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ public class SerializingCacheFixtureAsync : TestCase

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

protected override string CacheConcurrencyStrategy => null;

protected override void Configure(Configuration configuration)
{
configuration.SetProperty(Environment.UseSecondLevelCache, "true");
Expand Down
5 changes: 0 additions & 5 deletions src/NHibernate.Test/Async/CompositeId/CompositeIdFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,6 @@ protected override string[] Mappings
}
}

protected override string CacheConcurrencyStrategy
{
get { return null; }
}

protected override bool AppliesTo(Dialect.Dialect dialect)
{
// Order uses a scalar sub-select formula.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ public class SelectModeTestAsync : TestCaseMappingByCode
{
private Guid _parentEntityComplexId;

protected override string CacheConcurrencyStrategy => "nonstrict-read-write";

[Test]
public async Task SelectModeJoinOnlyAsync()
{
Expand Down
5 changes: 0 additions & 5 deletions src/NHibernate.Test/Async/Extralazy/ExtraLazyFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ protected override string[] Mappings
get { return new[] {"Extralazy.UserGroup.hbm.xml"}; }
}

protected override string CacheConcurrencyStrategy
{
get { return null; }
}

protected override void Configure(Configuration configuration)
{
configuration.SetProperty(Cfg.Environment.GenerateStatistics, "true");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ namespace NHibernate.Test.FetchLazyProperties
[TestFixture]
public class FetchLazyPropertiesFixtureAsync : TestCase
{
protected override string CacheConcurrencyStrategy => "nonstrict-read-write";

protected override string MappingsAssembly
{
get { return "NHibernate.Test"; }
Expand Down
2 changes: 2 additions & 0 deletions src/NHibernate.Test/Async/FilterTest/DynamicFilterTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ public class DynamicFilterTestAsync : TestCase
private static readonly ILog log = LogManager.GetLogger(typeof(DynamicFilterTestAsync));
private TestData testData;

protected override string CacheConcurrencyStrategy => "nonstrict-read-write";

protected override void OnSetUp()
{
testData = new TestData(this);
Expand Down
2 changes: 2 additions & 0 deletions src/NHibernate.Test/Async/Futures/LinqFutureFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ namespace NHibernate.Test.Futures
[TestFixture]
public class LinqFutureFixtureAsync : FutureFixture
{
protected override string CacheConcurrencyStrategy => "nonstrict-read-write";

protected override void OnTearDown()
{
using (var session = OpenSession())
Expand Down
2 changes: 2 additions & 0 deletions src/NHibernate.Test/Async/Futures/QueryBatchFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ public class QueryBatchFixtureAsync : TestCaseMappingByCode
private Guid _parentId;
private Guid _eagerId;

protected override string CacheConcurrencyStrategy => "nonstrict-read-write";

[Test]
public async Task CanCombineCriteriaAndHqlInFutureAsync()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,5 @@ protected override bool AppliesTo(Dialect.Dialect dialect)
{
return dialect is MsSql2000Dialect || dialect is Oracle8iDialect;
}

protected override string CacheConcurrencyStrategy
{
get { return null; }
}
}
}
2 changes: 2 additions & 0 deletions src/NHibernate.Test/Async/LazyGroup/LazyGroupFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ namespace NHibernate.Test.LazyGroup
[TestFixture]
public class LazyGroupFixtureAsync : TestCase
{
protected override string CacheConcurrencyStrategy => "nonstrict-read-write";

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

protected override string[] Mappings => new[] { "LazyGroup.Mappings.hbm.xml" };
Expand Down
5 changes: 0 additions & 5 deletions src/NHibernate.Test/Async/LazyOneToOne/LazyOneToOneTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ protected override void Configure(Cfg.Configuration configuration)
configuration.SetProperty(Environment.UseSecondLevelCache, "false");
}

protected override string CacheConcurrencyStrategy
{
get { return null; }
}

[Test]
public async Task LazyAsync()
{
Expand Down
2 changes: 0 additions & 2 deletions src/NHibernate.Test/Async/LazyProperty/LazyPropertyFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ protected override string[] Mappings
get { return new[] { "LazyProperty.Mappings.hbm.xml" }; }
}

protected override string CacheConcurrencyStrategy => null;

protected override DebugSessionFactory BuildSessionFactory()
{
using (var logSpy = new LogSpy(typeof(EntityMetamodel)))
Expand Down
3 changes: 0 additions & 3 deletions src/NHibernate.Test/Async/NHSpecificTest/GH1754/Fixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ namespace NHibernate.Test.NHSpecificTest.GH1754
[TestFixture]
public class FixtureAsync : BugTestCase
{
// Disable second level cache
protected override string CacheConcurrencyStrategy => null;

protected override void OnSetUp()
{
Sfi.Statistics.IsStatisticsEnabled = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ namespace NHibernate.Test.NHSpecificTest.GH1756
[TestFixture]
public class UnsavedValueNoneFixtureAsync : BugTestCase
{
// disable second level cache enabled by default by the base class.
protected override string CacheConcurrencyStrategy => null;

protected override void OnSetUp()
{
using (var session = OpenSession())
Expand Down
2 changes: 0 additions & 2 deletions src/NHibernate.Test/Async/NHSpecificTest/GH2552/Fixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ namespace NHibernate.Test.NHSpecificTest.GH2552
[TestFixture]
public class FixtureAsync : BugTestCase
{
protected override string CacheConcurrencyStrategy => null;

protected override void Configure(NHCfg.Configuration configuration)
{
configuration.SetProperty(NHCfg.Environment.UseSecondLevelCache, "true");
Expand Down
5 changes: 0 additions & 5 deletions src/NHibernate.Test/Async/NHSpecificTest/NH1093/Fixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ protected override void Configure(Configuration configuration)
configuration.SetProperty(Environment.UseSecondLevelCache, "true");
}

protected override string CacheConcurrencyStrategy
{
get { return null; }
}

private async Task CleanupAsync(CancellationToken cancellationToken = default(CancellationToken))
{
using (var s = OpenSession())
Expand Down
4 changes: 3 additions & 1 deletion src/NHibernate.Test/Async/NHSpecificTest/NH1101/Fixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ namespace NHibernate.Test.NHSpecificTest.NH1101
[TestFixture]
public class FixtureAsync : BugTestCase
{
protected override string CacheConcurrencyStrategy => "nonstrict-read-write";

protected override void Configure(Cfg.Configuration configuration)
{
base.Configure(configuration);
Expand Down Expand Up @@ -76,4 +78,4 @@ public async Task BehaviorAsync()
}
}
}
}
}
5 changes: 0 additions & 5 deletions src/NHibernate.Test/Async/NHSpecificTest/NH1388/Fixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,5 @@ protected override void OnTearDown()
tran.Commit();
}
}

protected override string CacheConcurrencyStrategy
{
get { return null; }
}
}
}
4 changes: 3 additions & 1 deletion src/NHibernate.Test/Async/NHSpecificTest/NH1483/Fixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ namespace NHibernate.Test.NHSpecificTest.NH1483
[TestFixture]
public class FixtureAsync : BugTestCase
{
protected override string CacheConcurrencyStrategy => "nonstrict-read-write";

protected override void OnTearDown()
{
DeleteAll(true);
Expand Down Expand Up @@ -152,4 +154,4 @@ public async Task LoadSubclassFromSecondLevelCacheAsBaseClassAsync()
await (TestLoadFromSecondLevelCacheAsync<BaseClass>());
}
}
}
}
5 changes: 0 additions & 5 deletions src/NHibernate.Test/Async/NHSpecificTest/NH3046/Fixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,5 @@ public async Task MemoryLeakAsync()
}
}
}

protected override string CacheConcurrencyStrategy
{
get { return null; }
}
}
}
3 changes: 0 additions & 3 deletions src/NHibernate.Test/Async/NHSpecificTest/NH3079/Fixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ namespace NHibernate.Test.NHSpecificTest.NH3079
[TestFixture]
public class FixtureAsync : BugTestCase
{
// Disable second level cache
protected override string CacheConcurrencyStrategy => null;

protected override void OnTearDown()
{
using (var s = OpenSession())
Expand Down
5 changes: 0 additions & 5 deletions src/NHibernate.Test/Async/NHSpecificTest/NH750/Fixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ protected override void OnTearDown()
}
}

protected override string CacheConcurrencyStrategy
{
get { return null; }
}

protected override void Configure(Configuration configuration)
{
configuration.SetProperty(Cfg.Environment.UseSecondLevelCache, "false");
Expand Down
2 changes: 2 additions & 0 deletions src/NHibernate.Test/Async/NHSpecificTest/NH995/Fixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ namespace NHibernate.Test.NHSpecificTest.NH995
[TestFixture]
public class FixtureAsync : BugTestCase
{
protected override string CacheConcurrencyStrategy => "nonstrict-read-write";

protected override void OnTearDown()
{
using (ISession s = OpenSession())
Expand Down
7 changes: 1 addition & 6 deletions src/NHibernate.Test/Async/Pagination/PaginationFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@ protected override void Configure(Configuration configuration)
cfg.SetProperty(Environment.DefaultBatchFetchSize, "20");
}

protected override string CacheConcurrencyStrategy
{
get { return null; }
}

[Test]
public async Task PagTestAsync()
{
Expand Down Expand Up @@ -127,4 +122,4 @@ public async Task PagingWithLock_NH2255Async()
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ namespace NHibernate.Test.SecondLevelCacheTest
[TestFixture]
public class NeverCachedEntityTestsAsync : TestCase
{
protected override string CacheConcurrencyStrategy => null;
protected override string MappingsAssembly => "NHibernate.Test";

protected override string[] Mappings => new[] { "SecondLevelCacheTest.Item.hbm.xml" };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ namespace NHibernate.Test.BulkManipulation
[TestFixture]
public class NativeSQLBulkOperationsWithCache : TestCase
{
protected override string CacheConcurrencyStrategy => "nonstrict-read-write";

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

protected override string[] Mappings => new[] { "BulkManipulation.Vehicle.hbm.xml" };
Expand Down
2 changes: 0 additions & 2 deletions src/NHibernate.Test/CacheTest/BatchableCacheFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ public BatchableCacheFixture(BatchFetchStyle fetchStyle)

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

protected override string CacheConcurrencyStrategy => null;

protected override void Configure(Configuration configuration)
{
configuration.SetProperty(Environment.UseSecondLevelCache, "true");
Expand Down
3 changes: 0 additions & 3 deletions src/NHibernate.Test/CacheTest/BuildCacheFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ public class BuildCacheFixture : TestCase

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

// Disable the TestCase cache overrides.
protected override string CacheConcurrencyStrategy => null;

protected override void Configure(Configuration configuration)
{
configuration.SetProperty(Environment.UseQueryCache, "true");
Expand Down
2 changes: 0 additions & 2 deletions src/NHibernate.Test/CacheTest/SerializingCacheFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ public class SerializingCacheFixture : TestCase

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

protected override string CacheConcurrencyStrategy => null;

protected override void Configure(Configuration configuration)
{
configuration.SetProperty(Environment.UseSecondLevelCache, "true");
Expand Down
5 changes: 0 additions & 5 deletions src/NHibernate.Test/CompositeId/CompositeIdFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ protected override string[] Mappings
}
}

protected override string CacheConcurrencyStrategy
{
get { return null; }
}

protected override bool AppliesTo(Dialect.Dialect dialect)
{
// Order uses a scalar sub-select formula.
Expand Down
2 changes: 2 additions & 0 deletions src/NHibernate.Test/Criteria/SelectModeTest/SelectModeTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public class SelectModeTest : TestCaseMappingByCode
{
private Guid _parentEntityComplexId;

protected override string CacheConcurrencyStrategy => "nonstrict-read-write";

[Test]
public void SelectModeJoinOnly()
{
Expand Down
5 changes: 0 additions & 5 deletions src/NHibernate.Test/Extralazy/ExtraLazyFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ protected override string[] Mappings
get { return new[] {"Extralazy.UserGroup.hbm.xml"}; }
}

protected override string CacheConcurrencyStrategy
{
get { return null; }
}

protected override void Configure(Configuration configuration)
{
configuration.SetProperty(Cfg.Environment.GenerateStatistics, "true");
Expand Down
Loading