-
Notifications
You must be signed in to change notification settings - Fork 0
/
PowerBatchSuit.cs
103 lines (83 loc) · 3.33 KB
/
PowerBatchSuit.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
/// <summary>
/// Created and maintained By Jalal Derakhshani
/// 2021
/// </summary>
class PowerBatchSuit
{
#define.SleepEnough(70000)
}
private static Set checkReponse(Map _guidOfBatchGroupId, Map _expectedOutputOfGuid)
{
LogOnDBWebServiceBus logOnDBWebServiceBus;
MapEnumerator guidEnumerator = _guidOfBatchGroupId.getEnumerator();
MapEnumerator resultsEnumerator = _expectedOutputOfGuid.getEnumerator();
guid currentGuid, resultGuid;
str currentResult;
BatchGroupId currentBatchGroupId;
Set ret = new Set(Types::String);
while(guidEnumerator.moveNext())
{
currentBatchGroupId = guidEnumerator.currentKey();
currentGuid = guidEnumerator.currentValue();
select * from logOnDBWebServiceBus where logOnDBWebServiceBus.TrackGuid == currentGuid;
while(resultsEnumerator.moveNext())
{
resultGuid = resultsEnumerator.currentKey();
if(currentGuid == resultGuid)
{
currentResult = resultsEnumerator.currentValue();
if(logOnDBWebServiceBus.RecId && logOnDBWebServiceBus.Message == currentResult)
ret.add(currentBatchGroupId);
}
}
}
return ret;
}
public static Set getAllBatchGroupsList()
{
BatchGroup batchGroup;
Set ret = new Set(Types::String);
while select *
from batchGroup group by batchGroup.Group
{
ret.add(batchGroup.Group);
}
return ret;
}
public static Set getResponsiveBatchGroupsList()
{
BatchGroup batchGroup;
Set ret = new Set(Types::String);
PowerBatchSuit_SampleTaskController runTaskController;
PowerBatchSuit_SampleTaskDC runTaskDataContract;
BatchGroupId currentBatchGroupId;
guid tGuid;
int inputA;
int inputB;
int correctResult;
Map guidOfBatchGroupId = new Map(Types::String, Types::Guid);
Map expectedOutputOfGuid = new Map(Types::Guid, Types::String);
;
while select *
from batchGroup group by batchGroup.Group
{
inputA = RandomGenerate::construct().randomInt(1, 9);
inputB = RandomGenerate::construct().randomInt(10, 90);
correctResult = inputA * inputB;
tGuid = newGuid();
currentBatchGroupId = batchGroup.Group;
runTaskController = new PowerBatchSuit_SampleTaskController();
runTaskController.parmReliableAsyncBatchGroupId(currentBatchGroupId);
runTaskDataContract = runTaskController.getDataContractObject();
runTaskDataContract.parmInputNumA(inputA);
runTaskDataContract.parmInputNumB(inputB);
runTaskDataContract.parmTGuid(tGuid);
guidOfBatchGroupId.insert(currentBatchGroupId, tGuid);
expectedOutputOfGuid.insert(tGuid, correctResult);
runTaskController.run();
}
sleep(#SleepEnough);
ret = PowerBatchSuit::checkReponse(guidOfBatchGroupId, expectedOutputOfGuid);
return ret;
}