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