Skip to content

Commit 22bc773

Browse files
Upgrade AsyncGenerator to 0.6.2 and regenerate. (#1445)
1 parent a218b4f commit 22bc773

File tree

13 files changed

+2
-423
lines changed

13 files changed

+2
-423
lines changed

Tools/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
<package id="NUnit.Extension.NUnitV2ResultWriter" version="3.6.0" targetFramework="net461" />
88
<package id="NUnit.Extension.TeamCityEventListener" version="1.0.2" targetFramework="net461" />
99
<package id="NUnit.Extension.VSProjectLoader" version="3.6.0" targetFramework="net461" />
10-
<package id="CSharpAsyncGenerator.CommandLine" version="0.6.0" targetFramework="net461" />
10+
<package id="CSharpAsyncGenerator.CommandLine" version="0.6.2" targetFramework="net461" />
1111
<package id="vswhere" version="2.1.4" targetFramework="net461" />
1212
</packages>

src/NHibernate.Test/Async/ExpressionTest/QueryByExampleTest.cs

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
namespace NHibernate.Test.ExpressionTest
1818
{
1919
using System.Threading.Tasks;
20-
using System.Threading;
2120
[TestFixture]
2221
public class QueryByExampleTestAsync : TestCase
2322
{
@@ -150,30 +149,6 @@ public async Task TestExcludingQBEAsync()
150149
}
151150
}
152151

153-
private async Task InitDataAsync(CancellationToken cancellationToken = default(CancellationToken))
154-
{
155-
using (ISession s = OpenSession())
156-
{
157-
Componentizable master = GetMaster("hibernate", "ORM tool", "ORM tool1");
158-
await (s.SaveAsync(master, cancellationToken));
159-
await (s.FlushAsync(cancellationToken));
160-
}
161-
162-
using (ISession s = OpenSession())
163-
{
164-
Componentizable master = GetMaster("hibernate", "open source", "open source1");
165-
await (s.SaveAsync(master, cancellationToken));
166-
await (s.FlushAsync(cancellationToken));
167-
}
168-
169-
using (ISession s = OpenSession())
170-
{
171-
Componentizable master = GetMaster("hibernate", null, null);
172-
await (s.SaveAsync(master, cancellationToken));
173-
await (s.FlushAsync(cancellationToken));
174-
}
175-
}
176-
177152
private void InitData()
178153
{
179154
using (ISession s = OpenSession())
@@ -198,16 +173,6 @@ private void InitData()
198173
}
199174
}
200175

201-
private async Task DeleteDataAsync(CancellationToken cancellationToken = default(CancellationToken))
202-
{
203-
using (ISession s = OpenSession())
204-
using (ITransaction t = s.BeginTransaction())
205-
{
206-
await (s.DeleteAsync("from Componentizable", cancellationToken));
207-
await (t.CommitAsync(cancellationToken));
208-
}
209-
}
210-
211176
private void DeleteData()
212177
{
213178
using (ISession s = OpenSession())

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

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
namespace NHibernate.Test.NHSpecificTest.NH1507
1717
{
1818
using System.Threading.Tasks;
19-
using System.Threading;
2019
[TestFixture]
2120
public class FixtureAsync : BugTestCase
2221
{
@@ -35,54 +34,6 @@ protected override void OnTearDown()
3534
CleanupData();
3635
}
3736

38-
private async Task CreateDataAsync(CancellationToken cancellationToken = default(CancellationToken))
39-
{
40-
//Employee
41-
var emp = new Employee
42-
{
43-
Address = "Zombie street",
44-
City = "Bitonto",
45-
PostalCode = "66666",
46-
FirstName = "tomb",
47-
LastName = "mutilated"
48-
};
49-
50-
//and his related orders
51-
var order = new Order
52-
{OrderDate = DateTime.Now, Employee = emp, ShipAddress = "dead zone 1", ShipCountry = "Deadville"};
53-
54-
var order2 = new Order
55-
{OrderDate = DateTime.Now, Employee = emp, ShipAddress = "dead zone 2", ShipCountry = "Deadville"};
56-
57-
//Employee with no related orders but with same PostalCode
58-
var emp2 = new Employee
59-
{
60-
Address = "Gut street",
61-
City = "Mariotto",
62-
Country = "Arised",
63-
PostalCode = "66666",
64-
FirstName = "carcass",
65-
LastName = "purulent"
66-
};
67-
68-
//Order with no related employee but with same ShipCountry
69-
var order3 = new Order {OrderDate = DateTime.Now, ShipAddress = "dead zone 2", ShipCountry = "Deadville"};
70-
71-
using (ISession session = OpenSession())
72-
{
73-
using (ITransaction tx = session.BeginTransaction())
74-
{
75-
await (session.SaveAsync(emp, cancellationToken));
76-
await (session.SaveAsync(emp2, cancellationToken));
77-
await (session.SaveAsync(order, cancellationToken));
78-
await (session.SaveAsync(order2, cancellationToken));
79-
await (session.SaveAsync(order3, cancellationToken));
80-
81-
await (tx.CommitAsync(cancellationToken));
82-
}
83-
}
84-
}
85-
8637
private void CreateData()
8738
{
8839
//Employee
@@ -131,23 +82,6 @@ private void CreateData()
13182
}
13283
}
13384

134-
private async Task CleanupDataAsync(CancellationToken cancellationToken = default(CancellationToken))
135-
{
136-
using (ISession session = OpenSession())
137-
{
138-
using (ITransaction tx = session.BeginTransaction())
139-
{
140-
//delete empolyee and related orders
141-
await (session.DeleteAsync("from Employee ee where ee.PostalCode = '66666'", cancellationToken));
142-
143-
//delete order not related to employee
144-
await (session.DeleteAsync("from Order oo where oo.ShipCountry = 'Deadville'", cancellationToken));
145-
146-
await (tx.CommitAsync(cancellationToken));
147-
}
148-
}
149-
}
150-
15185
private void CleanupData()
15286
{
15387
using (ISession session = OpenSession())

src/NHibernate.Test/Async/NHSpecificTest/NH1553/MsSQL/SnapshotIsolationUpdateConflictTest.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -159,17 +159,6 @@ protected override bool AppliesTo(ISessionFactoryImplementor factory)
159159
return factory.ConnectionProvider.Driver is SqlClientDriver;
160160
}
161161

162-
private async Task SetAllowSnapshotIsolationAsync(bool on, CancellationToken cancellationToken = default(CancellationToken))
163-
{
164-
using (ISession session = OpenSession())
165-
{
166-
var command = session.Connection.CreateCommand();
167-
command.CommandText = "ALTER DATABASE " + session.Connection.Database + " set allow_snapshot_isolation "
168-
+ (on ? "on" : "off");
169-
await (command.ExecuteNonQueryAsync(cancellationToken));
170-
}
171-
}
172-
173162
private void SetAllowSnapshotIsolation(bool on)
174163
{
175164
using (ISession session = OpenSession())

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

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
namespace NHibernate.Test.NHSpecificTest.NH1792
1717
{
1818
using System.Threading.Tasks;
19-
using System.Threading;
2019
[TestFixture]
2120
public class FixtureAsync : BugTestCase
2221
{
@@ -25,22 +24,6 @@ protected override void OnTearDown()
2524
DeleteAll();
2625
}
2726

28-
/// <summary>
29-
/// Deletes all the product entities from the persistence medium
30-
/// </summary>
31-
/// <param name="cancellationToken">A cancellation token that can be used to cancel the work</param>
32-
private async Task DeleteAllAsync(CancellationToken cancellationToken = default(CancellationToken))
33-
{
34-
using (ISession session = OpenSession())
35-
{
36-
using (ITransaction trans = session.BeginTransaction())
37-
{
38-
await (session.DeleteAsync("from Product", cancellationToken));
39-
await (trans.CommitAsync(cancellationToken));
40-
}
41-
}
42-
}
43-
4427
/// <summary>
4528
/// Deletes all the product entities from the persistence medium
4629
/// </summary>

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

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
namespace NHibernate.Test.NHSpecificTest.NH2302
1818
{
1919
using System.Threading.Tasks;
20-
using System.Threading;
2120
[TestFixture]
2221
public class FixtureAsync : BugTestCase
2322
{
@@ -197,16 +196,6 @@ public async Task BlobWithoutLengthAsync()
197196
}
198197
}
199198

200-
private async Task CleanUpAsync(CancellationToken cancellationToken = default(CancellationToken))
201-
{
202-
using (ISession session = OpenSession())
203-
using (ITransaction tx = session.BeginTransaction())
204-
{
205-
await (session.DeleteAsync("from StringLengthEntity", cancellationToken));
206-
await (tx.CommitAsync(cancellationToken));
207-
}
208-
}
209-
210199
private void CleanUp()
211200
{
212201
using (ISession session = OpenSession())

src/NHibernate.Test/Async/NHSpecificTest/NH2583/ManualTestFixture.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -305,18 +305,6 @@ protected override void OnTearDown()
305305
}
306306
}
307307

308-
private static Task DeleteAllAsync<T>(ISession session, CancellationToken cancellationToken = default(CancellationToken))
309-
{
310-
try
311-
{
312-
return session.CreateQuery("delete from " + typeof(T).Name).ExecuteUpdateAsync(cancellationToken);
313-
}
314-
catch (Exception ex)
315-
{
316-
return Task.FromException<object>(ex);
317-
}
318-
}
319-
320308
private static void DeleteAll<T>(ISession session)
321309
{
322310
session.CreateQuery("delete from " + typeof(T).Name).ExecuteUpdate();

src/NHibernate.Test/Async/NHSpecificTest/NH3023/DeadlockConnectionPoolIssueTest.cs

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -273,34 +273,6 @@ private static TransactionScope CreateDistributedTransactionScope()
273273
return scope;
274274
}
275275

276-
private async Task RunScriptAsync(string script, CancellationToken cancellationToken = default(CancellationToken))
277-
{
278-
var cxnString = cfg.Properties["connection.connection_string"] + "; Pooling=No";
279-
// Disable connection pooling so this won't be hindered by
280-
// problems encountered during the actual test
281-
282-
string sql;
283-
using (var reader = new StreamReader(GetType().Assembly.GetManifestResourceStream(GetType().Namespace + "." + script)))
284-
{
285-
sql = await (reader.ReadToEndAsync());
286-
}
287-
288-
using (var cxn = new SqlConnection(cxnString))
289-
{
290-
await (cxn.OpenAsync(cancellationToken));
291-
292-
foreach (var batch in Regex.Split(sql, @"^go\s*$", RegexOptions.IgnoreCase | RegexOptions.Multiline)
293-
.Where(b => !string.IsNullOrEmpty(b)))
294-
{
295-
296-
using (var cmd = new System.Data.SqlClient.SqlCommand(batch, cxn))
297-
{
298-
await (cmd.ExecuteNonQueryAsync(cancellationToken));
299-
}
300-
}
301-
}
302-
}
303-
304276
private void RunScript(string script)
305277
{
306278
var cxnString = cfg.Properties["connection.connection_string"] + "; Pooling=No";

src/NHibernate.Test/Async/NHSpecificTest/NH3332/TestJoinsWithSameTable.cs

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
namespace NHibernate.Test.NHSpecificTest.NH3332
1717
{
1818
using System.Threading.Tasks;
19-
using System.Threading;
2019
[TestFixture]
2120
public class TestJoinsWithSameTableAsync : BugTestCase
2221
{
@@ -84,71 +83,6 @@ from std in me.State.StateDescriptions
8483
}
8584

8685

87-
private async Task CreateObjectsAsync(ISession session, CancellationToken cancellationToken = default(CancellationToken))
88-
{
89-
// Create the English culture
90-
Culture englishCulture = new Culture();
91-
92-
93-
englishCulture.CountryCode = "CA";
94-
englishCulture.LanguageCode = "en";
95-
96-
await (session.SaveOrUpdateAsync(englishCulture, cancellationToken));
97-
await (session.FlushAsync(cancellationToken));
98-
99-
// Create the Spanish culture
100-
Culture spanishCulture = new Culture();
101-
spanishCulture.CountryCode = "ES";
102-
spanishCulture.LanguageCode = "es";
103-
104-
await (session.SaveOrUpdateAsync(spanishCulture, cancellationToken));
105-
await (session.FlushAsync(cancellationToken));
106-
107-
// Create a DataType and attach it an English description
108-
109-
DataType dataType1 = new DataType();
110-
dataType1.Name = "int";
111-
112-
DataTypeDescription dataTypeDescription1 = new DataTypeDescription();
113-
114-
dataTypeDescription1.Culture = englishCulture;
115-
dataTypeDescription1.DataType = dataType1;
116-
117-
dataType1.DataTypeDescriptions.Add(dataTypeDescription1);
118-
119-
120-
121-
// Create a State and attach it an English description and a Spanish description
122-
123-
State state1 = new State();
124-
state1.Name = "Development";
125-
126-
StateDescription englishStateDescription = new StateDescription();
127-
englishStateDescription.Culture = englishCulture;
128-
englishStateDescription.State = state1;
129-
// englishStateDescription.Description = "Development - English";
130-
131-
state1.StateDescriptions.Add(englishStateDescription);
132-
133-
StateDescription spanishStateDescription = new StateDescription();
134-
spanishStateDescription.Culture = spanishCulture;
135-
spanishStateDescription.State = state1;
136-
// spanishStateDescription.Description = "Development - Spanish";
137-
138-
state1.StateDescriptions.Add(spanishStateDescription);
139-
140-
141-
MasterEntity masterEntity = new MasterEntity();
142-
143-
masterEntity.Name = "MasterEntity 1";
144-
masterEntity.State = state1;
145-
masterEntity.DataType = dataType1;
146-
147-
await (session.SaveOrUpdateAsync(masterEntity, cancellationToken));
148-
await (session.FlushAsync(cancellationToken));
149-
}
150-
151-
15286
private void CreateObjects(ISession session)
15387
{
15488
// Create the English culture

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

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
namespace NHibernate.Test.NHSpecificTest.NH3620 {
1616
using System.Threading.Tasks;
17-
using System.Threading;
1817
[TestFixture]
1918
public class FixtureAsync : BugTestCase {
2019
protected override bool AppliesTo(Engine.ISessionFactoryImplementor factory) {
@@ -44,16 +43,6 @@ public async Task Should_insert_two_blobs_and_a_dateAsync()
4443
}
4544
}
4645

47-
private async Task CleanupDataAsync(CancellationToken cancellationToken = default(CancellationToken))
48-
{
49-
using (ISession session = OpenSession()) {
50-
using (ITransaction tx = session.BeginTransaction()) {
51-
await (session.DeleteAsync("from TwoBlobs", cancellationToken));
52-
await (tx.CommitAsync(cancellationToken));
53-
}
54-
}
55-
}
56-
5746
private void CleanupData() {
5847
using (ISession session = OpenSession()) {
5948
using (ITransaction tx = session.BeginTransaction()) {

0 commit comments

Comments
 (0)