View Javadoc
1   /*
2    * This class was automatically generated with 
3    * <a href="http://www.castor.org">Castor 1.3.1</a>, using an XML
4    * Schema.
5    * $Id$
6    */
7   
8   package org.exolab.castor.tests.framework.testDescriptor;
9   
10  /**
11   * A definition of a single Unit Test testcase.
12   *  
13   * 
14   * @version $Revision$ $Date$
15   */
16  public class UnitTestCase implements java.io.Serializable {
17  
18  
19        //--------------------------/
20       //- Class/Member Variables -/
21      //--------------------------/
22  
23      /**
24       * Field _name.
25       */
26      private java.lang.String _name;
27  
28      /**
29       * Field _unitTestCaseChoice.
30       */
31      private org.exolab.castor.tests.framework.testDescriptor.UnitTestCaseChoice _unitTestCaseChoice;
32  
33      /**
34       * Field _customTest.
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       * Field _input.
44       */
45      private java.lang.String _input;
46  
47      /**
48       * Field _goldFile.
49       */
50      private java.lang.String _goldFile;
51  
52      /**
53       * Field _objectBuilder.
54       */
55      private java.lang.String _objectBuilder;
56  
57      /**
58       * Field _failure.
59       */
60      private org.exolab.castor.tests.framework.testDescriptor.Failure _failure;
61  
62      /**
63       * Field _skip.
64       */
65      private boolean _skip;
66  
67      /**
68       * keeps track of state for field: _skip
69       */
70      private boolean _has_skip;
71  
72      /**
73       * Field _listener.
74       */
75      private org.exolab.castor.tests.framework.testDescriptor.Listener _listener;
76  
77      /**
78       * Field _schemaDifferencesList.
79       */
80      private java.util.List _schemaDifferencesList;
81  
82      /**
83       * Field _commentList.
84       */
85      private java.util.List _commentList;
86  
87      /**
88       * Field _javaSourceVersion.
89       */
90      private float _javaSourceVersion;
91  
92      /**
93       * keeps track of state for field: _javaSourceVersion
94       */
95      private boolean _has_javaSourceVersion;
96  
97      /**
98       * Field _generateImported.
99       */
100     private boolean _generateImported;
101 
102     /**
103      * keeps track of state for field: _generateImported
104      */
105     private boolean _has_generateImported;
106 
107 
108       //----------------/
109      //- Constructors -/
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      //- Methods -/
121     //-----------/
122 
123     /**
124      * 
125      * 
126      * @param vComment
127      * @throws java.lang.IndexOutOfBoundsException if the index
128      * given is outside the bounds of the collection
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      * @param index
140      * @param vComment
141      * @throws java.lang.IndexOutOfBoundsException if the index
142      * given is outside the bounds of the collection
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      * @param vSchemaDifferences
155      * @throws java.lang.IndexOutOfBoundsException if the index
156      * given is outside the bounds of the collection
157      */
158     public void addSchemaDifferences(
159             final org.exolab.castor.tests.framework.testDescriptor.SchemaDifferences vSchemaDifferences)
160     throws java.lang.IndexOutOfBoundsException {
161         // check for the maximum size
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      * @param index
173      * @param vSchemaDifferences
174      * @throws java.lang.IndexOutOfBoundsException if the index
175      * given is outside the bounds of the collection
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         // check for the maximum size
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      * Method enumerateComment.
212      * 
213      * @return an Enumeration over all possible elements of this
214      * collection
215      */
216     public java.util.Enumeration enumerateComment(
217     ) {
218         return java.util.Collections.enumeration(this._commentList);
219     }
220 
221     /**
222      * Method enumerateSchemaDifferences.
223      * 
224      * @return an Enumeration over all possible elements of this
225      * collection
226      */
227     public java.util.Enumeration enumerateSchemaDifferences(
228     ) {
229         return java.util.Collections.enumeration(this._schemaDifferencesList);
230     }
231 
232     /**
233      * Method getComment.
234      * 
235      * @param index
236      * @throws java.lang.IndexOutOfBoundsException if the index
237      * given is outside the bounds of the collection
238      * @return the value of the java.lang.String at the given index
239      */
240     public java.lang.String getComment(
241             final int index)
242     throws java.lang.IndexOutOfBoundsException {
243         // check bounds for index
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      * Method getComment.Returns the contents of the collection in
253      * an Array.  <p>Note:  Just in case the collection contents
254      * are changing in another thread, we pass a 0-length Array of
255      * the correct type into the API call.  This way we <i>know</i>
256      * that the Array returned is of exactly the correct length.
257      * 
258      * @return this collection as an Array
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      * Method getCommentCount.
268      * 
269      * @return the size of this collection
270      */
271     public int getCommentCount(
272     ) {
273         return this._commentList.size();
274     }
275 
276     /**
277      * Returns the value of field 'configuration'.
278      * 
279      * @return the value of field 'Configuration'.
280      */
281     public org.exolab.castor.tests.framework.testDescriptor.Configuration getConfiguration(
282     ) {
283         return this._configuration;
284     }
285 
286     /**
287      * Returns the value of field 'customTest'.
288      * 
289      * @return the value of field 'CustomTest'.
290      */
291     public org.exolab.castor.tests.framework.testDescriptor.CustomTest getCustomTest(
292     ) {
293         return this._customTest;
294     }
295 
296     /**
297      * Returns the value of field 'failure'.
298      * 
299      * @return the value of field 'Failure'.
300      */
301     public org.exolab.castor.tests.framework.testDescriptor.Failure getFailure(
302     ) {
303         return this._failure;
304     }
305 
306     /**
307      * Returns the value of field 'generateImported'.
308      * 
309      * @return the value of field 'GenerateImported'.
310      */
311     public boolean getGenerateImported(
312     ) {
313         return this._generateImported;
314     }
315 
316     /**
317      * Returns the value of field 'goldFile'.
318      * 
319      * @return the value of field 'GoldFile'.
320      */
321     public java.lang.String getGoldFile(
322     ) {
323         return this._goldFile;
324     }
325 
326     /**
327      * Returns the value of field 'input'.
328      * 
329      * @return the value of field 'Input'.
330      */
331     public java.lang.String getInput(
332     ) {
333         return this._input;
334     }
335 
336     /**
337      * Returns the value of field 'javaSourceVersion'.
338      * 
339      * @return the value of field 'JavaSourceVersion'.
340      */
341     public float getJavaSourceVersion(
342     ) {
343         return this._javaSourceVersion;
344     }
345 
346     /**
347      * Returns the value of field 'listener'.
348      * 
349      * @return the value of field 'Listener'.
350      */
351     public org.exolab.castor.tests.framework.testDescriptor.Listener getListener(
352     ) {
353         return this._listener;
354     }
355 
356     /**
357      * Returns the value of field 'name'.
358      * 
359      * @return the value of field 'Name'.
360      */
361     public java.lang.String getName(
362     ) {
363         return this._name;
364     }
365 
366     /**
367      * Returns the value of field 'objectBuilder'.
368      * 
369      * @return the value of field 'ObjectBuilder'.
370      */
371     public java.lang.String getObjectBuilder(
372     ) {
373         return this._objectBuilder;
374     }
375 
376     /**
377      * Method getSchemaDifferences.
378      * 
379      * @param index
380      * @throws java.lang.IndexOutOfBoundsException if the index
381      * given is outside the bounds of the collection
382      * @return the value of the
383      * org.exolab.castor.tests.framework.testDescriptor.SchemaDifferences
384      * at the given index
385      */
386     public org.exolab.castor.tests.framework.testDescriptor.SchemaDifferences getSchemaDifferences(
387             final int index)
388     throws java.lang.IndexOutOfBoundsException {
389         // check bounds for index
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      * Method getSchemaDifferences.Returns the contents of the
399      * collection in an Array.  <p>Note:  Just in case the
400      * collection contents are changing in another thread, we pass
401      * a 0-length Array of the correct type into the API call. 
402      * This way we <i>know</i> that the Array returned is of
403      * exactly the correct length.
404      * 
405      * @return this collection as an Array
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      * Method getSchemaDifferencesCount.
415      * 
416      * @return the size of this collection
417      */
418     public int getSchemaDifferencesCount(
419     ) {
420         return this._schemaDifferencesList.size();
421     }
422 
423     /**
424      * Returns the value of field 'skip'.
425      * 
426      * @return the value of field 'Skip'.
427      */
428     public boolean getSkip(
429     ) {
430         return this._skip;
431     }
432 
433     /**
434      * Returns the value of field 'unitTestCaseChoice'.
435      * 
436      * @return the value of field 'UnitTestCaseChoice'.
437      */
438     public org.exolab.castor.tests.framework.testDescriptor.UnitTestCaseChoice getUnitTestCaseChoice(
439     ) {
440         return this._unitTestCaseChoice;
441     }
442 
443     /**
444      * Method hasGenerateImported.
445      * 
446      * @return true if at least one GenerateImported has been added
447      */
448     public boolean hasGenerateImported(
449     ) {
450         return this._has_generateImported;
451     }
452 
453     /**
454      * Method hasJavaSourceVersion.
455      * 
456      * @return true if at least one JavaSourceVersion has been added
457      */
458     public boolean hasJavaSourceVersion(
459     ) {
460         return this._has_javaSourceVersion;
461     }
462 
463     /**
464      * Method hasSkip.
465      * 
466      * @return true if at least one Skip has been added
467      */
468     public boolean hasSkip(
469     ) {
470         return this._has_skip;
471     }
472 
473     /**
474      * Returns the value of field 'generateImported'.
475      * 
476      * @return the value of field 'GenerateImported'.
477      */
478     public boolean isGenerateImported(
479     ) {
480         return this._generateImported;
481     }
482 
483     /**
484      * Returns the value of field 'skip'.
485      * 
486      * @return the value of field 'Skip'.
487      */
488     public boolean isSkip(
489     ) {
490         return this._skip;
491     }
492 
493     /**
494      * Method isValid.
495      * 
496      * @return true if this object is valid according to the schema
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      * Method iterateComment.
510      * 
511      * @return an Iterator over all possible elements in this
512      * collection
513      */
514     public java.util.Iterator iterateComment(
515     ) {
516         return this._commentList.iterator();
517     }
518 
519     /**
520      * Method iterateSchemaDifferences.
521      * 
522      * @return an Iterator over all possible elements in this
523      * collection
524      */
525     public java.util.Iterator iterateSchemaDifferences(
526     ) {
527         return this._schemaDifferencesList.iterator();
528     }
529 
530     /**
531      * 
532      * 
533      * @param out
534      * @throws org.exolab.castor.xml.MarshalException if object is
535      * null or if any SAXException is thrown during marshaling
536      * @throws org.exolab.castor.xml.ValidationException if this
537      * object is an invalid instance according to the schema
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      * @param handler
549      * @throws java.io.IOException if an IOException occurs during
550      * marshaling
551      * @throws org.exolab.castor.xml.ValidationException if this
552      * object is an invalid instance according to the schema
553      * @throws org.exolab.castor.xml.MarshalException if object is
554      * null or if any SAXException is thrown during marshaling
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      * Method removeComment.
578      * 
579      * @param vComment
580      * @return true if the object was removed from the collection.
581      */
582     public boolean removeComment(
583             final java.lang.String vComment) {
584         boolean removed = _commentList.remove(vComment);
585         return removed;
586     }
587 
588     /**
589      * Method removeCommentAt.
590      * 
591      * @param index
592      * @return the element removed from the collection
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      * Method removeSchemaDifferences.
602      * 
603      * @param vSchemaDifferences
604      * @return true if the object was removed from the collection.
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      * Method removeSchemaDifferencesAt.
614      * 
615      * @param index
616      * @return the element removed from the collection
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      * @param index
628      * @param vComment
629      * @throws java.lang.IndexOutOfBoundsException if the index
630      * given is outside the bounds of the collection
631      */
632     public void setComment(
633             final int index,
634             final java.lang.String vComment)
635     throws java.lang.IndexOutOfBoundsException {
636         // check bounds for index
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      * @param vCommentArray
648      */
649     public void setComment(
650             final java.lang.String[] vCommentArray) {
651         //-- copy array
652         _commentList.clear();
653 
654         for (int i = 0; i < vCommentArray.length; i++) {
655                 this._commentList.add(vCommentArray[i]);
656         }
657     }
658 
659     /**
660      * Sets the value of field 'configuration'.
661      * 
662      * @param configuration the value of field 'configuration'.
663      */
664     public void setConfiguration(
665             final org.exolab.castor.tests.framework.testDescriptor.Configuration configuration) {
666         this._configuration = configuration;
667     }
668 
669     /**
670      * Sets the value of field 'customTest'.
671      * 
672      * @param customTest the value of field 'customTest'.
673      */
674     public void setCustomTest(
675             final org.exolab.castor.tests.framework.testDescriptor.CustomTest customTest) {
676         this._customTest = customTest;
677     }
678 
679     /**
680      * Sets the value of field 'failure'.
681      * 
682      * @param failure the value of field 'failure'.
683      */
684     public void setFailure(
685             final org.exolab.castor.tests.framework.testDescriptor.Failure failure) {
686         this._failure = failure;
687     }
688 
689     /**
690      * Sets the value of field 'generateImported'.
691      * 
692      * @param generateImported the value of field 'generateImported'
693      */
694     public void setGenerateImported(
695             final boolean generateImported) {
696         this._generateImported = generateImported;
697         this._has_generateImported = true;
698     }
699 
700     /**
701      * Sets the value of field 'goldFile'.
702      * 
703      * @param goldFile the value of field 'goldFile'.
704      */
705     public void setGoldFile(
706             final java.lang.String goldFile) {
707         this._goldFile = goldFile;
708     }
709 
710     /**
711      * Sets the value of field 'input'.
712      * 
713      * @param input the value of field 'input'.
714      */
715     public void setInput(
716             final java.lang.String input) {
717         this._input = input;
718     }
719 
720     /**
721      * Sets the value of field 'javaSourceVersion'.
722      * 
723      * @param javaSourceVersion the value of field
724      * 'javaSourceVersion'.
725      */
726     public void setJavaSourceVersion(
727             final float javaSourceVersion) {
728         this._javaSourceVersion = javaSourceVersion;
729         this._has_javaSourceVersion = true;
730     }
731 
732     /**
733      * Sets the value of field 'listener'.
734      * 
735      * @param listener the value of field 'listener'.
736      */
737     public void setListener(
738             final org.exolab.castor.tests.framework.testDescriptor.Listener listener) {
739         this._listener = listener;
740     }
741 
742     /**
743      * Sets the value of field 'name'.
744      * 
745      * @param name the value of field 'name'.
746      */
747     public void setName(
748             final java.lang.String name) {
749         this._name = name;
750     }
751 
752     /**
753      * Sets the value of field 'objectBuilder'.
754      * 
755      * @param objectBuilder the value of field 'objectBuilder'.
756      */
757     public void setObjectBuilder(
758             final java.lang.String objectBuilder) {
759         this._objectBuilder = objectBuilder;
760     }
761 
762     /**
763      * 
764      * 
765      * @param index
766      * @param vSchemaDifferences
767      * @throws java.lang.IndexOutOfBoundsException if the index
768      * given is outside the bounds of the collection
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         // check bounds for index
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      * @param vSchemaDifferencesArray
786      */
787     public void setSchemaDifferences(
788             final org.exolab.castor.tests.framework.testDescriptor.SchemaDifferences[] vSchemaDifferencesArray) {
789         //-- copy array
790         _schemaDifferencesList.clear();
791 
792         for (int i = 0; i < vSchemaDifferencesArray.length; i++) {
793                 this._schemaDifferencesList.add(vSchemaDifferencesArray[i]);
794         }
795     }
796 
797     /**
798      * Sets the value of field 'skip'.
799      * 
800      * @param skip the value of field 'skip'.
801      */
802     public void setSkip(
803             final boolean skip) {
804         this._skip = skip;
805         this._has_skip = true;
806     }
807 
808     /**
809      * Sets the value of field 'unitTestCaseChoice'.
810      * 
811      * @param unitTestCaseChoice the value of field
812      * 'unitTestCaseChoice'.
813      */
814     public void setUnitTestCaseChoice(
815             final org.exolab.castor.tests.framework.testDescriptor.UnitTestCaseChoice unitTestCaseChoice) {
816         this._unitTestCaseChoice = unitTestCaseChoice;
817     }
818 
819     /**
820      * Method unmarshal.
821      * 
822      * @param reader
823      * @throws org.exolab.castor.xml.MarshalException if object is
824      * null or if any SAXException is thrown during marshaling
825      * @throws org.exolab.castor.xml.ValidationException if this
826      * object is an invalid instance according to the schema
827      * @return the unmarshaled
828      * org.exolab.castor.tests.framework.testDescriptor.UnitTestCase
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      * @throws org.exolab.castor.xml.ValidationException if this
840      * object is an invalid instance according to the schema
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 }