-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathjw06.yml
710 lines (630 loc) · 17.7 KB
/
jw06.yml
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
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
name: crclz's jw06 commandline test data
# warn:
data:
# 1. SUDO模式测试
- SUDO
# nc测试:nc cid(满足..正则) cname(英文数字) teachers(教师号(5位)列表,需要满足号码合法+列表解析无误) capacity(>=0)
# 课程号非法
-
- nc hh12345678 oop6324 [10086,10001] 1 [1-16]2,3
- Course add illegal.
-
- nc bh1234567 oop6324 [10086,10001] 1 [1-16]2,3
- Course add illegal.
-
- nc bhP2345678 oop6324 [10086,10001] 1 [1-16]2,3
- Course add illegal.
# 课程名非法
-
- nc bh12345678 oop_6324 [10086,10001] 1 [1-16]2,3
- Course add illegal.
# 教师列表格式错误
-
- nc bh12345678 oop6324 [ 1 [5-5]5,5
- Input illegal.
-
- nc bh12345678 oop6324 ] 1 [5-5]5,5
- Input illegal.
-
- nc bh12345678 oop6324 []] 1 [5-5]5,5
- Input illegal.
-
- nc bh12345678 oop6324 [[,]] 1 [5-5]5,5
- Input illegal.
# 有争议
# -
# - nc bh12345678 oop6324 [,] 1 [5-5]5,5
# - Input illegal.
# -
# - nc bh12345678 oop6324 [10086,,10001] 1 [5-5]5,5
# - Input illegal.
# -
# - nc bh12345678 oop6324 [10086,10001,] 1 [5-5]5,5
# - Input illegal.
# 上课时间格式错误
-
- nc bh12345600 oop6324 [10001] 6 [5-5]5,
- Input illegal.
-
- nc bh12345600 oop6324 [10001] 6 [5-5],
- Input illegal.
-
- nc bh12345600 oop6324 [10001] 6 [
- Input illegal.
-
- nc bh12345600 oop6324 [10001] 6 [5-5]]5,5
- Input illegal.
-
- nc bh12345600 oop6324 [10001] 6 [5--5]5,5
- Input illegal.
-
- nc bh12345600 oop6324 [10001] 6 [5--5]5,5
- Input illegal.
-
- nc bh12345600 oop6324 [10001] 6 [5-5]5,5[6-6]6,6
- Input illegal.
-
- nc bh12345600 oop6324 [10001] 6 5,5[5-5]5,5
- Input illegal.
-
- nc bh12345600 oop6324 [10001] 6 5,5[5-5]
- Input illegal.
-
- nc bh12345600 oop6324 [10001] 6 [55]5,5
- Input illegal.
-
- nc bh12345600 oop6324 [10001] 6 [5-]5,5
- Input illegal.
-
- nc bh12345600 oop6324 [10001] 6 [-5]5,5
- Input illegal.
# 教师列表教师号非法
-
- nc bh12345678 oop6324 [10086,100012] 1 [1-16]2,3
- Course add illegal.
-
- nc bh12345678 oop6324 [10086,1000q] 1 [1-16]2,3
- Course add illegal.
-
- nc bh12345678 oop6324 [10001,10002,10001] 1 [1-16]2,3 # 有两个10001
- Course add illegal.
# 课程容量非法
-
- nc bh12345678 oop6324 [10086,10001] -1 [1-16]2,3
- Course add illegal.
# 课程时间非法
-
- nc bh12345678 oop6324 [10086,10001] 100 [0-2]2,3
- Course add illegal.
-
- nc bh12345678 oop6324 [10086,10001] 100 [17-19]2,3
- Course add illegal.
-
- nc bh12345678 oop6324 [10086,10001] 100 [4-3]2,3
- Course add illegal.
-
- nc bh12345678 oop6324 [10086,10001] 100 [3-4]0,3
- Course add illegal.
-
- nc bh12345678 oop6324 [10086,10001] 100 [3-4]8,3
- Course add illegal.
-
- nc bh12345678 oop6324 [10086,10001] 100 [3-4]8,0
- Course add illegal.
-
- nc bh12345678 oop6324 [10086,10001] 100 [3-4]8,11
- Course add illegal.
# 合法数据插入计划:
# 课程:bh00000000 ~ bh0000006 共7门课
# 教师:10001 10002 10003(均有对应教师);10086(不插入教师记录)
# 学生:18370000 18370001 18370002 18370003 18370004 18370005 18370006 共7名学生
# nc 注意,成功的话不需要输出任何东西。
- nc bh00000000 oop6324 [10086,10001] 0 [1-1]1,5 # =================================== course 0
- nc bh00000004 oop6328 [10001,10002] 100 [11-18]1,5 # ================================ course 4
- nc bh00000002 oop6326 [10001,10002,10086] 100 [1-10]1,5 # ================================== course 2
- nc bh00000001 oop6325 [10001] 1 [1-1]1,5 # ===================================== course 1
- nc bh00000006 oop6330 [10001,10002] 100 [1-1]1,1 # ================================ course 6
- nc bh00000005 oop6329 [10001,10002] 100 [1-18]1,6 # ================================ course 5
- nc bh00000003 oop6327 [10001,10002,10003] 100 [6-6]1,5 # ================================ course 3
# 按计划添加教师信息
-
- np -t A 110101199003078670 10001 # =========================================== teacher A 10001
- Add teacher success.
-
- np -t B 110101199003075234 10002 # =========================================== teacher B 10002
- Add teacher success.
-
- np -t C 110101199003075736 10003 # =========================================== teacher C 10003
- Add teacher success.
# 按计划添加学生信息
-
- np -s studa 110101199003075736 18370000 # 和教师10003身份证重复
- ID exists.
-
- np -s studa 110101201103079910 18370000 # ==================================== student studa 18370000
- Add student success.
-
- np -s studb 110101201103071134 18370001 # ==================================== student studb 18370001
- Add student success.
-
- np -s studc 110101201103072057 18370002 # ==================================== student studc 18370002
- Add student success.
-
- np -s studd 110101201103077958 18370003 # ==================================== student studd 18370003
- Add student success.
-
- np -s stude 110101201103078053 18370004 # ==================================== student stude 18370004
- Add student success.
-
- np -s studf 110101201103075178 18370005 # ==================================== student studf 18370005
- Add student success.
-
- np -s studg 110101201103070553 18370006 # ==================================== student studg 18370006
- Add student success.
# 判断顺序测试 存在性 > input-illegal > course-add-illegal
# 存在性: 课程号码已经存在
# input-illegal: 缺少参数、错参数(这儿没有)、int解析错误、教师列表格式错误、上课时间格式错误
# TODO: 缺少参数
# course-add-illegal: 上课时间错误、教师号非法、课程名中含有除英⽂字⺟和数字以外的字符、负数容量
-
- nc bh00000000 oop_6324 [10086,10001,a00] -100 [a-b],c
- Course exists.
-
- nc bh33333333 oop_6324 [10086,10001,a00] CAPACITY [x-y]n,m
- Input illegal.
# 接下来几个输入输出用于:只有上课时间错误
-
- nc bh33333333 oop3333 [10086,10001] 100 [18-19]1,1
- Course add illegal.
-
- nc bh33333333 oop3333 [10086,10001] 100 [0-1]1,1
- Course add illegal.
-
- nc bh33333333 oop3333 [10086,10001] 100 [1-2]0,1
- Course add illegal.
-
- nc bh33333333 oop3333 [10086,10001] 100 [1-2]8,1
- Course add illegal.
-
- nc bh33333333 oop3333 [10086,10001] 100 [1-2]1,0
- Course add illegal.
-
- nc bh33333333 oop3333 [10086,10001] 100 [1-2]1,11
- Course add illegal.
-
- nc bh33333333 oop3333 [10086,10001] 100 [3-2]1,1 # x<=y
- Course add illegal.
# 教师号非法 only
-
- nc bh33333333 oop3333 [10086,a1] 100 [1-2]1,1 # x<=y
- Course add illegal.
# 课程名中含有除英⽂字⺟和数字以外的字符 only
-
- nc bh33333333 oop@3333 [10001] 100 [1-2]1,1 # x<=y
- Course add illegal.
# 修改课程名称。为了参照方便(只需要看那一长串=====),修改课程后,检测完,还是会修改回去。
-
- udc bh00000222 -n oop_6 # 这里隐含了判断顺序
- Course does not exist.
-
- udc bh00000000 -n oop_6
- Update fail.
-
- udc bh00000000 -n oop6
- Update success.
# 检查修改结果。注意,SUDO没有gc权限,这个要求很搞人。
- back
-
- login -t 110101199003078670 a12345
- Login success.
-
- gc -id bh00000000
- CID:bh00000000,Name:oop6,Teachers:[A,10086],Capacity:0/0,Time:[1-1]1,5
- back
- SUDO # 切回去
-
- udc bh00000000 -n oop6324 # 改回去
- Update success.
# 检查
- back
-
- login -t 110101199003078670 a12345
- Login success.
-
- gc -id bh00000000
- CID:bh00000000,Name:oop6324,Teachers:[A,10086],Capacity:0/0,Time:[1-1]1,5
- back
- SUDO
# 修改课程容量。检测完后改回去。
-
- udc bh00000222 -c Integer # 优先顺序
- Course does not exist.
-
- udc bh00000222 -c -100 # 优先顺序
- Course does not exist.
-
- udc bh00000000 -c abcdefg
- Input illegal. # 拥有仅次于存在性判断的优先级
-
- udc bh00000000 -c -2000
- Update fail.
-
- udc bh00000001 -c 10
- Update success.
# 查询看看修改结果
- back
-
- login -t 110101199003078670 a12345
- Login success.
-
- gc -id bh00000001
- CID:bh00000001,Name:oop6325,Teachers:[A],Capacity:0/10,Time:[1-1]1,5
- back
- SUDO
-
- udc bh00000001 -c 1 # 改回去
- Update success.
# 查询看看修改结果
- back
-
- login -t 110101199003078670 a12345
- Login success.
-
- gc -id bh00000001
- CID:bh00000001,Name:oop6325,Teachers:[A],Capacity:0/1,Time:[1-1]1,5
- back
- SUDO
# 修改教师列表,检测完后改回去。
-
- udc bh00000222 -t [10001] # 这里隐含了判断顺序
- Course does not exist.
# -
# - udc bh00000000 -t [,10001]
# - Input illegal.
-
- udc bh00000000 -t [10001,1000] # 教师号非法
- Update fail.
-
- udc bh00000002 -t [10001]
- Update success.
- back
-
- login -t 110101199003078670 a12345
- Login success.
-
- gc -id bh00000002 # 检查修改结果
- CID:bh00000002,Name:oop6326,Teachers:[A],Capacity:0/100,Time:[1-10]1,5
- back
- SUDO
-
- udc bh00000002 -t [10001,10002,10086] # 改回去
- Update success.
- back
-
- login -t 110101199003078670 a12345
- Login success.
-
- gc -id bh00000002 # 检查修改结果
- CID:bh00000002,Name:oop6326,Teachers:[A,B,10086],Capacity:0/100,Time:[1-10]1,5
- back
# 二级命令行通用功能
- # 以教师身份登录
- login -t 110101199003078670 a12345
- Login success.
# gc -id
-
- gc -id bh11111111
- Course does not exist.
-
- gc -id bh00000003
- CID:bh00000003,Name:oop6327,Teachers:[A,B,C],Capacity:0/100,Time:[6-6]1,5
# 分页的测试思路:只在一个地方测试分页的各种上一页、下一页功能。
# 其余地方不测试(使用一个大的PageSize,让输出只有一页)
# gc -key
-
- gc -key o 1 2
- |
Page:1
1.CID:bh00000000,Name:oop6324,Teachers:[A,10086],Capacity:0/0,Time:[1-1]1,5
2.CID:bh00000001,Name:oop6325,Teachers:[A],Capacity:0/1,Time:[1-1]1,5
n-next page, l-last page, q-quit
- q # quit displaying
-
- gc -key o 1 2
- |
Page:1
1.CID:bh00000000,Name:oop6324,Teachers:[A,10086],Capacity:0/0,Time:[1-1]1,5
2.CID:bh00000001,Name:oop6325,Teachers:[A],Capacity:0/1,Time:[1-1]1,5
n-next page, l-last page, q-quit
-
- n
- |
Page:2
1.CID:bh00000002,Name:oop6326,Teachers:[A,B,10086],Capacity:0/100,Time:[1-10]1,5
2.CID:bh00000003,Name:oop6327,Teachers:[A,B,C],Capacity:0/100,Time:[6-6]1,5
n-next page, l-last page, q-quit
-
- l
- |
Page:1
1.CID:bh00000000,Name:oop6324,Teachers:[A,10086],Capacity:0/0,Time:[1-1]1,5
2.CID:bh00000001,Name:oop6325,Teachers:[A],Capacity:0/1,Time:[1-1]1,5
n-next page, l-last page, q-quit
-
- l
- Course does not exist.
-
- gc -key o 1 2
- |
Page:1
1.CID:bh00000000,Name:oop6324,Teachers:[A,10086],Capacity:0/0,Time:[1-1]1,5
2.CID:bh00000001,Name:oop6325,Teachers:[A],Capacity:0/1,Time:[1-1]1,5
n-next page, l-last page, q-quit
-
- n
- |
Page:2
1.CID:bh00000002,Name:oop6326,Teachers:[A,B,10086],Capacity:0/100,Time:[1-10]1,5
2.CID:bh00000003,Name:oop6327,Teachers:[A,B,C],Capacity:0/100,Time:[6-6]1,5
n-next page, l-last page, q-quit
-
- n
- |
Page:3
1.CID:bh00000004,Name:oop6328,Teachers:[A,B],Capacity:0/100,Time:[11-18]1,5
2.CID:bh00000005,Name:oop6329,Teachers:[A,B],Capacity:0/100,Time:[1-18]1,6
n-next page, l-last page, q-quit
-
- n
- |
Page:4
1.CID:bh00000006,Name:oop6330,Teachers:[A,B],Capacity:0/100,Time:[1-1]1,1
n-next page, l-last page, q-quit
-
- n
- Course does not exist.
- back
# 测试教师登陆后的功能
-
- login -t 110101199003078670 a12345 # teacher 10001
- Login success.
-
- myc 1 1000
- |
Page:1
1.CID:bh00000000,Name:oop6324,Teachers:[A,10086],Capacity:0/0,Time:[1-1]1,5
2.CID:bh00000001,Name:oop6325,Teachers:[A],Capacity:0/1,Time:[1-1]1,5
3.CID:bh00000002,Name:oop6326,Teachers:[A,B,10086],Capacity:0/100,Time:[1-10]1,5
4.CID:bh00000003,Name:oop6327,Teachers:[A,B,C],Capacity:0/100,Time:[6-6]1,5
5.CID:bh00000004,Name:oop6328,Teachers:[A,B],Capacity:0/100,Time:[11-18]1,5
6.CID:bh00000005,Name:oop6329,Teachers:[A,B],Capacity:0/100,Time:[1-18]1,6
7.CID:bh00000006,Name:oop6330,Teachers:[A,B],Capacity:0/100,Time:[1-1]1,1
n-next page, l-last page, q-quit
- q
- back
# 测试学生登陆后的功能
-
- login -s 110101201103079910 a12345 # studa
- Login success.
# 选课,并多方位检查
-
- getc bh12345678 # 课程号不存在
- Course does not exist.
-
- getc bh00000000 # 已满
- The course is full.
-
- getc bh00000001 # 成功选课
- Course chosen success.
-
- getc bh00000001 # 注意此时,课程已满且已经选过,所以看判断顺序
- The course has been selected.
# 全方位检查选课
# 检查学生的选课列表
-
- myc 1 1000
- |
Page:1
1.CID:bh00000001,Name:oop6325,Teachers:[A],Capacity:1/1,Time:[1-1]1,5
n-next page, l-last page, q-quit
- q
- back # 退出学生登录
# 检查课程的学生列表
- SUDO # 进入SUDO
-
- clist bh00000001 1 10
- |
Page:1
1.18370000,studa
n-next page, l-last page, q-quit
- q
- back # 退出SUDO
-
- login -s 110101201103079910 a12345 # 登录 studa
- Login success.
# 退课
-
- dropc bh6 # 课程号不存在
- Course does not exist.
-
- dropc bh00000006 # 未选过该课程
- The course has not been selected.
-
- dropc bh00000001
- Drop out successful.
# 检查一下学生的选课列表
-
- myc 1 100
- Course does not exist.
# 学生多选一点课
-
- getc bh00000002 # ======================= studa -> 02
- Course chosen success.
-
- getc bh00000004 # ======================= studa -> 04
- Course chosen success.
-
- getc bh00000005 # ======================= studa -> 05
- Course chosen success.
-
- myc 1 1000 # 测试studa的选课列表
- |
Page:1
1.CID:bh00000002,Name:oop6326,Teachers:[A,B,10086],Capacity:1/100,Time:[1-10]1,5
2.CID:bh00000004,Name:oop6328,Teachers:[A,B],Capacity:1/100,Time:[11-18]1,5
3.CID:bh00000005,Name:oop6329,Teachers:[A,B],Capacity:1/100,Time:[1-18]1,6
n-next page, l-last page, q-quit
- q
- back # studa 退出登录
-
- login -s 110101201103072057 a12345 # 登录 studc
- Login success.
-
- getc bh00000002 # ======================= studc -> 02
- Course chosen success.
-
- myc 1 100
- |
Page:1
1.CID:bh00000002,Name:oop6326,Teachers:[A,B,10086],Capacity:2/100,Time:[1-10]1,5
n-next page, l-last page, q-quit
- q
- back # studc 退出登录
-
- login -s 110101201103071134 a12345 # 登录 studb
- Login success.
-
- getc bh00000002 # ======================= studb -> 02
- Course chosen success.
- back
# 现在02 oop6326被3人选修了,现在检查oop6326的学生列表
- SUDO
-
- clist bh00000002 1 1000
- |
Page:1
1.18370000,studa
2.18370001,studb
3.18370002,studc
n-next page, l-last page, q-quit
- q
- back
# getc测试。到现在为止,选课情况:studa(2,4,5) studb(2) studc(2) =====================
# 先后顺序判断改为:
# 课程号不存在:"Course does not exist."
# 已选过该课程:"The course has been selected."
# 课程时间冲突:"Course time conflict."
# 课程容量已满:"The course is full."
# 选课成功:"Course chosen success."
-
- login -s 110101201103077958 a12345 # studd
- Login success.
-
- getc bh00000001 # ============================ studd(01) (占领了01的唯一一个名额)
- Course chosen success.
- back
-
- login -s 110101201103079910 a12345 # studa
- Login success.
-
- getc bh00005678
- Course does not exist.
-
- getc bh00000002
- The course has been selected.
-
- getc bh00000004
- The course has been selected.
-
- getc bh00000005
- The course has been selected.
-
- getc bh00000001 # 既满了,又时间冲突
- Course time conflict.
# studa退掉02选03。测试时间段的判断
-
- dropc bh00000002
- Drop out successful.
-
- getc bh00000003
- Course chosen success.
-
- getc bh00000002
- Course time conflict.
# studa退掉03选02。
-
- dropc bh00000003
- Drop out successful.
-
- getc bh00000002
- Course chosen success.
- back
-
- login -s 110101201103078053 a12345 # stude
- Login success.
-
- getc bh00000001 # 仅仅容量已满
- The course is full.
- back
# Dropout测试
# 到现在为止,选课情况:studa(2,4,5) studb(2) studc(2) studd(1) ================
# studd退学
-
- login -s 110101201103077958 a12345 # studd
- Login success.
-
- DROPOUT aaaaa bbbbb # 注意先判断相同,再判断密码是否正确
- The password you entered must be the same as the former one.
-
- DROPOUT wrong_password wrong_password
- Password illegal.
-
- DROPOUT a12345 a12345
- Congratulations, drop out successfully.
# 登录,不存在该用户
-
- login -s 110101201103077958 a12345 # studd
- Login Error. Your ID or password maybe wrong.
# 到现在为止,选课情况:studa(2,4,5) studb(2) studc(2) ================
# stude可以来选course01了
-
- login -s 110101201103078053 a12345 # stude
- Login success.
-
- getc bh00000001
- Course chosen success. # =================== stude(1)
- back
# studa退学
-
- login -s 110101201103079910 a12345 # studa
- Login success.
-
- DROPOUT a12345 a12345
- Congratulations, drop out successfully.
# 现在的选课情况: studb(2) studc(2) stude(1) ========================
-
- login -t 110101199003078670 a12345 # 以教师身份登录
- Login success.
# 检查其他几个命令的输出是否正常
-
- gc -key oop6326 1 100 # only course 02
- |
Page:1
1.CID:bh00000002,Name:oop6326,Teachers:[A,B,10086],Capacity:2/100,Time:[1-10]1,5
n-next page, l-last page, q-quit
- q
-
- clist bh00000002 1 100
- |
Page:1
1.18370001,studb
2.18370002,studc
n-next page, l-last page, q-quit
- q
- back
# 添加和已经退学的studa相同学号、身份证号的学生,应当成功
- SUDO
-
- np -s studa 110101201103079910 18370000
- Add student success.
- QUIT