This repository has been archived by the owner on Dec 14, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DYNPROXY-94.xml
140 lines (133 loc) · 4.73 KB
/
DYNPROXY-94.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<?xml version="1.0" encoding="utf-8"?>
<issues>
<issue>
<field name="Priority">
<value>Major</value>
</field>
<field name="Type">
<value>Bug</value>
</field>
<field name="State">
<value>Fixed</value>
</field>
<field name="Assignee" />
<field name="Subsystem">
<value>Core</value>
</field>
<field name="Fix versions">
<value>2.2</value>
</field>
<field name="Affected versions" />
<field name="Fixed in build" />
<field name="numberInProject">
<value>94</value>
</field>
<field name="summary">
<value>CreateProxyWithTarget fails if you use ProxyGenerationHook</value>
</field>
<field name="description">
<value>//Version is 2.1.0.0
//Run the test
//Test related
public interface ITask
{
void doStart();
string Definition { get; set; }
}
public class Task : ITask
{
public void doStart() {}
public string Definition { get;set; }
}
public class TaskInterceptor : IInterceptor
{
public void Intercept(IInvocation invocation)
{
invocation.Proceed();
}
}
class TaskProxyGenerationHook : IProxyGenerationHook
{
public bool ShouldInterceptMethod(Type type, MethodInfo memberInfo)
{
return memberInfo.Name.Equals("doStart", StringComparison.Ordinal);
}
public void NonVirtualMemberNotification(Type type, MemberInfo memberInfo) {}
public void MethodsInspected() {}
}
class TaskInterceptorSelector : IInterceptorSelector
{
public IInterceptor[] SelectInterceptors(Type type, MethodInfo method,
IInterceptor[] interceptors)
{
if (method.Name.Equals("doStart", StringComparison.Ordinal))
{
return interceptors;
}
return null;
}
}
//Test
[TestFixture]
public class CreateProxy_Test
{
[Test]
public void createproxywithtarget_and_options_using_hook_shouldnotthrow()
{
ITask pResult = new Task();
IInterceptor pInterceptor = new TaskInterceptor();
ProxyGenerator pGen = new ProxyGenerator();
ProxyGenerationOptions pGenOptions = new ProxyGenerationOptions(
new TaskProxyGenerationHook());
Assert.DoesNotThrow(delegate
{
pResult =
pGen.CreateInterfaceProxyWithTarget<ITask>
(pResult,pGenOptions, pInterceptor);
});
}
[Test]
public void createproxywithtarget_and_options_using_selector_shouldnotthrow()
{
ITask pResult = new Task();
IInterceptor pInterceptor = new TaskInterceptor();
ProxyGenerator pGen = new ProxyGenerator();
ProxyGenerationOptions pGenOptions = new ProxyGenerationOptions()
{ Selector = new TaskInterceptorSelector() };
Assert.DoesNotThrow(delegate
{
pResult =
pGen.CreateInterfaceProxyWithTarget<ITask>
(pResult, pGenOptions, pInterceptor);
});
}
}
</value>
</field>
<field name="created">
<value>1245288342000</value>
</field>
<field name="updated">
<value>1256535979000</value>
</field>
<field name="reporterName">
<value>Belvasis</value>
</field>
<field name="updaterName">
<value>Belvasis</value>
</field>
<field name="resolved">
<value>1256535960000</value>
</field>
<field name="permittedGroup">
<value>All Users</value>
</field>
<comment author="Belvasis" text="It's my first time using donjon so sorry for putting the source in the issue description :-) I attached the source files and you can see the behaviour in the attached png." created="1245288662000" />
<comment author="xtoff" text="Fixed in 6261" created="1256535973000" />
<comment author="Belvasis" text="* '''Attachment''' CreateProxy_Test_Related.cs added.
" created="1245288420000" />
<comment author="Belvasis" text="* '''Attachment''' CreateProxy_Test.cs added.
" created="1245288420000" />
<comment author="Belvasis" text="* '''Attachment''' CreateProxyWithTargetTest.png added.
" created="1245288540000" />
<comment author="xtoff" text="* '''Resolution''' set to ''Fixed''.
* '''Version Fixed''' set to ''2.2''.
* '''Status''' changed from ''Open'' to ''Resolved''.
" created="1256535960000" />
<comment author="xtoff" text="* '''Status''' changed from ''Resolved'' to ''Closed''.
" created="1256535960000" />
</issue>
</issues>