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 MarshallingTest implements java.io.Serializable {
17
18
19
20
21
22
23
24
25
26
27
28 private org.exolab.castor.tests.framework.testDescriptor.Root_Object _root_Object;
29
30
31
32 private org.exolab.castor.tests.framework.testDescriptor.Configuration _configuration;
33
34
35
36
37
38 private java.util.List _unitTestCaseList;
39
40
41
42
43
44
45 public MarshallingTest() {
46 super();
47 this._unitTestCaseList = new java.util.ArrayList();
48 }
49
50
51
52
53
54
55
56
57
58
59
60
61
62 public void addUnitTestCase(
63 final org.exolab.castor.tests.framework.testDescriptor.UnitTestCase vUnitTestCase)
64 throws java.lang.IndexOutOfBoundsException {
65 this._unitTestCaseList.add(vUnitTestCase);
66 }
67
68
69
70
71
72
73
74
75
76 public void addUnitTestCase(
77 final int index,
78 final org.exolab.castor.tests.framework.testDescriptor.UnitTestCase vUnitTestCase)
79 throws java.lang.IndexOutOfBoundsException {
80 this._unitTestCaseList.add(index, vUnitTestCase);
81 }
82
83
84
85
86
87
88
89 public java.util.Enumeration enumerateUnitTestCase(
90 ) {
91 return java.util.Collections.enumeration(this._unitTestCaseList);
92 }
93
94
95
96
97
98
99 public org.exolab.castor.tests.framework.testDescriptor.Configuration getConfiguration(
100 ) {
101 return this._configuration;
102 }
103
104
105
106
107
108
109
110
111
112
113 public org.exolab.castor.tests.framework.testDescriptor.Root_Object getRoot_Object(
114 ) {
115 return this._root_Object;
116 }
117
118
119
120
121
122
123
124
125
126
127
128 public org.exolab.castor.tests.framework.testDescriptor.UnitTestCase getUnitTestCase(
129 final int index)
130 throws java.lang.IndexOutOfBoundsException {
131
132 if (index < 0 || index >= this._unitTestCaseList.size()) {
133 throw new IndexOutOfBoundsException("getUnitTestCase: Index value '" + index + "' not in range [0.." + (this._unitTestCaseList.size() - 1) + "]");
134 }
135
136 return (org.exolab.castor.tests.framework.testDescriptor.UnitTestCase) _unitTestCaseList.get(index);
137 }
138
139
140
141
142
143
144
145
146
147
148
149 public org.exolab.castor.tests.framework.testDescriptor.UnitTestCase[] getUnitTestCase(
150 ) {
151 org.exolab.castor.tests.framework.testDescriptor.UnitTestCase[] array = new org.exolab.castor.tests.framework.testDescriptor.UnitTestCase[0];
152 return (org.exolab.castor.tests.framework.testDescriptor.UnitTestCase[]) this._unitTestCaseList.toArray(array);
153 }
154
155
156
157
158
159
160 public int getUnitTestCaseCount(
161 ) {
162 return this._unitTestCaseList.size();
163 }
164
165
166
167
168
169
170 public boolean isValid(
171 ) {
172 try {
173 validate();
174 } catch (org.exolab.castor.xml.ValidationException vex) {
175 return false;
176 }
177 return true;
178 }
179
180
181
182
183
184
185
186 public java.util.Iterator iterateUnitTestCase(
187 ) {
188 return this._unitTestCaseList.iterator();
189 }
190
191
192
193
194
195
196
197
198
199
200 public void marshal(
201 final java.io.Writer out)
202 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
203 org.exolab.castor.xml.Marshaller.marshal(this, out);
204 }
205
206
207
208
209
210
211
212
213
214
215
216
217 public void marshal(
218 final org.xml.sax.ContentHandler handler)
219 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
220 org.exolab.castor.xml.Marshaller.marshal(this, handler);
221 }
222
223
224
225 public void removeAllUnitTestCase(
226 ) {
227 this._unitTestCaseList.clear();
228 }
229
230
231
232
233
234
235
236 public boolean removeUnitTestCase(
237 final org.exolab.castor.tests.framework.testDescriptor.UnitTestCase vUnitTestCase) {
238 boolean removed = _unitTestCaseList.remove(vUnitTestCase);
239 return removed;
240 }
241
242
243
244
245
246
247
248 public org.exolab.castor.tests.framework.testDescriptor.UnitTestCase removeUnitTestCaseAt(
249 final int index) {
250 java.lang.Object obj = this._unitTestCaseList.remove(index);
251 return (org.exolab.castor.tests.framework.testDescriptor.UnitTestCase) obj;
252 }
253
254
255
256
257
258
259 public void setConfiguration(
260 final org.exolab.castor.tests.framework.testDescriptor.Configuration configuration) {
261 this._configuration = configuration;
262 }
263
264
265
266
267
268
269
270
271
272
273 public void setRoot_Object(
274 final org.exolab.castor.tests.framework.testDescriptor.Root_Object root_Object) {
275 this._root_Object = root_Object;
276 }
277
278
279
280
281
282
283
284
285
286 public void setUnitTestCase(
287 final int index,
288 final org.exolab.castor.tests.framework.testDescriptor.UnitTestCase vUnitTestCase)
289 throws java.lang.IndexOutOfBoundsException {
290
291 if (index < 0 || index >= this._unitTestCaseList.size()) {
292 throw new IndexOutOfBoundsException("setUnitTestCase: Index value '" + index + "' not in range [0.." + (this._unitTestCaseList.size() - 1) + "]");
293 }
294
295 this._unitTestCaseList.set(index, vUnitTestCase);
296 }
297
298
299
300
301
302
303 public void setUnitTestCase(
304 final org.exolab.castor.tests.framework.testDescriptor.UnitTestCase[] vUnitTestCaseArray) {
305
306 _unitTestCaseList.clear();
307
308 for (int i = 0; i < vUnitTestCaseArray.length; i++) {
309 this._unitTestCaseList.add(vUnitTestCaseArray[i]);
310 }
311 }
312
313
314
315
316
317
318
319
320
321
322
323
324 public static org.exolab.castor.tests.framework.testDescriptor.MarshallingTest unmarshal(
325 final java.io.Reader reader)
326 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
327 return (org.exolab.castor.tests.framework.testDescriptor.MarshallingTest) org.exolab.castor.xml.Unmarshaller.unmarshal(org.exolab.castor.tests.framework.testDescriptor.MarshallingTest.class, reader);
328 }
329
330
331
332
333
334
335
336 public void validate(
337 )
338 throws org.exolab.castor.xml.ValidationException {
339 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
340 validator.validate(this);
341 }
342
343 }