-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathMultiInterface_TI_LZ_Runner.cs
266 lines (219 loc) · 12.6 KB
/
MultiInterface_TI_LZ_Runner.cs
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
using System;
using System.Threading.Tasks;
using Xunit;
using Xunit.Abstractions;
using Orleans.Indexing.Facet;
using System.Collections.Generic;
namespace Orleans.Indexing.Tests.MultiInterface
{
#region PartitionedPerKey
public class FT_Props_Person_TI_LZ_PK : IPersonProperties
{
[Index(typeof(TotalHashIndexPartitionedPerKey<string, IFT_Grain_Person_TI_LZ_PK>), IsEager = false, IsUnique = true)]
public string Name { get; set; }
[Index(typeof(TotalHashIndexPartitionedPerKey<int, IFT_Grain_Person_TI_LZ_PK>), IsEager = false, IsUnique = false, NullValue = "0")]
public int Age { get; set; }
}
public class NFT_Props_Person_TI_LZ_PK : IPersonProperties
{
[Index(typeof(TotalHashIndexPartitionedPerKey<string, INFT_Grain_Person_TI_LZ_PK>), IsEager = false, IsUnique = true)]
public string Name { get; set; }
[Index(typeof(TotalHashIndexPartitionedPerKey<int, INFT_Grain_Person_TI_LZ_PK>), IsEager = false, IsUnique = false, NullValue = "0")]
public int Age { get; set; }
}
public class FT_Props_Job_TI_LZ_PK : IJobProperties
{
[Index(typeof(TotalHashIndexPartitionedPerKey<string, IFT_Grain_Job_TI_LZ_PK>), IsEager = false, IsUnique = true)]
public string Title { get; set; }
[Index(typeof(TotalHashIndexPartitionedPerKey<string, IFT_Grain_Job_TI_LZ_PK>), IsEager = false, IsUnique = false)]
public string Department { get; set; }
}
public class NFT_Props_Job_TI_LZ_PK : IJobProperties
{
[Index(typeof(TotalHashIndexPartitionedPerKey<string, INFT_Grain_Job_TI_LZ_PK>), IsEager = false, IsUnique = true)]
public string Title { get; set; }
[Index(typeof(TotalHashIndexPartitionedPerKey<string, INFT_Grain_Job_TI_LZ_PK>), IsEager = false, IsUnique = false)]
public string Department { get; set; }
}
public class FT_Props_Employee_TI_LZ_PK : IEmployeeProperties
{
[Index(typeof(TotalHashIndexPartitionedPerKey<int, IFT_Grain_Employee_TI_LZ_PK>), IsEager = false, IsUnique = true, NullValue = "-1")]
public int EmployeeId { get; set; }
}
public class NFT_Props_Employee_TI_LZ_PK : IEmployeeProperties
{
[Index(typeof(TotalHashIndexPartitionedPerKey<int, INFT_Grain_Employee_TI_LZ_PK>), IsEager = false, IsUnique = true, NullValue = "-1")]
public int EmployeeId { get; set; }
}
public interface IFT_Grain_Person_TI_LZ_PK : IIndexableGrain<FT_Props_Person_TI_LZ_PK>, IPersonGrain, IGrainWithIntegerKey
{
}
public interface INFT_Grain_Person_TI_LZ_PK : IIndexableGrain<NFT_Props_Person_TI_LZ_PK>, IPersonGrain, IGrainWithIntegerKey
{
}
public interface IFT_Grain_Job_TI_LZ_PK : IIndexableGrain<FT_Props_Job_TI_LZ_PK>, IJobGrain, IGrainWithIntegerKey
{
}
public interface INFT_Grain_Job_TI_LZ_PK : IIndexableGrain<NFT_Props_Job_TI_LZ_PK>, IJobGrain, IGrainWithIntegerKey
{
}
public interface IFT_Grain_Employee_TI_LZ_PK : IIndexableGrain<FT_Props_Employee_TI_LZ_PK>, IEmployeeGrain, IGrainWithIntegerKey
{
}
public interface INFT_Grain_Employee_TI_LZ_PK : IIndexableGrain<NFT_Props_Employee_TI_LZ_PK>, IEmployeeGrain, IGrainWithIntegerKey
{
}
public class FT_Grain_Employee_TI_LZ_PK : TestEmployeeGrain<EmployeeGrainState>,
IFT_Grain_Person_TI_LZ_PK, IFT_Grain_Job_TI_LZ_PK, IFT_Grain_Employee_TI_LZ_PK
{
public FT_Grain_Employee_TI_LZ_PK(
[FaultTolerantWorkflowIndexedState(IndexingConstants.IndexedGrainStateName, IndexingConstants.MEMORY_STORAGE_PROVIDER_NAME)]
IIndexedState<EmployeeGrainState> indexedState)
: base(indexedState) { }
}
public class NFT_Grain_Employee_TI_LZ_PK : TestEmployeeGrain<EmployeeGrainState>,
INFT_Grain_Person_TI_LZ_PK, INFT_Grain_Job_TI_LZ_PK, INFT_Grain_Employee_TI_LZ_PK
{
public NFT_Grain_Employee_TI_LZ_PK(
[NonFaultTolerantWorkflowIndexedState(IndexingConstants.IndexedGrainStateName, IndexingConstants.MEMORY_STORAGE_PROVIDER_NAME)]
IIndexedState<EmployeeGrainState> indexedState)
: base(indexedState) { }
}
#endregion // PartitionedPerKey
#region PartitionedPerSilo
// None; Total indexes cannot be specified as partitioned per silo.
#endregion // PartitionedPerSilo
#region SingleBucket
public class FT_Props_Person_TI_LZ_SB : IPersonProperties
{
[Index(typeof(ITotalHashIndexSingleBucket<string, IFT_Grain_Person_TI_LZ_SB>), IsEager = false, IsUnique = true)]
public string Name { get; set; }
[Index(typeof(ITotalHashIndexSingleBucket<int, IFT_Grain_Person_TI_LZ_SB>), IsEager = false, IsUnique = false, NullValue = "0")]
public int Age { get; set; }
}
public class NFT_Props_Person_TI_LZ_SB : IPersonProperties
{
[Index(typeof(ITotalHashIndexSingleBucket<string, INFT_Grain_Person_TI_LZ_SB>), IsEager = false, IsUnique = true)]
public string Name { get; set; }
[Index(typeof(ITotalHashIndexSingleBucket<int, INFT_Grain_Person_TI_LZ_SB>), IsEager = false, IsUnique = false, NullValue = "0")]
public int Age { get; set; }
}
public class FT_Props_Job_TI_LZ_SB : IJobProperties
{
[Index(typeof(ITotalHashIndexSingleBucket<string, IFT_Grain_Job_TI_LZ_SB>), IsEager = false, IsUnique = true)]
public string Title { get; set; }
[Index(typeof(ITotalHashIndexSingleBucket<string, IFT_Grain_Job_TI_LZ_SB>), IsEager = false, IsUnique = false)]
public string Department { get; set; }
}
public class NFT_Props_Job_TI_LZ_SB : IJobProperties
{
[Index(typeof(ITotalHashIndexSingleBucket<string, INFT_Grain_Job_TI_LZ_SB>), IsEager = false, IsUnique = true)]
public string Title { get; set; }
[Index(typeof(ITotalHashIndexSingleBucket<string, INFT_Grain_Job_TI_LZ_SB>), IsEager = false, IsUnique = false)]
public string Department { get; set; }
}
public class FT_Props_Employee_TI_LZ_SB : IEmployeeProperties
{
[Index(typeof(ITotalHashIndexSingleBucket<int, IFT_Grain_Employee_TI_LZ_SB>), IsEager = false, IsUnique = true, NullValue = "-1")]
public int EmployeeId { get; set; }
}
public class NFT_Props_Employee_TI_LZ_SB : IEmployeeProperties
{
[Index(typeof(ITotalHashIndexSingleBucket<int, INFT_Grain_Employee_TI_LZ_SB>), IsEager = false, IsUnique = true, NullValue = "-1")]
public int EmployeeId { get; set; }
}
public interface IFT_Grain_Person_TI_LZ_SB : IIndexableGrain<FT_Props_Person_TI_LZ_SB>, IPersonGrain, IGrainWithIntegerKey
{
}
public interface INFT_Grain_Person_TI_LZ_SB : IIndexableGrain<NFT_Props_Person_TI_LZ_SB>, IPersonGrain, IGrainWithIntegerKey
{
}
public interface IFT_Grain_Job_TI_LZ_SB : IIndexableGrain<FT_Props_Job_TI_LZ_SB>, IJobGrain, IGrainWithIntegerKey
{
}
public interface INFT_Grain_Job_TI_LZ_SB : IIndexableGrain<NFT_Props_Job_TI_LZ_SB>, IJobGrain, IGrainWithIntegerKey
{
}
public interface IFT_Grain_Employee_TI_LZ_SB : IIndexableGrain<FT_Props_Employee_TI_LZ_SB>, IEmployeeGrain, IGrainWithIntegerKey
{
}
public interface INFT_Grain_Employee_TI_LZ_SB : IIndexableGrain<NFT_Props_Employee_TI_LZ_SB>, IEmployeeGrain, IGrainWithIntegerKey
{
}
public class FT_Grain_Employee_TI_LZ_SB : TestEmployeeGrain<EmployeeGrainState>,
IFT_Grain_Person_TI_LZ_SB, IFT_Grain_Job_TI_LZ_SB, IFT_Grain_Employee_TI_LZ_SB
{
public FT_Grain_Employee_TI_LZ_SB(
[FaultTolerantWorkflowIndexedState(IndexingConstants.IndexedGrainStateName, IndexingConstants.MEMORY_STORAGE_PROVIDER_NAME)]
IIndexedState<EmployeeGrainState> indexedState)
: base(indexedState) { }
}
public class NFT_Grain_Employee_TI_LZ_SB : TestEmployeeGrain<EmployeeGrainState>,
INFT_Grain_Person_TI_LZ_SB, INFT_Grain_Job_TI_LZ_SB, INFT_Grain_Employee_TI_LZ_SB
{
public NFT_Grain_Employee_TI_LZ_SB(
[NonFaultTolerantWorkflowIndexedState(IndexingConstants.IndexedGrainStateName, IndexingConstants.MEMORY_STORAGE_PROVIDER_NAME)]
IIndexedState<EmployeeGrainState> indexedState)
: base(indexedState) { }
}
#endregion // SingleBucket
public abstract class MultiInterface_TI_LZ_Runner : IndexingTestRunnerBase
{
protected MultiInterface_TI_LZ_Runner(BaseIndexingFixture fixture, ITestOutputHelper output)
: base(fixture, output)
{
}
[Fact, TestCategory("BVT"), TestCategory("Indexing")]
public async Task Test_FT_Grain_Employee_TI_LZ_PK()
{
await base.TestEmployeeIndexesWithDeactivations<IFT_Grain_Person_TI_LZ_PK, FT_Props_Person_TI_LZ_PK,
IFT_Grain_Job_TI_LZ_PK, FT_Props_Job_TI_LZ_PK,
IFT_Grain_Employee_TI_LZ_PK, FT_Props_Employee_TI_LZ_PK>();
}
[Fact, TestCategory("BVT"), TestCategory("Indexing")]
public async Task Test_NFT_Grain_Employee_TI_LZ_PK()
{
await base.TestEmployeeIndexesWithDeactivations<INFT_Grain_Person_TI_LZ_PK, NFT_Props_Person_TI_LZ_PK,
INFT_Grain_Job_TI_LZ_PK, NFT_Props_Job_TI_LZ_PK,
INFT_Grain_Employee_TI_LZ_PK, NFT_Props_Employee_TI_LZ_PK>();
}
[Fact, TestCategory("BVT"), TestCategory("Indexing")]
public async Task Test_FT_Grain_Employee_TI_LZ_SB()
{
await base.TestEmployeeIndexesWithDeactivations<IFT_Grain_Person_TI_LZ_SB, FT_Props_Person_TI_LZ_SB,
IFT_Grain_Job_TI_LZ_SB, FT_Props_Job_TI_LZ_SB,
IFT_Grain_Employee_TI_LZ_SB, FT_Props_Employee_TI_LZ_SB>();
}
[Fact, TestCategory("BVT"), TestCategory("Indexing")]
public async Task Test_NFT_Grain_Employee_TI_LZ_SB()
{
await base.TestEmployeeIndexesWithDeactivations<INFT_Grain_Person_TI_LZ_SB, NFT_Props_Person_TI_LZ_SB,
INFT_Grain_Job_TI_LZ_SB, NFT_Props_Job_TI_LZ_SB,
INFT_Grain_Employee_TI_LZ_SB, NFT_Props_Employee_TI_LZ_SB>();
}
internal static IEnumerable<Func<IndexingTestRunnerBase, int, Task>> GetAllTestTasks(TestIndexPartitionType testIndexTypes)
{
if (testIndexTypes.HasFlag(TestIndexPartitionType.PerKeyHash))
{
yield return (baseRunner, intAdjust) => baseRunner.TestEmployeeIndexesWithDeactivations<
IFT_Grain_Person_TI_LZ_PK, FT_Props_Person_TI_LZ_PK,
IFT_Grain_Job_TI_LZ_PK, FT_Props_Job_TI_LZ_PK,
IFT_Grain_Employee_TI_LZ_PK, FT_Props_Employee_TI_LZ_PK>(intAdjust);
yield return (baseRunner, intAdjust) => baseRunner.TestEmployeeIndexesWithDeactivations<
INFT_Grain_Person_TI_LZ_PK, NFT_Props_Person_TI_LZ_PK,
INFT_Grain_Job_TI_LZ_PK, NFT_Props_Job_TI_LZ_PK,
INFT_Grain_Employee_TI_LZ_PK, NFT_Props_Employee_TI_LZ_PK>(intAdjust);
}
if (testIndexTypes.HasFlag(TestIndexPartitionType.SingleBucket)) {
yield return (baseRunner, intAdjust) => baseRunner.TestEmployeeIndexesWithDeactivations<
IFT_Grain_Person_TI_LZ_SB, FT_Props_Person_TI_LZ_SB,
IFT_Grain_Job_TI_LZ_SB, FT_Props_Job_TI_LZ_SB,
IFT_Grain_Employee_TI_LZ_SB, FT_Props_Employee_TI_LZ_SB>(intAdjust);
yield return (baseRunner, intAdjust) => baseRunner.TestEmployeeIndexesWithDeactivations<
INFT_Grain_Person_TI_LZ_SB, NFT_Props_Person_TI_LZ_SB,
INFT_Grain_Job_TI_LZ_SB, NFT_Props_Job_TI_LZ_SB,
INFT_Grain_Employee_TI_LZ_SB, NFT_Props_Employee_TI_LZ_SB>(intAdjust);
}
}
}
}