1
2
3
4
5
6
7 package org.huihoo.jfox.soaf.services.persistence;
8
9 import junit.framework.TestCase;
10
11 import org.huihoo.jfox.soaf.container.ServiceFactory;
12 import org.huihoo.jfox.soaf.container.ServiceLoader;
13 import org.huihoo.jfox.soaf.exception.DAOException;
14 import org.huihoo.jfox.soaf.services.jdbc.DataSourceService;
15
16 import com.jenkov.mrpersister.itf.PersistenceException;
17
18 /***
19 * @author peter.cheng
20 *
21 * TODO To change the template for this generated type comment go to Window -
22 * Preferences - Java - Code Style - Code Templates
23 */
24 public class MrPersisterServiceImplTest extends TestCase {
25
26 private MrPersisterService mrPersisterService;
27
28 private DataSourceService dsService;
29
30 private ServiceLoader sl = ServiceLoader.getInstance();
31
32 private ServiceFactory sf = ServiceFactory.getInstance();
33
34 private final static String SQL = "CREATE TABLE employees (employee_id varchar(255) NOT NULL,"
35 + "name varchar(255) NOT NULL, job_title varchar(255) NOT NULL,"
36 + "job_description varchar(255) default NULL, employed_since"
37 + " datetime, monthly_salary int(4), PRIMARY KEY (employee_id))";
38
39 private final static String DROP_TABLE_SQL = "drop table employees";
40
41
42
43
44 protected void setUp() throws Exception {
45 super.setUp();
46 if (!sl.isServiceLoaded()) {
47 sl.initService("jfoxsoaf-config.xml");
48 }
49 mrPersisterService = (MrPersisterService) sf
50 .getService(MrPersisterService.class);
51 dsService = (DataSourceService) sf.getService(DataSourceService.class);
52
53 mrPersisterService.setDataSource(dsService.getDataSource(null));
54 }
55
56
57
58
59 protected void tearDown() throws Exception {
60 super.tearDown();
61 }
62
63 public void testSetDataSource() {
64 }
65
66
67
68
69 public void testDeleteConnectionObject() {
70 }
71
72
73
74
75 public void testDeleteObject() {
76 }
77
78
79
80
81 public void testDeleteObjectObject() {
82 }
83
84
85
86
87 public void testDeleteConnectionObjectObject() {
88 }
89
90
91
92
93 public void testDeleteBatchCollection() {
94 }
95
96
97
98
99 public void testDeleteBatchConnectionCollection() {
100 }
101
102
103
104
105 public void testDeleteBatchConnectionObjectCollection() {
106 }
107
108
109
110
111 public void testDeleteBatchObjectCollection() {
112 }
113
114
115
116
117 public void testDeleteByPrimaryKeyConnectionObjectObject() {
118 }
119
120
121
122
123 public void testDeleteByPrimaryKeyObjectObject() {
124 }
125
126
127
128
129 public void testDeleteBatchByPrimaryKeysObjectCollection() {
130 }
131
132
133
134
135
136 public void testDeleteBatchByPrimaryKeysConnectionObjectCollection() {
137 }
138
139
140
141
142 public void testExecuteUpdateStringCollection() {
143 }
144
145
146
147
148 public void testExecuteUpdateConnectionStringCollection() {
149 }
150
151
152
153
154 public void testExecuteUpdateStringObjectArray() {
155 }
156
157
158
159
160 public void testExecuteUpdateConnectionStringObjectArray() {
161 }
162
163
164
165
166 public void testExecuteUpdateString() {
167
168 try {
169 mrPersisterService.executeUpdate(DROP_TABLE_SQL);
170 } catch (DAOException e1) {
171 e1.printStackTrace();
172 } catch (PersistenceException e1) {
173 e1.printStackTrace();
174 }
175
176 try {
177 mrPersisterService.executeUpdate(SQL);
178 } catch (DAOException e) {
179 e.printStackTrace();
180 } catch (PersistenceException e) {
181 e.printStackTrace();
182 }
183
184
185 }
186
187
188
189
190 public void testExecuteUpdateConnectionString() {
191 }
192
193
194
195
196 public void testInsertObjectObject() {
197 }
198
199
200
201
202 public void testInsertConnectionObjectObject() {
203 }
204
205
206
207
208 public void testInsertObject() {
209 }
210
211
212
213
214 public void testInsertConnectionObject() {
215 }
216
217
218
219
220 public void testInsertBatchCollection() {
221 }
222
223
224
225
226 public void testInsertBatchObjectCollection() {
227 }
228
229
230
231
232 public void testInsertBatchConnectionCollection() {
233 }
234
235
236
237
238 public void testReadObjectPreparedStatement() {
239 }
240
241
242
243
244 public void testReadConnectionObjectPreparedStatement() {
245 }
246
247
248
249
250 public void testReadObjectResultSet() {
251 }
252
253
254
255
256 public void testReadConnectionObjectResultSet() {
257 }
258
259
260
261
262 public void testReadObjectStatementString() {
263 }
264
265
266
267
268 public void testReadConnectionObjectStatementString() {
269 }
270
271
272
273
274 public void testReadObjectStringCollection() {
275 }
276
277
278
279
280 public void testReadConnectionObjectStringCollection() {
281 }
282
283
284
285
286 public void testReadObjectStringObjectArray() {
287 }
288
289
290
291
292 public void testReadConnectionObjectStringObjectArray() {
293 }
294
295
296
297
298 public void testReadObjectString() {
299 }
300
301
302
303
304 public void testReadConnectionObjectString() {
305 }
306
307
308
309
310 public void testReadByPrimaryKeyObjectObject() {
311 }
312
313
314
315
316 public void testReadByPrimaryKeyConnectionObjectObject() {
317 }
318
319
320
321
322
323 public void testReadListObjectPreparedStatementIReadFilter() {
324 }
325
326
327
328
329
330 public void testReadListConnectionObjectPreparedStatementIReadFilter() {
331 }
332
333
334
335
336 public void testReadListObjectPreparedStatement() {
337 }
338
339
340
341
342 public void testReadListConnectionObjectPreparedStatement() {
343 }
344
345
346
347
348 public void testReadListObjectResultSetIReadFilter() {
349 }
350
351
352
353
354
355 public void testReadListConnectionObjectResultSetIReadFilter() {
356 }
357
358
359
360
361 public void testReadListObjectResultSet() {
362 }
363
364
365
366
367 public void testReadListConnectionObjectResultSet() {
368 }
369
370
371
372
373 public void testReadListObjectStatementString() {
374 }
375
376
377
378
379 public void testReadListConnectionObjectStatementString() {
380 }
381
382
383
384
385
386 public void testReadListObjectStringCollectionIReadFilter() {
387 }
388
389
390
391
392
393 public void testReadListConnectionObjectStringCollectionIReadFilter() {
394 }
395
396
397
398
399
400 public void testReadListObjectStatementStringIReadFilter() {
401 }
402
403
404
405
406
407 public void testReadListConnectionObjectStatementStringIReadFilter() {
408 }
409
410
411
412
413 public void testReadListObjectStringCollection() {
414 }
415
416
417
418
419
420 public void testReadListConnectionObjectStringCollection() {
421 }
422
423
424
425
426 public void testReadListObjectStringIReadFilter() {
427 }
428
429
430
431
432
433 public void testReadListConnectionObjectStringIReadFilter() {
434 }
435
436
437
438
439 public void testReadListObjectStringObjectArrayIReadFilter() {
440 }
441
442
443
444
445
446 public void testReadListConnectionObjectStringObjectArrayIReadFilter() {
447 }
448
449
450
451
452 public void testReadListObjectStringObjectArray() {
453 }
454
455
456
457
458 public void testReadListConnectionObjectStringObjectArray() {
459 }
460
461
462
463
464 public void testReadListObjectString() {
465 }
466
467
468
469
470 public void testReadListConnectionObjectString() {
471 }
472
473
474
475
476 public void testReadListByPrimaryKeysObjectCollection() {
477 }
478
479
480
481
482
483 public void testReadListByPrimaryKeysConnectionObjectCollection() {
484 }
485
486
487
488
489 public void testUpdateObjectObject() {
490 }
491
492
493
494
495 public void testUpdateConnectionObjectObject() {
496 }
497
498
499
500
501 public void testUpdateObject() {
502 }
503
504
505
506
507 public void testUpdateConnectionObject() {
508 }
509
510
511
512
513 public void testUpdateBatchCollection() {
514 }
515
516
517
518
519 public void testUpdateBatchConnectionCollection() {
520 }
521
522
523
524
525 public void testUpdateBatchObjectCollection() {
526 }
527
528
529
530
531 public void testUpdateBatchConnectionObjectCollection() {
532 }
533
534
535
536
537
538 public void testUpdateBatchByPrimaryKeysCollectionCollection() {
539 }
540
541
542
543
544
545 public void testUpdateBatchByPrimaryKeysConnectionCollectionCollection() {
546 }
547
548
549
550
551
552 public void testUpdateBatchByPrimaryKeysObjectCollectionCollection() {
553 }
554
555
556
557
558
559 public void testUpdateBatchByPrimaryKeysConnectionObjectCollectionCollection() {
560 }
561
562
563
564
565 public void testUpdateByPrimaryKeyObjectObjectObject() {
566 }
567
568
569
570
571
572 public void testUpdateByPrimaryKeyConnectionObjectObjectObject() {
573 }
574
575
576
577
578 public void testUpdateByPrimaryKeyObjectObject() {
579 }
580
581
582
583
584 public void testUpdateByPrimaryKeyConnectionObjectObject() {
585 }
586
587 }