-
Notifications
You must be signed in to change notification settings - Fork 1
/
_Test1.bat
210 lines (175 loc) · 8.66 KB
/
_Test1.bat
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
echo off
echo "Negative Tests: Command Line Arguments"
del \tmp\tmp.*
del \tmp\csv.*
echo Test: No Command Line Args
java epipog 2>stderr
IF %ERRORLEVEL% NEQ 1 ( echo FAILED rc ) else ( echo PASSED )
find "Usage: epipog <options>" stderr >stdout
if %ERRORLEVEL% NEQ 0 ( echo FAILED stderr ) else echo PASSED
echo Test: no letter follows comma
java epipog - 2>stderr
IF %ERRORLEVEL% NEQ 1 ( echo FAILED rc ) else ( echo PASSED )
find "Invalid argument, no option letter follows comma" stderr >stdout
if %ERRORLEVEL% NEQ 0 ( echo FAILED stderr ) else echo PASSED
echo Test: Invalid option
java epipog -R 2>stderr
IF %ERRORLEVEL% NEQ 1 ( echo FAILED rc ) else ( echo PASSED )
find "Invalid option: -R" stderr >stdout
if %ERRORLEVEL% NEQ 0 ( echo FAILED stderr ) else echo PASSED
echo Test: Invalid argument
java epipog dddd 2>stderr
IF %ERRORLEVEL% NEQ 1 ( echo FAILED rc ) else ( echo PASSED )
find "Invalid argument: ddd" stderr >stdout
if %ERRORLEVEL% NEQ 0 ( echo FAILED stderr ) else ( echo PASSED )
echo Test: Missing argument for option -c
java epipog -c 2>stderr
IF %ERRORLEVEL% NEQ 1 ( echo FAILED rc ) else ( echo PASSED )
find "Missing argument for -c option" stderr >stdout
if %ERRORLEVEL% NEQ 0 ( echo FAILED stderr ) else ( echo PASSED )
echo Test: Missing argument for option -C
java epipog -C 2>stderr
IF %ERRORLEVEL% NEQ 1 ( echo FAILED rc ) else ( echo PASSED )
find "Missing argument for -C option" stderr >stdout
if %ERRORLEVEL% NEQ 0 ( echo FAILED stderr ) else ( echo PASSED )
echo Test: Missing argument for option -d
java epipog -d 2>stderr
IF %ERRORLEVEL% NEQ 1 ( echo FAILED rc ) else ( echo PASSED )
find "Missing argument for -d option" stderr >stdout
if %ERRORLEVEL% NEQ 0 ( echo FAILED stderr ) else ( echo PASSED )
echo Test: Missing argument for option -f
java epipog -f 2>stderr
IF %ERRORLEVEL% NEQ 1 ( echo FAILED rc ) else ( echo PASSED )
find "Missing argument for -f option" stderr >stdout
if %ERRORLEVEL% NEQ 0 ( echo FAILED stderr ) else ( echo PASSED )
echo Test: Missing argument for option -F
java epipog -F 2>stderr
IF %ERRORLEVEL% NEQ 1 ( echo FAILED rc ) else ( echo PASSED )
find "Missing argument for -F option" stderr >stdout
if %ERRORLEVEL% NEQ 0 ( echo FAILED stderr ) else ( echo PASSED )
echo Test: Missing argument for option -i
java epipog -i 2>stderr
IF %ERRORLEVEL% NEQ 1 ( echo FAILED rc ) else ( echo PASSED )
find "Missing argument for -i option" stderr >stdout
if %ERRORLEVEL% NEQ 0 ( echo FAILED stderr ) else ( echo PASSED )
echo Test: Missing argument for option -I
java epipog -I 2>stderr
IF %ERRORLEVEL% NEQ 1 ( echo FAILED rc ) else ( echo PASSED )
find "Missing argument for -I option" stderr >stdout
if %ERRORLEVEL% NEQ 0 ( echo FAILED stderr ) else ( echo PASSED )
echo Test: Missing argument for option -o
java epipog -o 2>stderr
IF %ERRORLEVEL% NEQ 1 ( echo FAILED rc ) else ( echo PASSED )
find "Missing argument for -o option" stderr >stdout
if %ERRORLEVEL% NEQ 0 ( echo FAILED stderr ) else ( echo PASSED )
echo Test: Missing argument for option -O
java epipog -O 2>stderr
IF %ERRORLEVEL% NEQ 1 ( echo FAILED rc ) else ( echo PASSED )
find "Missing argument for -O option" stderr >stdout
if %ERRORLEVEL% NEQ 0 ( echo FAILED stderr ) else ( echo PASSED )
echo Test: Missing argument for option -P
java epipog -P 2>stderr
IF %ERRORLEVEL% NEQ 1 ( echo FAILED rc ) else ( echo PASSED )
find "Missing argument for -P option" stderr >stdout
if %ERRORLEVEL% NEQ 0 ( echo FAILED stderr ) else ( echo PASSED )
echo Test: Missing argument for option -s
java epipog -s 2>stderr
IF %ERRORLEVEL% NEQ 1 ( echo FAILED rc ) else ( echo PASSED )
find "Missing argument for -s option" stderr >stdout
if %ERRORLEVEL% NEQ 0 ( echo FAILED stderr ) else ( echo PASSED )
echo Test: Missing argument for option -S
java epipog -S 2>stderr
IF %ERRORLEVEL% NEQ 1 ( echo FAILED rc ) else ( echo PASSED )
find "Missing argument for -S option" stderr >stdout
if %ERRORLEVEL% NEQ 0 ( echo FAILED stderr ) else ( echo PASSED )
echo Test: Missing argument for option -t
java epipog -t 2>stderr
IF %ERRORLEVEL% NEQ 1 ( echo FAILED rc ) else ( echo PASSED )
find "Missing argument for -t option" stderr >stdout
if %ERRORLEVEL% NEQ 0 ( echo FAILED stderr ) else ( echo PASSED )
echo Test: Missing argument for option, another option seen instead
java epipog -c -x 2>stderr
IF %ERRORLEVEL% NEQ 1 ( echo FAILED rc ) else ( echo PASSED )
find "Missing argument for -c option" stderr >stdout
if %ERRORLEVEL% NEQ 0 ( echo FAILED stderr ) else ( echo PASSED )
echo Test: Not a number for cache argument
java epipog -c foo 2>stderr
IF %ERRORLEVEL% NEQ 1 ( echo FAILED rc ) else ( echo PASSED )
find "Invalid argument for cache size (-c): foo" stderr >stdout
if %ERRORLEVEL% NEQ 0 ( echo FAILED stderr ) else ( echo PASSED )
echo "Test: Not a valid argument for -d datastore"
java epipog -d foo 2>stderr
IF %ERRORLEVEL% NEQ 1 ( echo FAILED rc ) else ( echo PASSED )
find "Invalid argument for data store (-d): foo" stderr >stdout
if %ERRORLEVEL% NEQ 0 ( echo FAILED stderr ) else ( echo PASSED )
echo "Test: Not a valid argument for -f filter"
java epipog -f foo -SSTB:string64 2>stderr
IF %ERRORLEVEL% NEQ 1 ( echo FAILED rc ) else ( echo PASSED )
find "Malformed argument for filter (-f): foo" stderr >stdout
if %ERRORLEVEL% NEQ 0 ( echo FAILED stderr ) else ( echo PASSED )
echo "Test: Invalid Key for -f filter"
java epipog -f foo=2 -SSTB:string64 2>stderr
IF %ERRORLEVEL% NEQ 1 ( echo FAILED rc ) else ( echo PASSED )
find "Key not found: foo" stderr >stdout
if %ERRORLEVEL% NEQ 0 ( echo FAILED stderr ) else ( echo PASSED )
echo "Test: Not a valid argument for -F format"
java epipog -F foo -i goo -SSTB:string64 2>stderr
IF %ERRORLEVEL% NEQ 1 ( echo FAILED rc ) else ( echo PASSED )
find "Invalid argument for input format (-F): foo" stderr >stdout
if %ERRORLEVEL% NEQ 0 ( echo FAILED stderr ) else ( echo PASSED )
echo "Test: Not a valid argument for -I index"
java epipog -I foo -SSTB:string64 2>stderr
IF %ERRORLEVEL% NEQ 1 ( echo FAILED rc ) else ( echo PASSED )
find "Invalid argument for index type (-I): foo" stderr >stdout
if %ERRORLEVEL% NEQ 0 ( echo FAILED stderr ) else ( echo PASSED )
echo "Test: Nonexistent file for -i option"
java epipog -i foo -SSTB:string64 2>stderr
IF %ERRORLEVEL% NEQ 1 ( echo FAILED rc ) else ( echo PASSED )
find "Unable to open input file: foo" stderr >stdout
if %ERRORLEVEL% NEQ 0 ( echo FAILED stderr ) else ( echo PASSED )
echo "Test: Not a valid argument for -O sort type"
java epipog -O foo -s STB -o STB -S STB:string16 2>stderr
IF %ERRORLEVEL% NEQ 1 ( echo FAILED rc ) else ( echo PASSED )
find "Invalid argument for sort type (-O): foo" stderr >stdout
if %ERRORLEVEL% NEQ 0 ( echo FAILED stderr ) else ( echo PASSED )
echo "Test: key not found for -o orderby"
java epipog -o foo -s STB -S STB:string16 2>stderr
IF %ERRORLEVEL% NEQ 1 ( echo FAILED rc ) else ( echo PASSED )
find "Key not found: foo" stderr >stdout
if %ERRORLEVEL% NEQ 0 ( echo FAILED stderr ) else ( echo PASSED )
echo "Test: primary, key not in schema"
java epipog -P foo -SSTB:string16 2>stderr
IF %ERRORLEVEL% NEQ 1 ( echo FAILED rc ) else ( echo PASSED )
find "Key not found: foo" stderr >stdout
if %ERRORLEVEL% NEQ 0 ( echo FAILED stderr ) else ( echo PASSED )
echo "Test: primary, no schema"
java epipog -P foo 2>stderr
IF %ERRORLEVEL% NEQ 1 ( echo FAILED rc ) else ( echo PASSED )
find "No schema" stderr >stdout
if %ERRORLEVEL% NEQ 0 ( echo FAILED stderr ) else ( echo PASSED )
echo "Test: schema, key has no data type"
java epipog -S foo 2>stderr
IF %ERRORLEVEL% NEQ 1 ( echo FAILED rc ) else ( echo PASSED )
find "Schema: key missing data type (-S): foo" stderr >stdout
if %ERRORLEVEL% NEQ 0 ( echo FAILED stderr ) else ( echo PASSED )
echo "Test: schema, invalid data type for key"
java epipog -S foo:goo 2>stderr
IF %ERRORLEVEL% NEQ 1 ( echo FAILED rc ) else ( echo PASSED )
find "Schema: key has invalid data type (-S): goo" stderr >stdout
if %ERRORLEVEL% NEQ 0 ( echo FAILED stderr ) else ( echo PASSED )
echo "Test: schema, key already defined"
java epipog -S key1:string16,key1:integer 2>stderr
IF %ERRORLEVEL% NEQ 1 ( echo FAILED rc ) else ( echo PASSED )
find "Schema: key is defined more than once: key1" stderr >stdout
if %ERRORLEVEL% NEQ 0 ( echo FAILED stderr ) else ( echo PASSED )
echo "Test: key not found for -s select"
java epipog -s foo -SSTB:string16 2>stderr
IF %ERRORLEVEL% NEQ 1 ( echo FAILED rc ) else ( echo PASSED )
find "Key not found: foo" stderr >stdout
if %ERRORLEVEL% NEQ 0 ( echo FAILED stderr ) else ( echo PASSED )
echo "Test: Not a valid argument for -t storage type"
java epipog -t foo 2>stderr
IF %ERRORLEVEL% NEQ 1 ( echo FAILED rc ) else ( echo PASSED )
find "Invalid argument for storage type (-t): foo" stderr >stdout
if %ERRORLEVEL% NEQ 0 ( echo FAILED stderr ) else ( echo PASSED )
del stdout stderr