Skip to content

Upgrade AsyncGenerator to 0.6.2 and regenerate. #1445

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 3 commits into from
Nov 19, 2017
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
2 changes: 1 addition & 1 deletion Tools/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
<package id="NUnit.Extension.NUnitV2ResultWriter" version="3.6.0" targetFramework="net461" />
<package id="NUnit.Extension.TeamCityEventListener" version="1.0.2" targetFramework="net461" />
<package id="NUnit.Extension.VSProjectLoader" version="3.6.0" targetFramework="net461" />
<package id="CSharpAsyncGenerator.CommandLine" version="0.6.0" targetFramework="net461" />
<package id="CSharpAsyncGenerator.CommandLine" version="0.6.2" targetFramework="net461" />
<package id="vswhere" version="2.1.4" targetFramework="net461" />
</packages>
35 changes: 0 additions & 35 deletions src/NHibernate.Test/Async/ExpressionTest/QueryByExampleTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
namespace NHibernate.Test.ExpressionTest
{
using System.Threading.Tasks;
using System.Threading;
[TestFixture]
public class QueryByExampleTestAsync : TestCase
{
Expand Down Expand Up @@ -150,30 +149,6 @@ public async Task TestExcludingQBEAsync()
}
}

private async Task InitDataAsync(CancellationToken cancellationToken = default(CancellationToken))
{
using (ISession s = OpenSession())
{
Componentizable master = GetMaster("hibernate", "ORM tool", "ORM tool1");
await (s.SaveAsync(master, cancellationToken));
await (s.FlushAsync(cancellationToken));
}

using (ISession s = OpenSession())
{
Componentizable master = GetMaster("hibernate", "open source", "open source1");
await (s.SaveAsync(master, cancellationToken));
await (s.FlushAsync(cancellationToken));
}

using (ISession s = OpenSession())
{
Componentizable master = GetMaster("hibernate", null, null);
await (s.SaveAsync(master, cancellationToken));
await (s.FlushAsync(cancellationToken));
}
}

private void InitData()
{
using (ISession s = OpenSession())
Expand All @@ -198,16 +173,6 @@ private void InitData()
}
}

private async Task DeleteDataAsync(CancellationToken cancellationToken = default(CancellationToken))
{
using (ISession s = OpenSession())
using (ITransaction t = s.BeginTransaction())
{
await (s.DeleteAsync("from Componentizable", cancellationToken));
await (t.CommitAsync(cancellationToken));
}
}

private void DeleteData()
{
using (ISession s = OpenSession())
Expand Down
66 changes: 0 additions & 66 deletions src/NHibernate.Test/Async/NHSpecificTest/NH1507/Fixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
namespace NHibernate.Test.NHSpecificTest.NH1507
{
using System.Threading.Tasks;
using System.Threading;
[TestFixture]
public class FixtureAsync : BugTestCase
{
Expand All @@ -35,54 +34,6 @@ protected override void OnTearDown()
CleanupData();
}

private async Task CreateDataAsync(CancellationToken cancellationToken = default(CancellationToken))
{
//Employee
var emp = new Employee
{
Address = "Zombie street",
City = "Bitonto",
PostalCode = "66666",
FirstName = "tomb",
LastName = "mutilated"
};

//and his related orders
var order = new Order
{OrderDate = DateTime.Now, Employee = emp, ShipAddress = "dead zone 1", ShipCountry = "Deadville"};

var order2 = new Order
{OrderDate = DateTime.Now, Employee = emp, ShipAddress = "dead zone 2", ShipCountry = "Deadville"};

//Employee with no related orders but with same PostalCode
var emp2 = new Employee
{
Address = "Gut street",
City = "Mariotto",
Country = "Arised",
PostalCode = "66666",
FirstName = "carcass",
LastName = "purulent"
};

//Order with no related employee but with same ShipCountry
var order3 = new Order {OrderDate = DateTime.Now, ShipAddress = "dead zone 2", ShipCountry = "Deadville"};

using (ISession session = OpenSession())
{
using (ITransaction tx = session.BeginTransaction())
{
await (session.SaveAsync(emp, cancellationToken));
await (session.SaveAsync(emp2, cancellationToken));
await (session.SaveAsync(order, cancellationToken));
await (session.SaveAsync(order2, cancellationToken));
await (session.SaveAsync(order3, cancellationToken));

await (tx.CommitAsync(cancellationToken));
}
}
}

private void CreateData()
{
//Employee
Expand Down Expand Up @@ -131,23 +82,6 @@ private void CreateData()
}
}

private async Task CleanupDataAsync(CancellationToken cancellationToken = default(CancellationToken))
{
using (ISession session = OpenSession())
{
using (ITransaction tx = session.BeginTransaction())
{
//delete empolyee and related orders
await (session.DeleteAsync("from Employee ee where ee.PostalCode = '66666'", cancellationToken));

//delete order not related to employee
await (session.DeleteAsync("from Order oo where oo.ShipCountry = 'Deadville'", cancellationToken));

await (tx.CommitAsync(cancellationToken));
}
}
}

private void CleanupData()
{
using (ISession session = OpenSession())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,17 +159,6 @@ protected override bool AppliesTo(ISessionFactoryImplementor factory)
return factory.ConnectionProvider.Driver is SqlClientDriver;
}

private async Task SetAllowSnapshotIsolationAsync(bool on, CancellationToken cancellationToken = default(CancellationToken))
{
using (ISession session = OpenSession())
{
var command = session.Connection.CreateCommand();
command.CommandText = "ALTER DATABASE " + session.Connection.Database + " set allow_snapshot_isolation "
+ (on ? "on" : "off");
await (command.ExecuteNonQueryAsync(cancellationToken));
}
}

private void SetAllowSnapshotIsolation(bool on)
{
using (ISession session = OpenSession())
Expand Down
17 changes: 0 additions & 17 deletions src/NHibernate.Test/Async/NHSpecificTest/NH1792/Fixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
namespace NHibernate.Test.NHSpecificTest.NH1792
{
using System.Threading.Tasks;
using System.Threading;
[TestFixture]
public class FixtureAsync : BugTestCase
{
Expand All @@ -25,22 +24,6 @@ protected override void OnTearDown()
DeleteAll();
}

/// <summary>
/// Deletes all the product entities from the persistence medium
/// </summary>
/// <param name="cancellationToken">A cancellation token that can be used to cancel the work</param>
private async Task DeleteAllAsync(CancellationToken cancellationToken = default(CancellationToken))
{
using (ISession session = OpenSession())
{
using (ITransaction trans = session.BeginTransaction())
{
await (session.DeleteAsync("from Product", cancellationToken));
await (trans.CommitAsync(cancellationToken));
}
}
}

/// <summary>
/// Deletes all the product entities from the persistence medium
/// </summary>
Expand Down
11 changes: 0 additions & 11 deletions src/NHibernate.Test/Async/NHSpecificTest/NH2302/Fixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
namespace NHibernate.Test.NHSpecificTest.NH2302
{
using System.Threading.Tasks;
using System.Threading;
[TestFixture]
public class FixtureAsync : BugTestCase
{
Expand Down Expand Up @@ -197,16 +196,6 @@ public async Task BlobWithoutLengthAsync()
}
}

private async Task CleanUpAsync(CancellationToken cancellationToken = default(CancellationToken))
{
using (ISession session = OpenSession())
using (ITransaction tx = session.BeginTransaction())
{
await (session.DeleteAsync("from StringLengthEntity", cancellationToken));
await (tx.CommitAsync(cancellationToken));
}
}

private void CleanUp()
{
using (ISession session = OpenSession())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,18 +305,6 @@ protected override void OnTearDown()
}
}

private static Task DeleteAllAsync<T>(ISession session, CancellationToken cancellationToken = default(CancellationToken))
{
try
{
return session.CreateQuery("delete from " + typeof(T).Name).ExecuteUpdateAsync(cancellationToken);
}
catch (Exception ex)
{
return Task.FromException<object>(ex);
}
}

private static void DeleteAll<T>(ISession session)
{
session.CreateQuery("delete from " + typeof(T).Name).ExecuteUpdate();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,34 +273,6 @@ private static TransactionScope CreateDistributedTransactionScope()
return scope;
}

private async Task RunScriptAsync(string script, CancellationToken cancellationToken = default(CancellationToken))
{
var cxnString = cfg.Properties["connection.connection_string"] + "; Pooling=No";
// Disable connection pooling so this won't be hindered by
// problems encountered during the actual test

string sql;
using (var reader = new StreamReader(GetType().Assembly.GetManifestResourceStream(GetType().Namespace + "." + script)))
{
sql = await (reader.ReadToEndAsync());
}

using (var cxn = new SqlConnection(cxnString))
{
await (cxn.OpenAsync(cancellationToken));

foreach (var batch in Regex.Split(sql, @"^go\s*$", RegexOptions.IgnoreCase | RegexOptions.Multiline)
.Where(b => !string.IsNullOrEmpty(b)))
{

using (var cmd = new System.Data.SqlClient.SqlCommand(batch, cxn))
{
await (cmd.ExecuteNonQueryAsync(cancellationToken));
}
}
}
}

private void RunScript(string script)
{
var cxnString = cfg.Properties["connection.connection_string"] + "; Pooling=No";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
namespace NHibernate.Test.NHSpecificTest.NH3332
{
using System.Threading.Tasks;
using System.Threading;
[TestFixture]
public class TestJoinsWithSameTableAsync : BugTestCase
{
Expand Down Expand Up @@ -84,71 +83,6 @@ from std in me.State.StateDescriptions
}


private async Task CreateObjectsAsync(ISession session, CancellationToken cancellationToken = default(CancellationToken))
{
// Create the English culture
Culture englishCulture = new Culture();


englishCulture.CountryCode = "CA";
englishCulture.LanguageCode = "en";

await (session.SaveOrUpdateAsync(englishCulture, cancellationToken));
await (session.FlushAsync(cancellationToken));

// Create the Spanish culture
Culture spanishCulture = new Culture();
spanishCulture.CountryCode = "ES";
spanishCulture.LanguageCode = "es";

await (session.SaveOrUpdateAsync(spanishCulture, cancellationToken));
await (session.FlushAsync(cancellationToken));

// Create a DataType and attach it an English description

DataType dataType1 = new DataType();
dataType1.Name = "int";

DataTypeDescription dataTypeDescription1 = new DataTypeDescription();

dataTypeDescription1.Culture = englishCulture;
dataTypeDescription1.DataType = dataType1;

dataType1.DataTypeDescriptions.Add(dataTypeDescription1);



// Create a State and attach it an English description and a Spanish description

State state1 = new State();
state1.Name = "Development";

StateDescription englishStateDescription = new StateDescription();
englishStateDescription.Culture = englishCulture;
englishStateDescription.State = state1;
// englishStateDescription.Description = "Development - English";

state1.StateDescriptions.Add(englishStateDescription);

StateDescription spanishStateDescription = new StateDescription();
spanishStateDescription.Culture = spanishCulture;
spanishStateDescription.State = state1;
// spanishStateDescription.Description = "Development - Spanish";

state1.StateDescriptions.Add(spanishStateDescription);


MasterEntity masterEntity = new MasterEntity();

masterEntity.Name = "MasterEntity 1";
masterEntity.State = state1;
masterEntity.DataType = dataType1;

await (session.SaveOrUpdateAsync(masterEntity, cancellationToken));
await (session.FlushAsync(cancellationToken));
}


private void CreateObjects(ISession session)
{
// Create the English culture
Expand Down
11 changes: 0 additions & 11 deletions src/NHibernate.Test/Async/NHSpecificTest/NH3620/Fixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

namespace NHibernate.Test.NHSpecificTest.NH3620 {
using System.Threading.Tasks;
using System.Threading;
[TestFixture]
public class FixtureAsync : BugTestCase {
protected override bool AppliesTo(Engine.ISessionFactoryImplementor factory) {
Expand Down Expand Up @@ -44,16 +43,6 @@ public async Task Should_insert_two_blobs_and_a_dateAsync()
}
}

private async Task CleanupDataAsync(CancellationToken cancellationToken = default(CancellationToken))
{
using (ISession session = OpenSession()) {
using (ITransaction tx = session.BeginTransaction()) {
await (session.DeleteAsync("from TwoBlobs", cancellationToken));
await (tx.CommitAsync(cancellationToken));
}
}
}

private void CleanupData() {
using (ISession session = OpenSession()) {
using (ITransaction tx = session.BeginTransaction()) {
Expand Down
Loading