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