1
2
3
4
5
6
7
8 package org.exolab.castor.tests.framework.testDescriptor;
9
10
11
12
13
14
15
16
17
18 public class SourceGeneratorTest implements java.io.Serializable {
19
20
21
22
23
24
25
26
27
28 private java.util.List _schemaList;
29
30
31
32
33 private java.lang.String _property_File;
34
35
36
37
38
39 private org.exolab.castor.tests.framework.testDescriptor.types.CollectionType _collection = org.exolab.castor.tests.framework.testDescriptor.types.CollectionType.valueOf("vector");
40
41
42
43
44 private java.lang.String _bindingFile;
45
46
47
48
49 private java.lang.String _package;
50
51
52
53
54
55
56 private org.exolab.castor.tests.framework.testDescriptor.Root_Object _root_Object;
57
58
59
60
61 private org.exolab.castor.tests.framework.testDescriptor.ExpectedSources _expectedSources;
62
63
64
65
66 private org.exolab.castor.tests.framework.testDescriptor.SourcesNotExpected _sourcesNotExpected;
67
68
69
70
71
72 private java.util.List _unitTestCaseList;
73
74
75
76
77
78
79 public SourceGeneratorTest() {
80 super();
81 this._schemaList = new java.util.ArrayList();
82 setCollection(org.exolab.castor.tests.framework.testDescriptor.types.CollectionType.valueOf("vector"));
83 this._unitTestCaseList = new java.util.ArrayList();
84 }
85
86
87
88
89
90
91
92
93
94
95
96
97
98 public void addSchema(
99 final java.lang.String vSchema)
100 throws java.lang.IndexOutOfBoundsException {
101 this._schemaList.add(vSchema);
102 }
103
104
105
106
107
108
109
110
111
112 public void addSchema(
113 final int index,
114 final java.lang.String vSchema)
115 throws java.lang.IndexOutOfBoundsException {
116 this._schemaList.add(index, vSchema);
117 }
118
119
120
121
122
123
124
125
126 public void addUnitTestCase(
127 final org.exolab.castor.tests.framework.testDescriptor.UnitTestCase vUnitTestCase)
128 throws java.lang.IndexOutOfBoundsException {
129 this._unitTestCaseList.add(vUnitTestCase);
130 }
131
132
133
134
135
136
137
138
139
140 public void addUnitTestCase(
141 final int index,
142 final org.exolab.castor.tests.framework.testDescriptor.UnitTestCase vUnitTestCase)
143 throws java.lang.IndexOutOfBoundsException {
144 this._unitTestCaseList.add(index, vUnitTestCase);
145 }
146
147
148
149
150
151
152
153 public java.util.Enumeration enumerateSchema(
154 ) {
155 return java.util.Collections.enumeration(this._schemaList);
156 }
157
158
159
160
161
162
163
164 public java.util.Enumeration enumerateUnitTestCase(
165 ) {
166 return java.util.Collections.enumeration(this._unitTestCaseList);
167 }
168
169
170
171
172
173
174 public java.lang.String getBindingFile(
175 ) {
176 return this._bindingFile;
177 }
178
179
180
181
182
183
184
185
186
187 public org.exolab.castor.tests.framework.testDescriptor.types.CollectionType getCollection(
188 ) {
189 return this._collection;
190 }
191
192
193
194
195
196
197 public org.exolab.castor.tests.framework.testDescriptor.ExpectedSources getExpectedSources(
198 ) {
199 return this._expectedSources;
200 }
201
202
203
204
205
206
207 public java.lang.String getPackage(
208 ) {
209 return this._package;
210 }
211
212
213
214
215
216
217 public java.lang.String getProperty_File(
218 ) {
219 return this._property_File;
220 }
221
222
223
224
225
226
227
228
229
230
231 public org.exolab.castor.tests.framework.testDescriptor.Root_Object getRoot_Object(
232 ) {
233 return this._root_Object;
234 }
235
236
237
238
239
240
241
242
243
244 public java.lang.String getSchema(
245 final int index)
246 throws java.lang.IndexOutOfBoundsException {
247
248 if (index < 0 || index >= this._schemaList.size()) {
249 throw new IndexOutOfBoundsException("getSchema: Index value '" + index + "' not in range [0.." + (this._schemaList.size() - 1) + "]");
250 }
251
252 return (java.lang.String) _schemaList.get(index);
253 }
254
255
256
257
258
259
260
261
262
263
264 public java.lang.String[] getSchema(
265 ) {
266 java.lang.String[] array = new java.lang.String[0];
267 return (java.lang.String[]) this._schemaList.toArray(array);
268 }
269
270
271
272
273
274
275 public int getSchemaCount(
276 ) {
277 return this._schemaList.size();
278 }
279
280
281
282
283
284
285 public org.exolab.castor.tests.framework.testDescriptor.SourcesNotExpected getSourcesNotExpected(
286 ) {
287 return this._sourcesNotExpected;
288 }
289
290
291
292
293
294
295
296
297
298
299
300 public org.exolab.castor.tests.framework.testDescriptor.UnitTestCase getUnitTestCase(
301 final int index)
302 throws java.lang.IndexOutOfBoundsException {
303
304 if (index < 0 || index >= this._unitTestCaseList.size()) {
305 throw new IndexOutOfBoundsException("getUnitTestCase: Index value '" + index + "' not in range [0.." + (this._unitTestCaseList.size() - 1) + "]");
306 }
307
308 return (org.exolab.castor.tests.framework.testDescriptor.UnitTestCase) _unitTestCaseList.get(index);
309 }
310
311
312
313
314
315
316
317
318
319
320
321 public org.exolab.castor.tests.framework.testDescriptor.UnitTestCase[] getUnitTestCase(
322 ) {
323 org.exolab.castor.tests.framework.testDescriptor.UnitTestCase[] array = new org.exolab.castor.tests.framework.testDescriptor.UnitTestCase[0];
324 return (org.exolab.castor.tests.framework.testDescriptor.UnitTestCase[]) this._unitTestCaseList.toArray(array);
325 }
326
327
328
329
330
331
332 public int getUnitTestCaseCount(
333 ) {
334 return this._unitTestCaseList.size();
335 }
336
337
338
339
340
341
342 public boolean isValid(
343 ) {
344 try {
345 validate();
346 } catch (org.exolab.castor.xml.ValidationException vex) {
347 return false;
348 }
349 return true;
350 }
351
352
353
354
355
356
357
358 public java.util.Iterator iterateSchema(
359 ) {
360 return this._schemaList.iterator();
361 }
362
363
364
365
366
367
368
369 public java.util.Iterator iterateUnitTestCase(
370 ) {
371 return this._unitTestCaseList.iterator();
372 }
373
374
375
376
377
378
379
380
381
382
383 public void marshal(
384 final java.io.Writer out)
385 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
386 org.exolab.castor.xml.Marshaller.marshal(this, out);
387 }
388
389
390
391
392
393
394
395
396
397
398
399
400 public void marshal(
401 final org.xml.sax.ContentHandler handler)
402 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
403 org.exolab.castor.xml.Marshaller.marshal(this, handler);
404 }
405
406
407
408 public void removeAllSchema(
409 ) {
410 this._schemaList.clear();
411 }
412
413
414
415 public void removeAllUnitTestCase(
416 ) {
417 this._unitTestCaseList.clear();
418 }
419
420
421
422
423
424
425
426 public boolean removeSchema(
427 final java.lang.String vSchema) {
428 boolean removed = _schemaList.remove(vSchema);
429 return removed;
430 }
431
432
433
434
435
436
437
438 public java.lang.String removeSchemaAt(
439 final int index) {
440 java.lang.Object obj = this._schemaList.remove(index);
441 return (java.lang.String) obj;
442 }
443
444
445
446
447
448
449
450 public boolean removeUnitTestCase(
451 final org.exolab.castor.tests.framework.testDescriptor.UnitTestCase vUnitTestCase) {
452 boolean removed = _unitTestCaseList.remove(vUnitTestCase);
453 return removed;
454 }
455
456
457
458
459
460
461
462 public org.exolab.castor.tests.framework.testDescriptor.UnitTestCase removeUnitTestCaseAt(
463 final int index) {
464 java.lang.Object obj = this._unitTestCaseList.remove(index);
465 return (org.exolab.castor.tests.framework.testDescriptor.UnitTestCase) obj;
466 }
467
468
469
470
471
472
473 public void setBindingFile(
474 final java.lang.String bindingFile) {
475 this._bindingFile = bindingFile;
476 }
477
478
479
480
481
482
483
484
485
486 public void setCollection(
487 final org.exolab.castor.tests.framework.testDescriptor.types.CollectionType collection) {
488 this._collection = collection;
489 }
490
491
492
493
494
495
496 public void setExpectedSources(
497 final org.exolab.castor.tests.framework.testDescriptor.ExpectedSources expectedSources) {
498 this._expectedSources = expectedSources;
499 }
500
501
502
503
504
505
506
507 public void setPackage(
508 final java.lang.String _package) {
509 this._package = _package;
510 }
511
512
513
514
515
516
517 public void setProperty_File(
518 final java.lang.String property_File) {
519 this._property_File = property_File;
520 }
521
522
523
524
525
526
527
528
529
530
531 public void setRoot_Object(
532 final org.exolab.castor.tests.framework.testDescriptor.Root_Object root_Object) {
533 this._root_Object = root_Object;
534 }
535
536
537
538
539
540
541
542
543
544 public void setSchema(
545 final int index,
546 final java.lang.String vSchema)
547 throws java.lang.IndexOutOfBoundsException {
548
549 if (index < 0 || index >= this._schemaList.size()) {
550 throw new IndexOutOfBoundsException("setSchema: Index value '" + index + "' not in range [0.." + (this._schemaList.size() - 1) + "]");
551 }
552
553 this._schemaList.set(index, vSchema);
554 }
555
556
557
558
559
560
561 public void setSchema(
562 final java.lang.String[] vSchemaArray) {
563
564 _schemaList.clear();
565
566 for (int i = 0; i < vSchemaArray.length; i++) {
567 this._schemaList.add(vSchemaArray[i]);
568 }
569 }
570
571
572
573
574
575
576
577 public void setSourcesNotExpected(
578 final org.exolab.castor.tests.framework.testDescriptor.SourcesNotExpected sourcesNotExpected) {
579 this._sourcesNotExpected = sourcesNotExpected;
580 }
581
582
583
584
585
586
587
588
589
590 public void setUnitTestCase(
591 final int index,
592 final org.exolab.castor.tests.framework.testDescriptor.UnitTestCase vUnitTestCase)
593 throws java.lang.IndexOutOfBoundsException {
594
595 if (index < 0 || index >= this._unitTestCaseList.size()) {
596 throw new IndexOutOfBoundsException("setUnitTestCase: Index value '" + index + "' not in range [0.." + (this._unitTestCaseList.size() - 1) + "]");
597 }
598
599 this._unitTestCaseList.set(index, vUnitTestCase);
600 }
601
602
603
604
605
606
607 public void setUnitTestCase(
608 final org.exolab.castor.tests.framework.testDescriptor.UnitTestCase[] vUnitTestCaseArray) {
609
610 _unitTestCaseList.clear();
611
612 for (int i = 0; i < vUnitTestCaseArray.length; i++) {
613 this._unitTestCaseList.add(vUnitTestCaseArray[i]);
614 }
615 }
616
617
618
619
620
621
622
623
624
625
626
627
628 public static org.exolab.castor.tests.framework.testDescriptor.SourceGeneratorTest unmarshal(
629 final java.io.Reader reader)
630 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
631 return (org.exolab.castor.tests.framework.testDescriptor.SourceGeneratorTest) org.exolab.castor.xml.Unmarshaller.unmarshal(org.exolab.castor.tests.framework.testDescriptor.SourceGeneratorTest.class, reader);
632 }
633
634
635
636
637
638
639
640 public void validate(
641 )
642 throws org.exolab.castor.xml.ValidationException {
643 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
644 validator.validate(this);
645 }
646
647 }