Skip to content

Commit

Permalink
Fix configuration order in tests (nhibernate#3557)
Browse files Browse the repository at this point in the history
  • Loading branch information
hazzik authored Jun 11, 2024
1 parent dd77529 commit 7ed5bc8
Show file tree
Hide file tree
Showing 164 changed files with 128 additions and 293 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ public class NativeSQLBulkOperationsWithCacheAsync : TestCase

protected override void Configure(Configuration configuration)
{
cfg.SetProperty(Environment.UseQueryCache, "true");
cfg.SetProperty(Environment.UseSecondLevelCache, "true");
cfg.SetProperty(Environment.CacheProvider, typeof(SubstituteCacheProvider).AssemblyQualifiedName);
configuration.SetProperty(Environment.UseQueryCache, "true");
configuration.SetProperty(Environment.UseSecondLevelCache, "true");
configuration.SetProperty(Environment.CacheProvider, typeof(SubstituteCacheProvider).AssemblyQualifiedName);
}

[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ protected override string[] Mappings

protected override void Configure(NHibernate.Cfg.Configuration configuration)
{
base.Configure(configuration);
configuration.SetProperty(NHibernate.Cfg.Environment.GenerateStatistics, "true");
configuration.SetProperty(NHibernate.Cfg.Environment.BatchSize, "0");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,12 @@ namespace NHibernate.Test.ConnectionTest
[TestFixture]
public class AggressiveReleaseTestAsync : ConnectionManagementTestCase
{
protected override void Configure(Configuration cfg)
protected override void Configure(Configuration configuration)
{
base.Configure(cfg);
cfg.SetProperty(Environment.ReleaseConnections, "after_transaction");
//cfg.SetProperty(Environment.ConnectionProvider, typeof(DummyConnectionProvider).AssemblyQualifiedName);
//cfg.SetProperty(Environment.GenerateStatistics, "true");
cfg.SetProperty(Environment.BatchSize, "0");
configuration.SetProperty(Environment.ReleaseConnections, "after_transaction");
//configuration.SetProperty(Environment.ConnectionProvider, typeof(DummyConnectionProvider).AssemblyQualifiedName);
//configuration.SetProperty(Environment.GenerateStatistics, "true");
configuration.SetProperty(Environment.BatchSize, "0");
}

protected override ISession GetSessionUnderTest()
Expand Down
7 changes: 3 additions & 4 deletions src/NHibernate.Test/Async/ConnectionTest/BatcherFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@ namespace NHibernate.Test.ConnectionTest
[TestFixture]
public class BatcherFixtureAsync : ConnectionManagementTestCase
{
protected override void Configure(Configuration config)
protected override void Configure(Configuration configuration)
{
base.Configure(config);
config.SetProperty(Environment.BatchSize, "10");
configuration.SetProperty(Environment.BatchSize, "10");
}

protected override ISession GetSessionUnderTest()
Expand Down Expand Up @@ -53,4 +52,4 @@ public async Task CanCloseCommandsAndUseBatcherAsync()
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ protected override void Configure(Configuration config)
{
config.SetProperty(Environment.UseQueryCache, "true");
config.SetProperty(Environment.GenerateStatistics, "true");
base.Configure(config);
}

[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ protected override bool AppliesTo(Dialect.Dialect dialect)

protected override void Configure(Configuration configuration)
{
base.Configure(configuration);
configuration.Properties[Environment.CacheProvider] = typeof(HashtableCacheProvider).AssemblyQualifiedName;
configuration.Properties[Environment.UseSecondLevelCache] = "true";
}
Expand Down
3 changes: 1 addition & 2 deletions src/NHibernate.Test/Async/Futures/FallbackFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ protected override bool AppliesTo(Dialect.Dialect dialect)

protected override void Configure(Configuration configuration)
{
base.Configure(configuration);
using (var cp = ConnectionProviderFactory.NewConnectionProvider(cfg.Properties))
using (var cp = ConnectionProviderFactory.NewConnectionProvider(configuration.Properties))
{
if (cp.Driver is SqlClientDriver)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ protected override bool AppliesTo(Dialect.Dialect dialect)

protected override void Configure(Configuration configuration)
{
base.Configure(configuration);
configuration.SetProperty(Environment.GenerateStatistics, "true");
}

Expand Down
1 change: 0 additions & 1 deletion src/NHibernate.Test/Async/Immutable/ImmutableTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public class ImmutableTestAsync : TestCase
{
protected override void Configure(Configuration configuration)
{
base.Configure(configuration);
configuration.SetProperty(NHibernate.Cfg.Environment.GenerateStatistics, "true");
configuration.SetProperty(NHibernate.Cfg.Environment.BatchSize, "0");
}
Expand Down
1 change: 0 additions & 1 deletion src/NHibernate.Test/Async/LazyGroup/LazyGroupFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ public class LazyGroupFixtureAsync : TestCase

protected override void Configure(Configuration configuration)
{
base.Configure(configuration);
configuration.Properties[Environment.CacheProvider] = typeof(HashtableCacheProvider).AssemblyQualifiedName;
configuration.Properties[Environment.UseSecondLevelCache] = "true";
configuration.Properties[Environment.GenerateStatistics] = "true";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public class GroupByHavingTestsAsync : LinqTestCase
{
protected override void Configure(Cfg.Configuration configuration)
{
base.Configure(configuration);
configuration.SetProperty(Cfg.Environment.ShowSql, "true");
}

Expand Down
1 change: 0 additions & 1 deletion src/NHibernate.Test/Async/Linq/ByMethod/OrderByTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public class OrderByTestsAsync : LinqTestCase
{
protected override void Configure(Cfg.Configuration configuration)
{
base.Configure(configuration);
configuration.SetProperty(Environment.ShowSql, "true");
}

Expand Down
2 changes: 0 additions & 2 deletions src/NHibernate.Test/Async/Linq/PreEvaluationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ public PreEvaluationTestsAsync(bool legacy, bool fallback)

protected override void Configure(Configuration configuration)
{
base.Configure(configuration);

configuration.SetProperty(Environment.FormatSql, "false");
configuration.SetProperty(Environment.LinqToHqlLegacyPreEvaluation, LegacyPreEvaluation.ToString());
configuration.SetProperty(Environment.LinqToHqlFallbackOnPreEvaluation, FallbackOnPreEvaluation.ToString());
Expand Down
7 changes: 3 additions & 4 deletions src/NHibernate.Test/Async/Linq/QueryCacheableTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@ namespace NHibernate.Test.Linq
[TestFixture]
public class QueryCacheableTestsAsync : LinqTestCase
{
protected override void Configure(Configuration cfg)
protected override void Configure(Configuration configuration)
{
cfg.SetProperty(Environment.UseQueryCache, "true");
cfg.SetProperty(Environment.GenerateStatistics, "true");
base.Configure(cfg);
configuration.SetProperty(Environment.UseQueryCache, "true");
configuration.SetProperty(Environment.GenerateStatistics, "true");
}

[Test]
Expand Down
1 change: 0 additions & 1 deletion src/NHibernate.Test/Async/Linq/QueryFlushModeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public class QueryFlushModeTestsAsync : LinqTestCase
protected override void Configure(Configuration configuration)
{
configuration.SetProperty(Environment.GenerateStatistics, "true");
base.Configure(configuration);
}

[Test]
Expand Down
1 change: 0 additions & 1 deletion src/NHibernate.Test/Async/Linq/QueryTimeoutTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ protected override bool AppliesTo(Dialect.Dialect dialect)

protected override void Configure(Configuration configuration)
{
base.Configure(configuration);
configuration.SetProperty(Environment.BatchStrategy,
typeof(TimeoutCatchingNonBatchingBatcherFactory).AssemblyQualifiedName);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ protected override void Configure(Configuration configuration)
x.MultiTenancyConnectionProvider<TestMultiTenancyConnectionProvider>();
});
configuration.Properties[Cfg.Environment.GenerateStatistics] = "true";
base.Configure(configuration);
}

private static void ValidateSqlServerConnectionAppName(ISession s, string tenantId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ protected override bool AppliesTo(Engine.ISessionFactoryImplementor factory)

protected override void Configure(Cfg.Configuration configuration)
{
base.Configure(configuration);
configuration.SetProperty(Environment.ShowSql, "true");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ protected override string MappingsAssembly

protected override void Configure(Configuration configuration)
{
base.Configure(configuration);
configuration.LinqToHqlGeneratorsRegistry<EntityWithUserTypePropertyGeneratorsRegistry>();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ protected override bool AppliesTo(Dialect.Dialect dialect)
return dialect is MsSql2008Dialect;
}

protected override void Configure(Configuration cfg)
protected override void Configure(Configuration configuration)
{
//Points to the database created with FileStream Filegroup.
cfg.Properties["connection.connection_string"] =
configuration.Properties["connection.connection_string"] =
@"Data Source=localhost\SQLEXPRESS;Initial Catalog=FileStreamDB;Integrated Security=True;Pooling=False";

#region CREATE DATABASE example
Expand Down
1 change: 0 additions & 1 deletion src/NHibernate.Test/Async/NHSpecificTest/GH1486/Fixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ public class FixtureAsync : BugTestCase

protected override void Configure(Configuration configuration)
{
base.Configure(configuration);
configuration.SetInterceptor(_interceptor);
}

Expand Down
1 change: 0 additions & 1 deletion src/NHibernate.Test/Async/NHSpecificTest/GH1496/Fixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ public class FixtureAsync : BugTestCase

protected override void Configure(Configuration configuration)
{
base.Configure(configuration);
configuration.AppendListeners(ListenerType.PostUpdate, new[] { _auditEventListener });
}

Expand Down
2 changes: 0 additions & 2 deletions src/NHibernate.Test/Async/NHSpecificTest/GH1547/Fixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ public class FixtureAsync : BugTestCase
{
protected override void Configure(Configuration configuration)
{
base.Configure(configuration);

var driverClass = ReflectHelper.ClassForName(configuration.GetProperty(Cfg.Environment.ConnectionDriver));
DriverForSubstitutedCommand.DriverClass = driverClass;

Expand Down
2 changes: 1 addition & 1 deletion src/NHibernate.Test/Async/NHSpecificTest/GH1730/Fixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class FixtureAsync : BugTestCase
{
protected override void Configure(Configuration configuration)
{
cfg.SetProperty(Environment.GenerateStatistics, "true");
configuration.SetProperty(Environment.GenerateStatistics, "true");
}

protected override void OnTearDown()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ public CircularReferenceFetchDepth0FixtureAsync() : base(0)
protected override void Configure(Configuration configuration)
{
configuration.SetProperty("max_fetch_depth", "0");
base.Configure(configuration);
}

protected override void OnSetUp()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ public CircularReferenceFetchDepthFixtureAsync(int depth) : base(depth)
protected override void Configure(Configuration configuration)
{
configuration.SetProperty("max_fetch_depth", _depth.ToString());
base.Configure(configuration);
}

protected override void OnSetUp()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ protected override void Configure(Configuration configuration)
var dialect = NHibernate.Dialect.Dialect.GetDialect(configuration.Properties);
if (dialect is Oracle8iDialect)
configuration.SetProperty(Environment.Dialect, typeof(Oracle9iDialect).FullName);

base.Configure(configuration);
}

protected override void OnSetUp()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ protected override HbmMapping GetMappings()

protected override void Configure(Configuration configuration)
{
base.Configure(configuration);
configuration.Properties[Environment.CacheProvider] = typeof(HashtableCacheProvider).AssemblyQualifiedName;
configuration.Properties[Environment.UseSecondLevelCache] = "true";
configuration.Properties[Environment.GenerateStatistics] = "true";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ protected override void Configure(Configuration configuration)
{
new TestEventListener()
};
base.Configure(configuration);
}

protected override HbmMapping GetMappings()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ protected override bool AppliesTo(Dialect.Dialect dialect)

protected override void Configure(Configuration configuration)
{
base.Configure(configuration);
configuration.SetProperty(Environment.Hbm2ddlKeyWords, "auto-quote");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ protected override string MappingsAssembly

protected override void Configure(Configuration configuration)
{
base.Configure(configuration);
configuration.SetProperty(Cfg.Environment.UseSecondLevelCache, "false");
}

Expand Down
2 changes: 1 addition & 1 deletion src/NHibernate.Test/Async/NHSpecificTest/NH1001/Fixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class FixtureAsync : BugTestCase
{
protected override void Configure(Configuration configuration)
{
cfg.SetProperty(Environment.GenerateStatistics, "true");
configuration.SetProperty(Environment.GenerateStatistics, "true");
}

private int employeeId;
Expand Down
3 changes: 1 addition & 2 deletions src/NHibernate.Test/Async/NHSpecificTest/NH1101/Fixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ public class FixtureAsync : BugTestCase

protected override void Configure(Cfg.Configuration configuration)
{
base.Configure(configuration);
cfg.SetProperty(Cfg.Environment.GenerateStatistics, "true");
configuration.SetProperty(Cfg.Environment.GenerateStatistics, "true");
}

[Test]
Expand Down
5 changes: 1 addition & 4 deletions src/NHibernate.Test/Async/NHSpecificTest/NH1144/Fixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,9 @@ namespace NHibernate.Test.NHSpecificTest.NH1144
[TestFixture]
public class FixtureAsync : BugTestCase
{
private Configuration configuration;

protected override void Configure(Configuration configuration)
{
this.configuration = configuration;
this.configuration.Properties[Environment.BatchSize] = "10";
configuration.Properties[Environment.BatchSize] = "10";
}

[Test]
Expand Down
1 change: 0 additions & 1 deletion src/NHibernate.Test/Async/NHSpecificTest/NH1452/Fixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ public class FixtureAsync : BugTestCase
{
protected override void Configure(Configuration configuration)
{
base.Configure(configuration);
configuration.SetProperty(Environment.FormatSql, "false");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@ protected override void OnTearDown()

protected override void Configure(Configuration configuration)
{
base.Configure(configuration);
configuration.SetProperty(Environment.SqlExceptionConverter,
typeof (SQLUpdateConflictToStaleStateExceptionConverter).AssemblyQualifiedName);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ public class NativeSqlCollectionLoaderFixtureAsync : BugTestCase

protected override void Configure(Configuration configuration)
{
base.Configure(configuration);
configuration.SetProperty(Environment.UseQueryCache, WithQueryCache.ToString());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ protected override void Configure(Configuration configuration)
{
listener
};
base.Configure(configuration);
}

protected override HbmMapping GetMappings()
Expand Down
1 change: 0 additions & 1 deletion src/NHibernate.Test/Async/NHSpecificTest/NH1989/Fixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ protected override bool AppliesTo(ISessionFactoryImplementor factory)

protected override void Configure(Configuration configuration)
{
base.Configure(configuration);
configuration.Properties[Environment.CacheProvider] = typeof(HashtableCacheProvider).AssemblyQualifiedName;
configuration.Properties[Environment.UseQueryCache] = "true";
}
Expand Down
1 change: 0 additions & 1 deletion src/NHibernate.Test/Async/NHSpecificTest/NH2043/Fixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ public override string GetEntityName(object entity)

protected override void Configure(Configuration configuration)
{
base.Configure(configuration);
configuration.SetInterceptor(new Namer());
}

Expand Down
6 changes: 0 additions & 6 deletions src/NHibernate.Test/Async/NHSpecificTest/NH2055/Fixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@ protected override bool AppliesTo(NHibernate.Dialect.Dialect dialect)
return (dialect is Dialect.MsSql2000Dialect);
}

protected override void Configure(Configuration configuration)
{
base.Configure(configuration);
cfg = configuration;
}

[Test]
public async Task CanCreateAndDropSchemaAsync()
{
Expand Down
Loading

0 comments on commit 7ed5bc8

Please sign in to comment.