Skip to content

Commit 5d77746

Browse files
Obsolete dynamic proxies
1 parent fed670d commit 5d77746

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+560
-325
lines changed

src/NHibernate.Test/Async/DynamicEntity/Interceptor/InterceptorDynamicEntity.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
//------------------------------------------------------------------------------
99

1010

11+
using System;
1112
using System.Collections;
1213
using NHibernate.Cfg;
1314
using NUnit.Framework;
@@ -16,6 +17,7 @@ namespace NHibernate.Test.DynamicEntity.Interceptor
1617
{
1718
using System.Threading.Tasks;
1819
[TestFixture]
20+
[Obsolete("Require dynamic proxies")]
1921
public class InterceptorDynamicEntityAsync : TestCase
2022
{
2123
protected override string MappingsAssembly
@@ -100,4 +102,4 @@ public async Task ItAsync()
100102
session.Close();
101103
}
102104
}
103-
}
105+
}

src/NHibernate.Test/Async/DynamicEntity/Tuplizer/TuplizerDynamicEntity.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
//------------------------------------------------------------------------------
99

1010

11+
using System;
1112
using System.Collections;
1213
using System.Collections.Generic;
1314
using NHibernate.Cfg;
@@ -17,6 +18,7 @@ namespace NHibernate.Test.DynamicEntity.Tuplizer
1718
{
1819
using System.Threading.Tasks;
1920
[TestFixture]
21+
[Obsolete("Require dynamic proxies")]
2022
public class TuplizerDynamicEntityAsync : TestCase
2123
{
2224
protected override string MappingsAssembly
@@ -116,4 +118,4 @@ public async Task ItAsync()
116118
session.Close();
117119
}
118120
}
119-
}
121+
}

src/NHibernate.Test/CfgTest/Loquacious/ConfigurationFixture.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
using NHibernate.Driver;
1010
using NHibernate.Exceptions;
1111
using NHibernate.Hql.Ast.ANTLR;
12-
using NHibernate.Linq;
1312
using NHibernate.Type;
1413
using NUnit.Framework;
1514

@@ -37,7 +36,7 @@ public void CompleteConfiguration()
3736
.Through<DefaultCollectionTypeFactory>()
3837
.Proxy
3938
.DisableValidation()
40-
.Through<DefaultProxyFactoryFactory>()
39+
.Through<StaticProxyFactoryFactory>()
4140
.ParsingHqlThrough<ASTQueryTranslatorFactory>()
4241
.Mapping
4342
.UsingDefaultCatalog("MyCatalog")
@@ -75,7 +74,7 @@ public void CompleteConfiguration()
7574
Assert.That(cfg.Properties[Environment.CacheDefaultExpiration], Is.EqualTo("15"));
7675
Assert.That(cfg.Properties[Environment.CollectionTypeFactoryClass], Is.EqualTo(typeof(DefaultCollectionTypeFactory).AssemblyQualifiedName));
7776
Assert.That(cfg.Properties[Environment.UseProxyValidator], Is.EqualTo("false"));
78-
Assert.That(cfg.Properties[Environment.ProxyFactoryFactoryClass], Is.EqualTo(typeof(DefaultProxyFactoryFactory).AssemblyQualifiedName));
77+
Assert.That(cfg.Properties[Environment.ProxyFactoryFactoryClass], Is.EqualTo(typeof(StaticProxyFactoryFactory).AssemblyQualifiedName));
7978
Assert.That(cfg.Properties[Environment.QueryTranslator], Is.EqualTo(typeof(ASTQueryTranslatorFactory).AssemblyQualifiedName));
8079
Assert.That(cfg.Properties[Environment.DefaultCatalog], Is.EqualTo("MyCatalog"));
8180
Assert.That(cfg.Properties[Environment.DefaultSchema], Is.EqualTo("MySche"));
@@ -108,13 +107,13 @@ public void UseDbConfigurationStringBuilder()
108107
// The place where put default properties values is the Dialect itself.
109108
var cfg = new Configuration();
110109
cfg.SessionFactory()
111-
.Proxy.Through<DefaultProxyFactoryFactory>()
110+
.Proxy.Through<StaticProxyFactoryFactory>()
112111
.Integrate
113112
.Using<MsSql2005Dialect>()
114113
.Connected
115114
.Using(new SqlConnectionStringBuilder { DataSource = "(local)", InitialCatalog = "nhibernate", IntegratedSecurity = true });
116115

117-
Assert.That(cfg.Properties[Environment.ProxyFactoryFactoryClass], Is.EqualTo(typeof(DefaultProxyFactoryFactory).AssemblyQualifiedName));
116+
Assert.That(cfg.Properties[Environment.ProxyFactoryFactoryClass], Is.EqualTo(typeof(StaticProxyFactoryFactory).AssemblyQualifiedName));
118117
Assert.That(cfg.Properties[Environment.Dialect], Is.EqualTo(typeof(MsSql2005Dialect).AssemblyQualifiedName));
119118
Assert.That(cfg.Properties[Environment.ConnectionString], Is.EqualTo("Data Source=(local);Initial Catalog=nhibernate;Integrated Security=True"));
120119
}

src/NHibernate.Test/CfgTest/Loquacious/LambdaConfigurationFixture.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public void FullConfiguration()
3535
configure.Proxy(p =>
3636
{
3737
p.Validation = false;
38-
p.ProxyFactoryFactory<DefaultProxyFactoryFactory>();
38+
p.ProxyFactoryFactory<StaticProxyFactoryFactory>();
3939
});
4040
configure.Mappings(m=>
4141
{
@@ -76,7 +76,7 @@ public void FullConfiguration()
7676
Is.EqualTo(typeof(DefaultCollectionTypeFactory).AssemblyQualifiedName));
7777
Assert.That(configure.Properties[Environment.UseProxyValidator], Is.EqualTo("false"));
7878
Assert.That(configure.Properties[Environment.ProxyFactoryFactoryClass],
79-
Is.EqualTo(typeof(DefaultProxyFactoryFactory).AssemblyQualifiedName));
79+
Is.EqualTo(typeof(StaticProxyFactoryFactory).AssemblyQualifiedName));
8080
Assert.That(configure.Properties[Environment.QueryTranslator],
8181
Is.EqualTo(typeof(ASTQueryTranslatorFactory).AssemblyQualifiedName));
8282
Assert.That(configure.Properties[Environment.DefaultCatalog], Is.EqualTo("MyCatalog"));

src/NHibernate.Test/DynamicEntity/DataProxyHandler.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
using System;
12
using System.Collections;
23
using NHibernate.Proxy.DynamicProxy;
34

45
namespace NHibernate.Test.DynamicEntity
56
{
7+
[Obsolete("Require dynamic proxies")]
68
public sealed class DataProxyHandler : Proxy.DynamicProxy.IInterceptor
79
{
810
private readonly Hashtable data = new Hashtable();
@@ -56,4 +58,4 @@ public object Intercept(InvocationInfo info)
5658

5759
#endregion
5860
}
59-
}
61+
}
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
using System;
2+
13
namespace NHibernate.Test.DynamicEntity
24
{
5+
[Obsolete("Require dynamic proxies")]
36
public interface IProxyMarker
47
{
58
DataProxyHandler DataHandler { get;}
69
}
7-
}
10+
}

src/NHibernate.Test/DynamicEntity/Interceptor/InterceptorDynamicEntity.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
using System;
12
using System.Collections;
23
using NHibernate.Cfg;
34
using NUnit.Framework;
45

56
namespace NHibernate.Test.DynamicEntity.Interceptor
67
{
78
[TestFixture]
9+
[Obsolete("Require dynamic proxies")]
810
public class InterceptorDynamicEntity : TestCase
911
{
1012
protected override string MappingsAssembly
@@ -89,4 +91,4 @@ public void It()
8991
session.Close();
9092
}
9193
}
92-
}
94+
}

src/NHibernate.Test/DynamicEntity/Interceptor/ProxyInterceptor.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
using System;
2+
13
namespace NHibernate.Test.DynamicEntity.Interceptor
24
{
5+
[Obsolete("Require dynamic proxies")]
36
public class ProxyInterceptor : EmptyInterceptor
47
{
58
public override string GetEntityName(object entity)
@@ -21,4 +24,4 @@ public override object Instantiate(string entityName, object id)
2124
return base.Instantiate(entityName, id);
2225
}
2326
}
24-
}
27+
}

src/NHibernate.Test/DynamicEntity/ProxyHelper.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
using System;
12
using NHibernate.Proxy.DynamicProxy;
23

34
namespace NHibernate.Test.DynamicEntity
45
{
6+
[Obsolete("Require dynamic proxies")]
57
public class ProxyHelper
68
{
79
private static readonly ProxyFactory proxyGenerator = new ProxyFactory();
@@ -67,4 +69,4 @@ public static string ExtractEntityName(object obj)
6769
return null;
6870
}
6971
}
70-
}
72+
}
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
using System;
2+
13
namespace NHibernate.Test.DynamicEntity.Tuplizer
24
{
5+
[Obsolete("Require dynamic proxies")]
36
public class EntityNameInterceptor : EmptyInterceptor
47
{
58
public override string GetEntityName(object entity)
@@ -8,4 +11,4 @@ public override string GetEntityName(object entity)
811
return entityName;
912
}
1013
}
11-
}
14+
}

src/NHibernate.Test/DynamicEntity/Tuplizer/MyEntityInstantiator.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
namespace NHibernate.Test.DynamicEntity.Tuplizer
55
{
6+
[Obsolete("Require dynamic proxies")]
67
public class MyEntityInstantiator : IInstantiator
78
{
89
private readonly System.Type entityType;
@@ -53,4 +54,4 @@ public bool IsInstance(object obj)
5354
}
5455
}
5556
}
56-
}
57+
}

src/NHibernate.Test/DynamicEntity/Tuplizer/MyEntityTuplizer.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
using System;
12
using NHibernate.Mapping;
23
using NHibernate.Tuple.Entity;
34

45
namespace NHibernate.Test.DynamicEntity.Tuplizer
56
{
7+
[Obsolete("Require dynamic proxies")]
68
public class MyEntityTuplizer : PocoEntityTuplizer
79
{
810
public MyEntityTuplizer(EntityMetamodel entityMetamodel, PersistentClass mappedEntity) : base(entityMetamodel, mappedEntity) {}
@@ -21,4 +23,4 @@ protected override Proxy.IProxyFactory BuildProxyFactory(PersistentClass persist
2123
return base.BuildProxyFactory(persistentClass, idGetter, idSetter);
2224
}
2325
}
24-
}
26+
}

src/NHibernate.Test/DynamicEntity/Tuplizer/TuplizerDynamicEntity.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System;
12
using System.Collections;
23
using System.Collections.Generic;
34
using NHibernate.Cfg;
@@ -6,6 +7,7 @@
67
namespace NHibernate.Test.DynamicEntity.Tuplizer
78
{
89
[TestFixture]
10+
[Obsolete("Require dynamic proxies")]
911
public class TuplizerDynamicEntity : TestCase
1012
{
1113
protected override string MappingsAssembly
@@ -105,4 +107,4 @@ public void It()
105107
session.Close();
106108
}
107109
}
108-
}
110+
}

src/NHibernate.Test/DynamicProxyTests/GenericMethodsTests/GenericMethodShouldBeProxied.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
using System;
12
using NHibernate.Proxy.DynamicProxy;
23
using NUnit.Framework;
34

45
namespace NHibernate.Test.DynamicProxyTests.GenericMethodsTests
56
{
67
[TestFixture]
8+
[Obsolete]
79
public class GenericMethodShouldBeProxied
810
{
911
[Test]
@@ -244,4 +246,4 @@ public void GenericInterfaceConstraint()
244246
class MyDerivedClass : MyClass, IMyInterface
245247
{ }
246248
}
247-
}
249+
}

src/NHibernate.Test/DynamicProxyTests/InterfaceWithEqualsGethashcodeTests.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
using System;
12
using System.Collections.Generic;
23
using NHibernate.Proxy.DynamicProxy;
34
using NUnit.Framework;
45

56
namespace NHibernate.Test.DynamicProxyTests
67
{
78
[TestFixture]
9+
[Obsolete]
810
public class InterfaceWithEqualsGethashcodeTests
911
{
1012
public interface IMyBaseObject

src/NHibernate.Test/DynamicProxyTests/LazyFieldInterceptorTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
namespace NHibernate.Test.DynamicProxyTests
88
{
9+
[Obsolete]
910
public class LazyFieldInterceptorTests
1011
{
1112
[Serializable]

src/NHibernate.Test/DynamicProxyTests/PassThroughInterceptor.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
namespace NHibernate.Test.DynamicProxyTests
55
{
6+
[Obsolete]
67
public class PassThroughInterceptor : NHibernate.Proxy.DynamicProxy.IInterceptor
78
{
89
private readonly object targetInstance;
@@ -17,4 +18,4 @@ public object Intercept(InvocationInfo info)
1718
return info.TargetMethod.Invoke(targetInstance, info.Arguments);
1819
}
1920
}
20-
}
21+
}

src/NHibernate.Test/DynamicProxyTests/PeVerifyFixture.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
namespace NHibernate.Test.DynamicProxyTests
99
{
1010
[TestFixture]
11+
[Obsolete]
1112
public class PeVerifyFixture
1213
{
1314
private static bool wasCalled;

src/NHibernate.Test/DynamicProxyTests/ProxiedMembers/Fixture.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System;
12
using NHibernate.Proxy.DynamicProxy;
23
using NUnit.Framework;
34

@@ -27,6 +28,7 @@ public virtual void Method4(ref int? y)
2728
}
2829

2930
[TestFixture]
31+
[Obsolete]
3032
public class Fixture
3133
{
3234
[Test]

src/NHibernate.Test/DynamicProxyTests/ProxiedMembers/MetodWithRefDictionaryTest.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
using System;
12
using System.Collections.Generic;
23
using NHibernate.Proxy.DynamicProxy;
34
using NUnit.Framework;
45

56
namespace NHibernate.Test.DynamicProxyTests.ProxiedMembers
67
{
78
[TestFixture]
9+
[Obsolete]
810
public class MetodWithRefDictionaryTest
911
{
1012
public class MyClass

src/NHibernate.Test/NHSpecificTest/NH3954/EqualsFixture.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using System.Reflection;
33
using System.Runtime.Serialization;
44
using NHibernate.Proxy;
5-
using NHibernate.Proxy.DynamicProxy;
65
using NHibernate.Type;
76
using NUnit.Framework;
87

src/NHibernate.Test/NHSpecificTest/NH3954/ProxyCacheFixture.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
using NHibernate.Proxy;
66
using NHibernate.Proxy.DynamicProxy;
77
using NUnit.Framework;
8+
#pragma warning disable 618
9+
using ProxyCacheEntry = NHibernate.Proxy.DynamicProxy.ProxyCacheEntry;
10+
#pragma warning restore 618
811

912
namespace NHibernate.Test.NHSpecificTest.NH3954
1013
{

0 commit comments

Comments
 (0)