Skip to content

Commit 047c35e

Browse files
committed
Merge branch '6.0' into 7.0
# Conflicts: # Orm/Xtensive.Orm.Tests.Framework/Orm.config # Orm/Xtensive.Orm.Tests/Interfaces/KeyStructureConflictTest.cs # Orm/Xtensive.Orm.Tests/Interfaces/TypeIdModeConflictTest.cs # Orm/Xtensive.Orm.Tests/Interfaces/UnusedTypeRemovalTest.cs # Orm/Xtensive.Orm.Tests/Issues/IssueJira0197_ExtendedErrorInformation.cs
2 parents 646dfa8 + 8e9394f commit 047c35e

7 files changed

Lines changed: 121 additions & 130 deletions

File tree

Orm/Xtensive.Orm.Manual/Xtensive.Orm.Manual.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<!-- <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" /> -->
2727
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.2" />
2828
<PackageReference Include="NUnit" Version="3.12.0" />
29-
<PackageReference Include="NUnit3TestAdapter" Version="3.15.0" />
29+
<PackageReference Include="NUnit3TestAdapter" Version="3.15.1" />
3030
</ItemGroup>
3131
<ItemGroup>
3232
<Content Include="EntitySets\DatabaseSchema.gif" />

Orm/Xtensive.Orm.Tests.Framework/Orm.config

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@
3636
<domain name="mssql2022"
3737
connectionUrl="sqlserver://dotest:dotest@localhost\DO_SQL2022:1422/DO-Tests?MultipleActiveResultSets=True" />
3838

39+
<!-- A hook to have abitity to check and test newer, yet not supported, versions without adding them to the file -->
40+
<!-- This allows to override it in storage configuration files -->
41+
<domain name="mssqlnext"
42+
connectionUrl="sqlserver://localhost/DO-Tests?MultipleActiveResultSets=True" />
43+
3944
<domain name="pgsql83"
4045
connectionUrl="postgresql://dotest:dotest@localhost:5483/dotest" />
4146

@@ -72,12 +77,22 @@
7277
<domain name="pgsql150"
7378
connectionUrl="postgresql://dotest:dotest@localhost:54150/dotest" />
7479

80+
<!-- A hook to have abitity to check and test newer, yet not supported, versions without adding them to the file -->
81+
<!-- This allows to override it in storage configuration files -->
82+
<domain name="pgsqlnext"
83+
connectionUrl="postgresql://dotest:dotest@localhost:54150/dotest" />
84+
7585
<domain name="oracle10"
7686
connectionUrl="oracle://dotest:dotest@localhost:5510/ora10" />
7787

7888
<domain name="oracle11"
7989
connectionUrl="oracle://dotest:dotest@localhost:5511/ora11" />
8090

91+
<!-- A hook to have abitity to check and test newer, yet not supported, versions without adding them to the file -->
92+
<!-- This allows to override it in storage configuration files -->
93+
<domain name="oraclenext"
94+
connectionUrl="oracle://dotest:dotest@localhost:5511/ora11" />
95+
8196
<domain name="mysql55"
8297
connectionUrl="mysql://dotest:dotest@localhost:3355/dotest" />
8398

@@ -90,12 +105,22 @@
90105
<domain name="mysql80"
91106
connectionUrl="mysql://dotest:dotest@localhost:3380/dotest" />
92107

108+
<!-- A hook to have abitity to check and test newer, yet not supported, versions without adding them to the file -->
109+
<!-- This allows to override it in storage configuration files -->
110+
<domain name="mysqlnext"
111+
connectionUrl="mysql://dotest:dotest@localhost:3380/dotest" />
112+
93113
<domain name="firebird25"
94114
connectionUrl="firebird://dotest:dotest@localhost:3050/dotest" />
95115

96116
<domain name="firebird30"
97117
connectionUrl="firebird://dotest:dotest@localhost:3053/dotest" />
98118

119+
<!-- A hook to have abitity to check and test newer, yet not supported, versions without adding them to the file -->
120+
<!-- This allows to override it in storage configuration files -->
121+
<domain name="firebirdnext"
122+
connectionUrl="sqlserver://localhost/DO-Tests?MultipleActiveResultSets=True" />
123+
99124
<domain name="sqlite3"
100125
connectionUrl="sqlite:///DO-Tests.db3" />
101126

@@ -131,6 +156,11 @@
131156
<domain name="mssql2022cs" provider="sqlserver"
132157
connectionString="Data Source=localhost\DO_SQL2022,1422;Initial Catalog=DO-Tests;User ID=dotest;Password=dotest;MultipleActiveResultSets=True;Encrypt=false" />
133158

159+
<!-- A hook to have abitity to check and test newer, yet not supported, versions without adding them to the file -->
160+
<!-- This allows to override it in storage configuration files -->
161+
<domain name="mssqlnextcs" provider="sqlserver"
162+
connectionString="Data Source=localhost;Initial Catalog=DO-Tests;Integrated Security=True;MultipleActiveResultSets=True" />
163+
134164
<domain name="pgsql83cs" provider="postgresql"
135165
connectionString="HOST=localhost;PORT=5483;DATABASE=dotest;USER ID=dotest;PASSWORD=dotest" />
136166

@@ -167,12 +197,22 @@
167197
<domain name="pgsql150cs" provider="postgresql"
168198
connectionString="HOST=localhost;PORT=54150;DATABASE=dotest;USER ID=dotest;PASSWORD=dotest" />
169199

200+
<!-- A hook to have abitity to check and test newer, yet not supported, versions without adding them to the file -->
201+
<!-- This allows to override it in storage configuration files -->
202+
<domain name="pgsqlnextcs" provider="postgresql"
203+
connectionString="HOST=localhost;PORT=54150;DATABASE=dotest;USER ID=dotest;PASSWORD=dotest" />
204+
170205
<domain name="oracle10cs" provider="oracle"
171206
connectionString="DATA SOURCE=&quot;(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=5510))(CONNECT_DATA=(SERVICE_NAME=ora10)))&quot;;USER ID=dotest;PASSWORD=dotest" />
172207

173208
<domain name="oracle11cs" provider="oracle"
174209
connectionString="DATA SOURCE=&quot;(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=5511))(CONNECT_DATA=(SERVICE_NAME=ora11)))&quot;;USER ID=dotest;PASSWORD=dotest" />
175210

211+
<!-- A hook to have abitity to check and test newer, yet not supported, versions without adding them to the file -->
212+
<!-- This allows to override it in storage configuration files -->
213+
<domain name="oraclenextcs" provider="oracle"
214+
connectionString="DATA SOURCE=&quot;(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=5511))(CONNECT_DATA=(SERVICE_NAME=ora11)))&quot;;USER ID=dotest;PASSWORD=dotest" />
215+
176216
<domain name="mysql55cs" provider="mysql"
177217
connectionString="Server=localhost;Port=3355;Database=dotest;Uid=dotest;Pwd=dotest" />
178218

@@ -185,12 +225,22 @@
185225
<domain name="mysql80cs" provider="mysql"
186226
connectionString="Server=localhost;Port=3380;Database=dotest;Uid=dotest;Pwd=dotest" />
187227

228+
<!-- A hook to have abitity to check and test newer, yet not supported, versions without adding them to the file -->
229+
<!-- This allows to override it in storage configuration files -->
230+
<domain name="mysqlnextcs" provider="mysql"
231+
connectionString="Server=localhost;Port=3380;Database=dotest;Uid=dotest;Pwd=dotest" />
232+
188233
<domain name="firebird25cs" provider="firebird"
189234
connectionString="User=dotest;Password=dotest;Database=dotest;DataSource=localhost;Port=3050;Dialect=3;Charset=UTF8;Role=;Connection lifetime=15;Pooling=true;MinPoolSize=0;MaxPoolSize=50;Packet Size=8192;ServerType=0" />
190235

191236
<domain name="firebird30cs" provider="firebird"
192237
connectionString="User=dotest;Password=dotest;Database=dotest;DataSource=localhost;Port=3053;Dialect=3;Charset=UTF8;Role=;Connection lifetime=15;Pooling=true;MinPoolSize=0;MaxPoolSize=50;Packet Size=8192;ServerType=0" />
193238

239+
<!-- A hook to have abitity to check and test newer, yet not supported, versions without adding them to the file -->
240+
<!-- This allows to override it in storage configuration files -->
241+
<domain name="firebirdnextcs" provider="firebird"
242+
connectionString="User=dotest;Password=dotest;Database=dotest;DataSource=localhost;Port=3053;Dialect=3;Charset=UTF8;Role=;Connection lifetime=15;Pooling=true;MinPoolSize=0;MaxPoolSize=50;Packet Size=8192;ServerType=0" />
243+
194244
<domain name="sqlite3cs" provider="sqlite"
195245
connectionString="Data Source=DO-Tests.db3" />
196246
</domains>

Orm/Xtensive.Orm.Tests/Interfaces/KeyStructureConflictTest.cs

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -45,25 +45,17 @@ public class Child2 : Root2, IChild
4545

4646
namespace Xtensive.Orm.Tests.Interfaces
4747
{
48-
public class KeyStructureConflictTest : AutoBuildTest
48+
public class KeyStructureConflictTest
4949
{
50-
protected override DomainConfiguration BuildConfiguration()
50+
[Test]
51+
public void MainTest()
5152
{
52-
var config = base.BuildConfiguration();
53+
var config = DomainConfigurationFactory.Create();
5354
config.Types.RegisterCaching(typeof (Root1).Assembly, typeof (Root1).Namespace);
54-
return config;
55-
}
56-
57-
protected override Domain BuildDomain(DomainConfiguration configuration)
58-
{
59-
try {
60-
base.BuildDomain(configuration);
61-
Assert.Fail();
62-
}
63-
catch (DomainBuilderException e) {
64-
Console.WriteLine(e);
65-
}
66-
return null;
55+
var ex = Assert.Throws<DomainBuilderException>(() => Domain.Build(config));
56+
var message = ex.Message;
57+
Assert.That(message.Contains("IChild") && message.Contains("different key structure") && message.Contains("Root1 & Root2"),
58+
Is.True);
6759
}
6860
}
6961
}

Orm/Xtensive.Orm.Tests/Interfaces/TypeIdModeConflictTest.cs

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,25 +34,17 @@ public class Root2 : Entity, IRoot
3434

3535
namespace Xtensive.Orm.Tests.Interfaces
3636
{
37-
public class TypeIdModeConflictTest : AutoBuildTest
37+
public class TypeIdModeConflictTest
3838
{
39-
protected override DomainConfiguration BuildConfiguration()
39+
[Test]
40+
public void MainTest()
4041
{
41-
var config = base.BuildConfiguration();
42+
var config = DomainConfigurationFactory.Create();
4243
config.Types.RegisterCaching(typeof (Root1).Assembly, typeof (Root1).Namespace);
43-
return config;
44-
}
45-
46-
protected override Domain BuildDomain(DomainConfiguration configuration)
47-
{
48-
try {
49-
base.BuildDomain(configuration);
50-
Assert.Fail();
51-
}
52-
catch (DomainBuilderException e) {
53-
Console.WriteLine(e);
54-
}
55-
return null;
44+
var ex = Assert.Throws<DomainBuilderException>(() => Domain.Build(config));
45+
var message = ex.Message;
46+
Assert.That(message.Contains("IRoot") && message.Contains("one of which includes TypeId, but another doesn't") && message.Contains("Root1 & Root2"),
47+
Is.True);
5648
}
5749
}
5850
}

Orm/Xtensive.Orm.Tests/Interfaces/UnusedTypeRemovalTest.cs

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -51,31 +51,18 @@ public class First : Entity, IFirst
5151

5252
namespace Xtensive.Orm.Tests.Interfaces
5353
{
54-
public class UnusedTypeRemovalTest : AutoBuildTest
54+
public class UnusedTypeRemovalTest
5555
{
5656
[Test]
5757
public void MainTest()
5858
{
59-
Assert.IsNull(Domain);
60-
}
59+
var config = DomainConfigurationFactory.Create();
60+
config.Types.RegisterCaching(typeof(IFirst).Assembly, typeof(IFirst).Namespace);
6161

62-
protected override DomainConfiguration BuildConfiguration()
63-
{
64-
var config = base.BuildConfiguration();
65-
config.Types.RegisterCaching(typeof (IFirst).Assembly, typeof (IFirst).Namespace);
66-
return config;
67-
}
68-
69-
protected override Domain BuildDomain(DomainConfiguration configuration)
70-
{
71-
try {
72-
base.BuildDomain(configuration);
73-
Assert.Fail();
74-
}
75-
catch (DomainBuilderException e) {
76-
Console.WriteLine(e);
77-
}
78-
return null;
62+
var ex = Assert.Throws<DomainBuilderException>(() => Domain.Build(config));
63+
var message = ex.Message;
64+
Assert.That(message.Contains("ISecond") && message.Contains("don't belong") && message.Contains("hierarchy"),
65+
Is.True);
7966
}
8067
}
8168
}

Orm/Xtensive.Orm.Tests/Issues/Issue0262_StructureAssignment.cs

Lines changed: 22 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -64,53 +64,40 @@ protected override DomainConfiguration BuildConfiguration()
6464
[Test]
6565
public void SetTest()
6666
{
67-
using (var session = Domain.OpenSession()) {
68-
using (var t = session.OpenTransaction()) {
69-
70-
var container = new Container();
71-
try {
72-
container.Value = new Triple();
73-
Assert.Fail();
74-
} catch (InvalidOperationException) {
75-
76-
}
77-
78-
// Rollback
79-
}
67+
using (var session = Domain.OpenSession())
68+
using (var t = session.OpenTransaction()) {
69+
70+
var container = new Container();
71+
_ = Assert.Throws<InvalidOperationException>(() => { container.Value = new Triple(); });
72+
73+
// Rollback
8074
}
8175
}
8276

8377
[Test]
8478
public void CastTest()
8579
{
86-
using (var session = Domain.OpenSession()) {
87-
using (var t = session.OpenTransaction()) {
88-
89-
var container = new Container();
90-
try {
91-
container.Value = (Pair)new Triple();
92-
Assert.Fail();
93-
} catch (InvalidOperationException) {
94-
95-
}
96-
97-
// Rollback
98-
}
80+
using (var session = Domain.OpenSession())
81+
using (var t = session.OpenTransaction()) {
82+
83+
var container = new Container();
84+
_ = Assert.Throws<InvalidOperationException>(() => { container.Value = (Pair) new Triple(); });
85+
86+
// Rollback
9987
}
10088
}
10189

10290
[Test]
10391
public void ValidTest()
10492
{
105-
using (var session = Domain.OpenSession()) {
106-
using (var t = session.OpenTransaction()) {
107-
108-
var container = new Container();
109-
var triple = new Triple();
110-
container.Value = new Pair(triple.One, triple.Two);
111-
112-
// Rollback
113-
}
93+
using (var session = Domain.OpenSession())
94+
using (var t = session.OpenTransaction()) {
95+
96+
var container = new Container();
97+
var triple = new Triple();
98+
container.Value = new Pair(triple.One, triple.Two);
99+
100+
// Rollback
114101
}
115102
}
116103
}

0 commit comments

Comments
 (0)