-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTestHarnessPredicate.java
413 lines (410 loc) · 17.8 KB
/
TestHarnessPredicate.java
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
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package TestHarness;
import Calculus.ConsoleColors;
import Calculus.UsageCalculus;
import org.apache.log4j.Logger;
/**
*
* @author Administrator
*/
public class TestHarnessPredicate {
public static Logger log = Logger.getLogger(TestHarnessPredicate.class.getName());
//Sanity Test Cases
public static void SanityTestCases(String AlgoName,int j){
switch(j){
case 100:
TestCase100();
break;
case 101:
TestCase101();
break;
case 102:
TestCase102();
break;
case 103:
TestCase103();
break;
case 104:
TestCase104();
break;
case 105:
TestCase105();
break;
case 106:
TestCase106();
break;
case 107:
TestCase107();
break;
default:
System.out.println(ConsoleColors.RED +"SanityTestCases TestCase:j= " + j + ": Gap" + ConsoleColors.RESET);
break;
}
}
//Sanity Test Cases
public static void UnitTestCases(String AlgoName,int j){
switch(j){
case 200:
TestCase200();
break;
case 201:
TestCase201();
break;
case 202:
TestCase202();
break;
case 203:
TestCase203();
break;
case 204:
TestCase204();
break;
case 205:
TestCase205();
break;
case 206:
TestCase206();
break;
case 207:
TestCase207();
break;
case 208:
TestCase208();
break;
case 209:
TestCase209();
break;
case 210:
TestCase210();
break;
case 211:
TestCase211();
break;
case 212:
TestCase212();
break;
case 213:
TestCase213();
break;
case 214:
TestCase214();
break;
case 215:
TestCase215();
break;
case 216:
TestCase216();
break;
case 217:
TestCase217();
break;
case 218:
TestCase218();
break;
case 219:
TestCase219();
break;
case 220:
TestCase220();
break;
case 221:
TestCase221();
break;
case 222:
TestCase222();
break;
case 223:
TestCase223();
break;
case 224:
TestCase224();
break;
case 225:
TestCase225();
break;
case 226:
TestCase226();
break;
case 227:
TestCase227();
break;
default:
System.out.println(ConsoleColors.RED +"UnitTestCases TestCase:j= " + j + ": Gap" + ConsoleColors.RESET);
break;
}
}
/* **************************************** */
//Structured Testing
/* **************************************** */
/* ********************************************** */
/* ***************Sanity Tests******************* */
/* ********************************************** */
/* ************** == , != , && , || Test Cases * */
public static void TestCase100() {
//Test Case 100
UsageCalculus.TestCase = 100;
UsageCalculus.UserTestPredicate = "( (x^2+y^2) >= 100 )";
UsageCalculus.TestCaseName = "Simple: Coefficients:0.0";
UsageCalculus.TestCaseMatrixID="Coefficients:0.0:1 Letter:* Operator:No Exponent Sign:Constant End:Term Sign +&-";
}
public static void TestCase101() {
//Test Case 101
UsageCalculus.TestCase = 101;
UsageCalculus.UserTestPredicate = "( (x==2)&& (y==2) )";
UsageCalculus.TestCaseName = "Simple: Coefficients:0.0";
UsageCalculus.TestCaseMatrixID="Coefficients:0.0:1 Letter:* Operator:No Exponent Sign:Constant End:Term Sign +&-";
}
public static void TestCase102() {
//Test Case 102
UsageCalculus.TestCase = 102;
UsageCalculus.UserTestPredicate = "( (x==2)|| (y==2) )";
UsageCalculus.TestCaseName = "Simple: Coefficients:0.0";
UsageCalculus.TestCaseMatrixID="Coefficients:0.0:1 Letter:* Operator:No Exponent Sign:Constant End:Term Sign +&-";
}
public static void TestCase103() {
//Test Case 103
UsageCalculus.TestCase = 103;
UsageCalculus.UserTestPredicate = "( (!(x==2))&& (!(y==2)) )";
UsageCalculus.TestCaseName = "Simple: Coefficients:0.0";
UsageCalculus.TestCaseMatrixID="Coefficients:0.0:1 Letter:* Operator:No Exponent Sign:Constant End:Term Sign +&-";
}
public static void TestCase104() {
//Test Case 104
UsageCalculus.TestCase = 104;
UsageCalculus.UserTestPredicate = "( (!(x==2))|| (!(y==2)) )";
UsageCalculus.TestCaseName = "Simple: Coefficients:0.0";
UsageCalculus.TestCaseMatrixID="Coefficients:0.0:1 Letter:* Operator:No Exponent Sign:Constant End:Term Sign +&-";
}
public static void TestCase105() {
//Test Case 105
UsageCalculus.TestCase = 105;
UsageCalculus.UserTestPredicate = "( (!(x==2))&& (!(y==2)) )";
UsageCalculus.TestCaseName = "Simple: Coefficients:0.0";
UsageCalculus.TestCaseMatrixID="Coefficients:0.0:1 Letter:* Operator:No Exponent Sign:Constant End:Term Sign +&-";
}
public static void TestCase106() {
//Test Case 106
UsageCalculus.TestCase = 106;
UsageCalculus.UserTestPredicate = "(((x!=2))&& ((y!=2)) )";
UsageCalculus.TestCaseName = "Simple: Coefficients:0.0";
UsageCalculus.TestCaseMatrixID="Coefficients:0.0:1 Letter:* Operator:No Exponent Sign:Constant End:Term Sign +&-";
}
public static void TestCase107() {
//Test Case 107
UsageCalculus.TestCase = 107;
UsageCalculus.UserTestPredicate = "((x!=2))|| ((y!=2)))";
UsageCalculus.TestCaseName = "Simple: Coefficients:0.0";
UsageCalculus.TestCaseMatrixID="Coefficients:0.0:1 Letter:* Operator:No Exponent Sign:Constant End:Term Sign +&-";
}
/* ********************************************** */
/* ************** >= , <= ,<,>,&& ,|| Test Cases */
/* ********************************************** */
public static void TestCase200() {
//Test Case 200
UsageCalculus.TestCase = 200;
UsageCalculus.UserTestPredicate = "( (x^2+y^2) > 100 )";
UsageCalculus.TestCaseName = "Simple: Coefficients:0.0";
UsageCalculus.TestCaseMatrixID="Coefficients:0.0:1 Letter:* Operator:No Exponent Sign:Constant End:Term Sign +&-";
}
public static void TestCase201() {
//Test Case 201
UsageCalculus.TestCase = 201;
UsageCalculus.UserTestPredicate = "( (x==2)&& (y==2) )";
UsageCalculus.TestCaseName = "Simple: Coefficients:0.0";
UsageCalculus.TestCaseMatrixID="Coefficients:0.0:1 Letter:* Operator:No Exponent Sign:Constant End:Term Sign +&-";
}
public static void TestCase202() {
//Test Case 202
UsageCalculus.TestCase = 202;
UsageCalculus.UserTestPredicate = "( (x==2)|| (y==2) )";
UsageCalculus.TestCaseName = "Simple: Coefficients:0.0";
UsageCalculus.TestCaseMatrixID="Coefficients:0.0:1 Letter:* Operator:No Exponent Sign:Constant End:Term Sign +&-";
}
public static void TestCase203() {
//Test Case 203
UsageCalculus.TestCase = 203;
UsageCalculus.UserTestPredicate = "( (!(x==2))&& (!(y==2)) )";
UsageCalculus.TestCaseName = "Simple: Coefficients:0.0";
UsageCalculus.TestCaseMatrixID="Coefficients:0.0:1 Letter:* Operator:No Exponent Sign:Constant End:Term Sign +&-";
}
public static void TestCase204() {
//Test Case 204
UsageCalculus.TestCase = 204;
UsageCalculus.UserTestPredicate = "( (!(x==2))|| (!(y==2)) )";
UsageCalculus.TestCaseName = "Simple: Coefficients:0.0";
UsageCalculus.TestCaseMatrixID="Coefficients:0.0:1 Letter:* Operator:No Exponent Sign:Constant End:Term Sign +&-";
}
public static void TestCase205() {
//Test Case 205
UsageCalculus.TestCase = 205;
UsageCalculus.UserTestPredicate = "( (!(x==2))&& (!(y==2)) )";
UsageCalculus.TestCaseName = "Simple: Coefficients:0.0";
UsageCalculus.TestCaseMatrixID="Coefficients:0.0:1 Letter:* Operator:No Exponent Sign:Constant End:Term Sign +&-";
}
public static void TestCase206() {
//Test Case 206
UsageCalculus.TestCase = 206;
UsageCalculus.UserTestPredicate = "(((x < 2))&& ((y > 2)) )";
UsageCalculus.TestCaseName = "Simple: Coefficients:0.0";
UsageCalculus.TestCaseMatrixID="Coefficients:0.0:1 Letter:* Operator:No Exponent Sign:Constant End:Term Sign +&-";
// Result(Logical Value)=Unknown @x==2, y==2
}
public static void TestCase207() {
//Test Case 207
UsageCalculus.TestCase = 207;
UsageCalculus.UserTestPredicate = "((x > 2))|| ((y < 2)))";
UsageCalculus.TestCaseName = "Simple: Coefficients:0.0";
UsageCalculus.TestCaseMatrixID="Coefficients:0.0:1 Letter:* Operator:No Exponent Sign:Constant End:Term Sign +&-";
// Result(Logical Value)=Unknown @x==2, y==2
}
public static void TestCase208() {
//Test Case 208
UsageCalculus.TestCase = 208;
UsageCalculus.UserTestPredicate = "((x > 2))|| ((y == 2)))";
UsageCalculus.TestCaseName = "Simple: Coefficients:0.0";
UsageCalculus.TestCaseMatrixID="Coefficients:0.0:1 Letter:* Operator:No Exponent Sign:Constant End:Term Sign +&-";
}
public static void TestCase209() {
//Test Case 209
UsageCalculus.TestCase = 209;
UsageCalculus.UserTestPredicate = "((x == 2))|| ((y < 2)))";
UsageCalculus.TestCaseName = "Simple: Coefficients:0.0";
UsageCalculus.TestCaseMatrixID="Coefficients:0.0:1 Letter:* Operator:No Exponent Sign:Constant End:Term Sign +&-";
}
public static void TestCase210() {
//Test Case 210
UsageCalculus.TestCase = 210;
UsageCalculus.UserTestPredicate = "((x > 2))|| ((y > 2)))";
UsageCalculus.TestCaseName = "Simple: Coefficients:0.0";
UsageCalculus.TestCaseMatrixID="Coefficients:0.0:1 Letter:* Operator:No Exponent Sign:Constant End:Term Sign +&-";
// Result(Logical Value)=Unknown @x==2, y==2
}
public static void TestCase211() {
//Test Case 211
UsageCalculus.TestCase = 211;
UsageCalculus.UserTestPredicate = "((x != 2))|| ((y != 2)))";
UsageCalculus.TestCaseName = "Simple: Coefficients:0.0";
UsageCalculus.TestCaseMatrixID="Coefficients:0.0:1 Letter:* Operator:No Exponent Sign:Constant End:Term Sign +&-";
}
public static void TestCase212() {
//Test Case 212
UsageCalculus.TestCase = 212;
UsageCalculus.UserTestPredicate = "((x != 2))&& ((y != 2)))";
UsageCalculus.TestCaseName = "Simple: Coefficients:0.0";
UsageCalculus.TestCaseMatrixID="Coefficients:0.0:1 Letter:* Operator:No Exponent Sign:Constant End:Term Sign +&-";
}
public static void TestCase213() {
//Test Case 213
UsageCalculus.TestCase = 213;
UsageCalculus.UserTestPredicate = "(!(x != 2))&& (!(y != 2)))";
UsageCalculus.TestCaseName = "Simple: Coefficients:0.0";
UsageCalculus.TestCaseMatrixID="Coefficients:0.0:1 Letter:* Operator:No Exponent Sign:Constant End:Term Sign +&-";
}
public static void TestCase214() {
//Test Case 214
UsageCalculus.TestCase = 214;
UsageCalculus.UserTestPredicate = "(!(x != 2))|| (!(y != 2)))";
UsageCalculus.TestCaseName = "Simple: Coefficients:0.0";
UsageCalculus.TestCaseMatrixID="Coefficients:0.0:1 Letter:* Operator:No Exponent Sign:Constant End:Term Sign +&-";
}
public static void TestCase215() {
//Test Case 215
UsageCalculus.TestCase = 215;
UsageCalculus.UserTestPredicate = "(!(x != 2))|| ((y > 2)))";
UsageCalculus.TestCaseName = "Simple: Coefficients:0.0";
UsageCalculus.TestCaseMatrixID="Coefficients:0.0:1 Letter:* Operator:No Exponent Sign:Constant End:Term Sign +&-";
}
public static void TestCase216() {
//Test Case 216
UsageCalculus.TestCase = 216;
UsageCalculus.UserTestPredicate = "(!(x != 2))&& ((y > 2)))";
UsageCalculus.TestCaseName = "Simple: Coefficients:0.0";
UsageCalculus.TestCaseMatrixID="Coefficients:0.0:1 Letter:* Operator:No Exponent Sign:Constant End:Term Sign +&-";
}
public static void TestCase217() {
//Test Case 217
UsageCalculus.TestCase = 217;
UsageCalculus.UserTestPredicate = "(!(x > 2))&& ((y > 2)))";
UsageCalculus.TestCaseName = "Simple: Coefficients:0.0";
UsageCalculus.TestCaseMatrixID="Coefficients:0.0:1 Letter:* Operator:No Exponent Sign:Constant End:Term Sign +&-";
// Result(Logical Value)=Unknown @x==2, y==2
}
public static void TestCase218() {
//Test Case 218
UsageCalculus.TestCase = 218;
UsageCalculus.UserTestPredicate = "(x > 2|| y > 2 )";
UsageCalculus.TestCaseName = "Simple: Coefficients:0.0";
UsageCalculus.TestCaseMatrixID="Coefficients:0.0:1 Letter:* Operator:No Exponent Sign:Constant End:Term Sign +&-";
// Result(Logical Value)=Unknown @x==2, y==2
}
public static void TestCase219() {
//Test Case 219
UsageCalculus.TestCase = 219;
UsageCalculus.UserTestPredicate = "(x != 2 || y != 2)";
UsageCalculus.TestCaseName = "Simple: Coefficients:0.0";
UsageCalculus.TestCaseMatrixID="Coefficients:0.0:1 Letter:* Operator:No Exponent Sign:Constant End:Term Sign +&-";
}
public static void TestCase220() {
//Test Case 220
UsageCalculus.TestCase = 220;
UsageCalculus.UserTestPredicate = "(x != 2 && y != 2 )";
UsageCalculus.TestCaseName = "Simple: Coefficients:0.0";
UsageCalculus.TestCaseMatrixID="Coefficients:0.0:1 Letter:* Operator:No Exponent Sign:Constant End:Term Sign +&-";
}
public static void TestCase221() {
//Test Case 221
UsageCalculus.TestCase = 221;
UsageCalculus.UserTestPredicate = "(!(x != 2)&& !(y != 2) )";
UsageCalculus.TestCaseName = "Simple: Coefficients:0.0";
UsageCalculus.TestCaseMatrixID="Coefficients:0.0:1 Letter:* Operator:No Exponent Sign:Constant End:Term Sign +&-";
}
public static void TestCase222() {
//Test Case 222
UsageCalculus.TestCase = 222;
UsageCalculus.UserTestPredicate = "(!(x != 2)|| y != 2)";
UsageCalculus.TestCaseName = "Simple: Coefficients:0.0";
UsageCalculus.TestCaseMatrixID="Coefficients:0.0:1 Letter:* Operator:No Exponent Sign:Constant End:Term Sign +&-";
}
public static void TestCase223() {
//Test Case 223
UsageCalculus.TestCase = 223;
UsageCalculus.UserTestPredicate = "(!(x != 2))|| y > 2";
UsageCalculus.TestCaseName = "Simple: Coefficients:0.0";
UsageCalculus.TestCaseMatrixID="Coefficients:0.0:1 Letter:* Operator:No Exponent Sign:Constant End:Term Sign +&-";
}
public static void TestCase224() {
//Test Case 224
UsageCalculus.TestCase = 224;
UsageCalculus.UserTestPredicate = "(!(x != 2))&& y > 2";
UsageCalculus.TestCaseName = "Simple: Coefficients:0.0";
UsageCalculus.TestCaseMatrixID="Coefficients:0.0:1 Letter:* Operator:No Exponent Sign:Constant End:Term Sign +&-";
}
public static void TestCase225() {
//Test Case 225
UsageCalculus.TestCase = 225;
UsageCalculus.UserTestPredicate = "(!(x > 2))&& y > 2 ";
UsageCalculus.TestCaseName = "Simple: Coefficients:0.0";
UsageCalculus.TestCaseMatrixID="Coefficients:0.0:1 Letter:* Operator:No Exponent Sign:Constant End:Term Sign +&-";
// Result(Logical Value)=Unknown @x==2, y==2
}
public static void TestCase226() {
//Test Case 226
UsageCalculus.TestCase = 226;
UsageCalculus.UserTestPredicate = "((x^2+y^2 < 900) && ( y==(x+1)) )";
UsageCalculus.TestCaseName = "Simple: State Transition:";
UsageCalculus.TestCaseMatrixID="Coefficients:0.0:1 Letter:* Operator:No Exponent Sign:Constant End:Term Sign +&-";
// Result(Logical Value)=Unknown @x==2, y==2
}
public static void TestCase227() {
//Test Case 227
UsageCalculus.TestCase = 227;
UsageCalculus.UserTestPredicate = "((x%4==2)&&(y%4==2) )";
UsageCalculus.TestCaseName = "Simple: State Transition:";
UsageCalculus.TestCaseMatrixID="Coefficients:0.0:1 Letter:* Operator:No Exponent Sign:Constant End:Term Sign +&-";
// Result(Logical Value)=Unknown @x==2, y==2
}
}