1
2
3
4
5
6
7
8 package org.exolab.castor.tests.framework.testDescriptor;
9
10
11
12
13
14
15
16 public class UnitTestCase implements java.io.Serializable {
17
18
19
20
21
22
23
24
25
26 private java.lang.String _name;
27
28
29
30
31 private org.exolab.castor.tests.framework.testDescriptor.UnitTestCaseChoice _unitTestCaseChoice;
32
33
34
35
36 private org.exolab.castor.tests.framework.testDescriptor.CustomTest _customTest;
37
38
39
40 private org.exolab.castor.tests.framework.testDescriptor.Configuration _configuration;
41
42
43
44
45 private java.lang.String _input;
46
47
48
49
50 private java.lang.String _goldFile;
51
52
53
54
55 private java.lang.String _objectBuilder;
56
57
58
59
60 private org.exolab.castor.tests.framework.testDescriptor.Failure _failure;
61
62
63
64
65 private boolean _skip;
66
67
68
69
70 private boolean _has_skip;
71
72
73
74
75 private org.exolab.castor.tests.framework.testDescriptor.Listener _listener;
76
77
78
79
80 private java.util.List _schemaDifferencesList;
81
82
83
84
85 private java.util.List _commentList;
86
87
88
89
90 private float _javaSourceVersion;
91
92
93
94
95 private boolean _has_javaSourceVersion;
96
97
98
99
100 private boolean _generateImported;
101
102
103
104
105 private boolean _has_generateImported;
106
107
108
109
110
111
112 public UnitTestCase() {
113 super();
114 this._schemaDifferencesList = new java.util.ArrayList();
115 this._commentList = new java.util.ArrayList();
116 }
117
118
119
120
121
122
123
124
125
126
127
128
129
130 public void addComment(
131 final java.lang.String vComment)
132 throws java.lang.IndexOutOfBoundsException {
133 this._commentList.add(vComment);
134 }
135
136
137
138
139
140
141
142
143
144 public void addComment(
145 final int index,
146 final java.lang.String vComment)
147 throws java.lang.IndexOutOfBoundsException {
148 this._commentList.add(index, vComment);
149 }
150
151
152
153
154
155
156
157
158 public void addSchemaDifferences(
159 final org.exolab.castor.tests.framework.testDescriptor.SchemaDifferences vSchemaDifferences)
160 throws java.lang.IndexOutOfBoundsException {
161
162 if (this._schemaDifferencesList.size() >= 2) {
163 throw new IndexOutOfBoundsException("addSchemaDifferences has a maximum of 2");
164 }
165
166 this._schemaDifferencesList.add(vSchemaDifferences);
167 }
168
169
170
171
172
173
174
175
176
177 public void addSchemaDifferences(
178 final int index,
179 final org.exolab.castor.tests.framework.testDescriptor.SchemaDifferences vSchemaDifferences)
180 throws java.lang.IndexOutOfBoundsException {
181
182 if (this._schemaDifferencesList.size() >= 2) {
183 throw new IndexOutOfBoundsException("addSchemaDifferences has a maximum of 2");
184 }
185
186 this._schemaDifferencesList.add(index, vSchemaDifferences);
187 }
188
189
190
191 public void deleteGenerateImported(
192 ) {
193 this._has_generateImported= false;
194 }
195
196
197
198 public void deleteJavaSourceVersion(
199 ) {
200 this._has_javaSourceVersion= false;
201 }
202
203
204
205 public void deleteSkip(
206 ) {
207 this._has_skip= false;
208 }
209
210
211
212
213
214
215
216 public java.util.Enumeration enumerateComment(
217 ) {
218 return java.util.Collections.enumeration(this._commentList);
219 }
220
221
222
223
224
225
226
227 public java.util.Enumeration enumerateSchemaDifferences(
228 ) {
229 return java.util.Collections.enumeration(this._schemaDifferencesList);
230 }
231
232
233
234
235
236
237
238
239
240 public java.lang.String getComment(
241 final int index)
242 throws java.lang.IndexOutOfBoundsException {
243
244 if (index < 0 || index >= this._commentList.size()) {
245 throw new IndexOutOfBoundsException("getComment: Index value '" + index + "' not in range [0.." + (this._commentList.size() - 1) + "]");
246 }
247
248 return (java.lang.String) _commentList.get(index);
249 }
250
251
252
253
254
255
256
257
258
259
260 public java.lang.String[] getComment(
261 ) {
262 java.lang.String[] array = new java.lang.String[0];
263 return (java.lang.String[]) this._commentList.toArray(array);
264 }
265
266
267
268
269
270
271 public int getCommentCount(
272 ) {
273 return this._commentList.size();
274 }
275
276
277
278
279
280
281 public org.exolab.castor.tests.framework.testDescriptor.Configuration getConfiguration(
282 ) {
283 return this._configuration;
284 }
285
286
287
288
289
290
291 public org.exolab.castor.tests.framework.testDescriptor.CustomTest getCustomTest(
292 ) {
293 return this._customTest;
294 }
295
296
297
298
299
300
301 public org.exolab.castor.tests.framework.testDescriptor.Failure getFailure(
302 ) {
303 return this._failure;
304 }
305
306
307
308
309
310
311 public boolean getGenerateImported(
312 ) {
313 return this._generateImported;
314 }
315
316
317
318
319
320
321 public java.lang.String getGoldFile(
322 ) {
323 return this._goldFile;
324 }
325
326
327
328
329
330
331 public java.lang.String getInput(
332 ) {
333 return this._input;
334 }
335
336
337
338
339
340
341 public float getJavaSourceVersion(
342 ) {
343 return this._javaSourceVersion;
344 }
345
346
347
348
349
350
351 public org.exolab.castor.tests.framework.testDescriptor.Listener getListener(
352 ) {
353 return this._listener;
354 }
355
356
357
358
359
360
361 public java.lang.String getName(
362 ) {
363 return this._name;
364 }
365
366
367
368
369
370
371 public java.lang.String getObjectBuilder(
372 ) {
373 return this._objectBuilder;
374 }
375
376
377
378
379
380
381
382
383
384
385
386 public org.exolab.castor.tests.framework.testDescriptor.SchemaDifferences getSchemaDifferences(
387 final int index)
388 throws java.lang.IndexOutOfBoundsException {
389
390 if (index < 0 || index >= this._schemaDifferencesList.size()) {
391 throw new IndexOutOfBoundsException("getSchemaDifferences: Index value '" + index + "' not in range [0.." + (this._schemaDifferencesList.size() - 1) + "]");
392 }
393
394 return (org.exolab.castor.tests.framework.testDescriptor.SchemaDifferences) _schemaDifferencesList.get(index);
395 }
396
397
398
399
400
401
402
403
404
405
406
407 public org.exolab.castor.tests.framework.testDescriptor.SchemaDifferences[] getSchemaDifferences(
408 ) {
409 org.exolab.castor.tests.framework.testDescriptor.SchemaDifferences[] array = new org.exolab.castor.tests.framework.testDescriptor.SchemaDifferences[0];
410 return (org.exolab.castor.tests.framework.testDescriptor.SchemaDifferences[]) this._schemaDifferencesList.toArray(array);
411 }
412
413
414
415
416
417
418 public int getSchemaDifferencesCount(
419 ) {
420 return this._schemaDifferencesList.size();
421 }
422
423
424
425
426
427
428 public boolean getSkip(
429 ) {
430 return this._skip;
431 }
432
433
434
435
436
437
438 public org.exolab.castor.tests.framework.testDescriptor.UnitTestCaseChoice getUnitTestCaseChoice(
439 ) {
440 return this._unitTestCaseChoice;
441 }
442
443
444
445
446
447
448 public boolean hasGenerateImported(
449 ) {
450 return this._has_generateImported;
451 }
452
453
454
455
456
457
458 public boolean hasJavaSourceVersion(
459 ) {
460 return this._has_javaSourceVersion;
461 }
462
463
464
465
466
467
468 public boolean hasSkip(
469 ) {
470 return this._has_skip;
471 }
472
473
474
475
476
477
478 public boolean isGenerateImported(
479 ) {
480 return this._generateImported;
481 }
482
483
484
485
486
487
488 public boolean isSkip(
489 ) {
490 return this._skip;
491 }
492
493
494
495
496
497
498 public boolean isValid(
499 ) {
500 try {
501 validate();
502 } catch (org.exolab.castor.xml.ValidationException vex) {
503 return false;
504 }
505 return true;
506 }
507
508
509
510
511
512
513
514 public java.util.Iterator iterateComment(
515 ) {
516 return this._commentList.iterator();
517 }
518
519
520
521
522
523
524
525 public java.util.Iterator iterateSchemaDifferences(
526 ) {
527 return this._schemaDifferencesList.iterator();
528 }
529
530
531
532
533
534
535
536
537
538
539 public void marshal(
540 final java.io.Writer out)
541 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
542 org.exolab.castor.xml.Marshaller.marshal(this, out);
543 }
544
545
546
547
548
549
550
551
552
553
554
555
556 public void marshal(
557 final org.xml.sax.ContentHandler handler)
558 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
559 org.exolab.castor.xml.Marshaller.marshal(this, handler);
560 }
561
562
563
564 public void removeAllComment(
565 ) {
566 this._commentList.clear();
567 }
568
569
570
571 public void removeAllSchemaDifferences(
572 ) {
573 this._schemaDifferencesList.clear();
574 }
575
576
577
578
579
580
581
582 public boolean removeComment(
583 final java.lang.String vComment) {
584 boolean removed = _commentList.remove(vComment);
585 return removed;
586 }
587
588
589
590
591
592
593
594 public java.lang.String removeCommentAt(
595 final int index) {
596 java.lang.Object obj = this._commentList.remove(index);
597 return (java.lang.String) obj;
598 }
599
600
601
602
603
604
605
606 public boolean removeSchemaDifferences(
607 final org.exolab.castor.tests.framework.testDescriptor.SchemaDifferences vSchemaDifferences) {
608 boolean removed = _schemaDifferencesList.remove(vSchemaDifferences);
609 return removed;
610 }
611
612
613
614
615
616
617
618 public org.exolab.castor.tests.framework.testDescriptor.SchemaDifferences removeSchemaDifferencesAt(
619 final int index) {
620 java.lang.Object obj = this._schemaDifferencesList.remove(index);
621 return (org.exolab.castor.tests.framework.testDescriptor.SchemaDifferences) obj;
622 }
623
624
625
626
627
628
629
630
631
632 public void setComment(
633 final int index,
634 final java.lang.String vComment)
635 throws java.lang.IndexOutOfBoundsException {
636
637 if (index < 0 || index >= this._commentList.size()) {
638 throw new IndexOutOfBoundsException("setComment: Index value '" + index + "' not in range [0.." + (this._commentList.size() - 1) + "]");
639 }
640
641 this._commentList.set(index, vComment);
642 }
643
644
645
646
647
648
649 public void setComment(
650 final java.lang.String[] vCommentArray) {
651
652 _commentList.clear();
653
654 for (int i = 0; i < vCommentArray.length; i++) {
655 this._commentList.add(vCommentArray[i]);
656 }
657 }
658
659
660
661
662
663
664 public void setConfiguration(
665 final org.exolab.castor.tests.framework.testDescriptor.Configuration configuration) {
666 this._configuration = configuration;
667 }
668
669
670
671
672
673
674 public void setCustomTest(
675 final org.exolab.castor.tests.framework.testDescriptor.CustomTest customTest) {
676 this._customTest = customTest;
677 }
678
679
680
681
682
683
684 public void setFailure(
685 final org.exolab.castor.tests.framework.testDescriptor.Failure failure) {
686 this._failure = failure;
687 }
688
689
690
691
692
693
694 public void setGenerateImported(
695 final boolean generateImported) {
696 this._generateImported = generateImported;
697 this._has_generateImported = true;
698 }
699
700
701
702
703
704
705 public void setGoldFile(
706 final java.lang.String goldFile) {
707 this._goldFile = goldFile;
708 }
709
710
711
712
713
714
715 public void setInput(
716 final java.lang.String input) {
717 this._input = input;
718 }
719
720
721
722
723
724
725
726 public void setJavaSourceVersion(
727 final float javaSourceVersion) {
728 this._javaSourceVersion = javaSourceVersion;
729 this._has_javaSourceVersion = true;
730 }
731
732
733
734
735
736
737 public void setListener(
738 final org.exolab.castor.tests.framework.testDescriptor.Listener listener) {
739 this._listener = listener;
740 }
741
742
743
744
745
746
747 public void setName(
748 final java.lang.String name) {
749 this._name = name;
750 }
751
752
753
754
755
756
757 public void setObjectBuilder(
758 final java.lang.String objectBuilder) {
759 this._objectBuilder = objectBuilder;
760 }
761
762
763
764
765
766
767
768
769
770 public void setSchemaDifferences(
771 final int index,
772 final org.exolab.castor.tests.framework.testDescriptor.SchemaDifferences vSchemaDifferences)
773 throws java.lang.IndexOutOfBoundsException {
774
775 if (index < 0 || index >= this._schemaDifferencesList.size()) {
776 throw new IndexOutOfBoundsException("setSchemaDifferences: Index value '" + index + "' not in range [0.." + (this._schemaDifferencesList.size() - 1) + "]");
777 }
778
779 this._schemaDifferencesList.set(index, vSchemaDifferences);
780 }
781
782
783
784
785
786
787 public void setSchemaDifferences(
788 final org.exolab.castor.tests.framework.testDescriptor.SchemaDifferences[] vSchemaDifferencesArray) {
789
790 _schemaDifferencesList.clear();
791
792 for (int i = 0; i < vSchemaDifferencesArray.length; i++) {
793 this._schemaDifferencesList.add(vSchemaDifferencesArray[i]);
794 }
795 }
796
797
798
799
800
801
802 public void setSkip(
803 final boolean skip) {
804 this._skip = skip;
805 this._has_skip = true;
806 }
807
808
809
810
811
812
813
814 public void setUnitTestCaseChoice(
815 final org.exolab.castor.tests.framework.testDescriptor.UnitTestCaseChoice unitTestCaseChoice) {
816 this._unitTestCaseChoice = unitTestCaseChoice;
817 }
818
819
820
821
822
823
824
825
826
827
828
829
830 public static org.exolab.castor.tests.framework.testDescriptor.UnitTestCase unmarshal(
831 final java.io.Reader reader)
832 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
833 return (org.exolab.castor.tests.framework.testDescriptor.UnitTestCase) org.exolab.castor.xml.Unmarshaller.unmarshal(org.exolab.castor.tests.framework.testDescriptor.UnitTestCase.class, reader);
834 }
835
836
837
838
839
840
841
842 public void validate(
843 )
844 throws org.exolab.castor.xml.ValidationException {
845 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
846 validator.validate(this);
847 }
848
849 }