1{
2 "tests": [
3 {
4 "description": "Valid connection and timeout options are parsed correctly",
5 "uri": "mongodb://example.com/?appname=URI-OPTIONS-SPEC-TEST&connectTimeoutMS=20000&heartbeatFrequencyMS=5000&localThresholdMS=3000&maxIdleTimeMS=50000&replicaSet=uri-options-spec&retryWrites=true&serverSelectionTimeoutMS=15000&socketTimeoutMS=7500",
6 "valid": true,
7 "warning": false,
8 "hosts": null,
9 "auth": null,
10 "options": {
11 "appname": "URI-OPTIONS-SPEC-TEST",
12 "connectTimeoutMS": 20000,
13 "heartbeatFrequencyMS": 5000,
14 "localThresholdMS": 3000,
15 "maxIdleTimeMS": 50000,
16 "replicaSet": "uri-options-spec",
17 "retryWrites": true,
18 "serverSelectionTimeoutMS": 15000,
19 "socketTimeoutMS": 7500
20 }
21 },
22 {
23 "description": "Non-numeric connectTimeoutMS causes a warning",
24 "uri": "mongodb://example.com/?connectTimeoutMS=invalid",
25 "valid": true,
26 "warning": true,
27 "hosts": null,
28 "auth": null,
29 "options": {}
30 },
31 {
32 "description": "Too low connectTimeoutMS causes a warning",
33 "uri": "mongodb://example.com/?connectTimeoutMS=-2",
34 "valid": true,
35 "warning": true,
36 "hosts": null,
37 "auth": null,
38 "options": {}
39 },
40 {
41 "description": "Non-numeric heartbeatFrequencyMS causes a warning",
42 "uri": "mongodb://example.com/?heartbeatFrequencyMS=invalid",
43 "valid": true,
44 "warning": true,
45 "hosts": null,
46 "auth": null,
47 "options": {}
48 },
49 {
50 "description": "Too low heartbeatFrequencyMS causes a warning",
51 "uri": "mongodb://example.com/?heartbeatFrequencyMS=-2",
52 "valid": true,
53 "warning": true,
54 "hosts": null,
55 "auth": null,
56 "options": {}
57 },
58 {
59 "description": "Non-numeric localThresholdMS causes a warning",
60 "uri": "mongodb://example.com/?localThresholdMS=invalid",
61 "valid": true,
62 "warning": true,
63 "hosts": null,
64 "auth": null,
65 "options": {}
66 },
67 {
68 "description": "Too low localThresholdMS causes a warning",
69 "uri": "mongodb://example.com/?localThresholdMS=-2",
70 "valid": true,
71 "warning": true,
72 "hosts": null,
73 "auth": null,
74 "options": {}
75 },
76 {
77 "description": "Invalid retryWrites causes a warning",
78 "uri": "mongodb://example.com/?retryWrites=invalid",
79 "valid": true,
80 "warning": true,
81 "hosts": null,
82 "auth": null,
83 "options": {}
84 },
85 {
86 "description": "Non-numeric serverSelectionTimeoutMS causes a warning",
87 "uri": "mongodb://example.com/?serverSelectionTimeoutMS=invalid",
88 "valid": true,
89 "warning": true,
90 "hosts": null,
91 "auth": null,
92 "options": {}
93 },
94 {
95 "description": "Too low serverSelectionTimeoutMS causes a warning",
96 "uri": "mongodb://example.com/?serverSelectionTimeoutMS=-2",
97 "valid": true,
98 "warning": true,
99 "hosts": null,
100 "auth": null,
101 "options": {}
102 },
103 {
104 "description": "Non-numeric socketTimeoutMS causes a warning",
105 "uri": "mongodb://example.com/?socketTimeoutMS=invalid",
106 "valid": true,
107 "warning": true,
108 "hosts": null,
109 "auth": null,
110 "options": {}
111 },
112 {
113 "description": "Too low socketTimeoutMS causes a warning",
114 "uri": "mongodb://example.com/?socketTimeoutMS=-2",
115 "valid": true,
116 "warning": true,
117 "hosts": null,
118 "auth": null,
119 "options": {}
120 },
121 {
122 "description": "directConnection=true",
123 "uri": "mongodb://example.com/?directConnection=true",
124 "valid": true,
125 "warning": false,
126 "hosts": null,
127 "auth": null,
128 "options": {
129 "directConnection": true
130 }
131 },
132 {
133 "description": "directConnection=true with multiple seeds",
134 "uri": "mongodb://example1.com,example2.com/?directConnection=true",
135 "valid": false,
136 "warning": false,
137 "hosts": null,
138 "auth": null,
139 "options": {}
140 },
141 {
142 "description": "directConnection=false",
143 "uri": "mongodb://example.com/?directConnection=false",
144 "valid": true,
145 "warning": false,
146 "hosts": null,
147 "auth": null,
148 "options": {
149 "directConnection": false
150 }
151 },
152 {
153 "description": "directConnection=false with multiple seeds",
154 "uri": "mongodb://example1.com,example2.com/?directConnection=false",
155 "valid": true,
156 "warning": false,
157 "hosts": null,
158 "auth": null,
159 "options": {
160 "directConnection": false
161 }
162 },
163 {
164 "description": "Invalid directConnection value",
165 "uri": "mongodb://example.com/?directConnection=invalid",
166 "valid": true,
167 "warning": true,
168 "hosts": null,
169 "auth": null,
170 "options": {}
171 },
172 {
173 "description": "loadBalanced=true",
174 "uri": "mongodb://example.com/?loadBalanced=true",
175 "valid": true,
176 "warning": false,
177 "hosts": null,
178 "auth": null,
179 "options": {
180 "loadBalanced": true
181 }
182 },
183 {
184 "description": "loadBalanced=true with directConnection=false",
185 "uri": "mongodb://example.com/?loadBalanced=true&directConnection=false",
186 "valid": true,
187 "warning": false,
188 "hosts": null,
189 "auth": null,
190 "options": {
191 "loadBalanced": true,
192 "directConnection": false
193 }
194 },
195 {
196 "description": "loadBalanced=false",
197 "uri": "mongodb://example.com/?loadBalanced=false",
198 "valid": true,
199 "warning": false,
200 "hosts": null,
201 "auth": null,
202 "options": {
203 "loadBalanced": false
204 }
205 },
206 {
207 "description": "Invalid loadBalanced value",
208 "uri": "mongodb://example.com/?loadBalanced=1",
209 "valid": true,
210 "warning": true,
211 "hosts": null,
212 "auth": null,
213 "options": {}
214 },
215 {
216 "description": "loadBalanced=true with multiple hosts causes an error",
217 "uri": "mongodb://example1,example2/?loadBalanced=true",
218 "valid": false,
219 "warning": false,
220 "hosts": null,
221 "auth": null,
222 "options": {}
223 },
224 {
225 "description": "loadBalanced=true with directConnection=true causes an error",
226 "uri": "mongodb://example.com/?loadBalanced=true&directConnection=true",
227 "valid": false,
228 "warning": false,
229 "hosts": null,
230 "auth": null,
231 "options": {}
232 },
233 {
234 "description": "loadBalanced=true with replicaSet causes an error",
235 "uri": "mongodb://example.com/?loadBalanced=true&replicaSet=replset",
236 "valid": false,
237 "warning": false,
238 "hosts": null,
239 "auth": null,
240 "options": {}
241 }
242 ]
243}
View as plain text