1// XMLDocument_as.hx:  ActionScript 3 "XMLDocument" class, for Gnash.
2//
3// Generated by gen-as3.sh on: 20090514 by "rob". Remove this
4// after any hand editing loosing changes.
5//
6//   Copyright (C) 2009, 2010 Free Software Foundation, Inc.
7//
8// This program is free software; you can redistribute it and/or modify
9// it under the terms of the GNU General Public License as published by
10// the Free Software Foundation; either version 3 of the License, or
11// (at your option) any later version.
12//
13// This program is distributed in the hope that it will be useful,
14// but WITHOUT ANY WARRANTY; without even the implied warranty of
15// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16// GNU General Public License for more details.
17//
18// You should have received a copy of the GNU General Public License
19// along with this program; if not, write to the Free Software
20// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
21//
22
23// This test case must be processed by CPP before compiling to include the
24//  DejaGnu.hx header file for the testing framework support.
25
26#if flash9
27import flash.xml.XMLDocument;
28import flash.display.MovieClip;
29#else
30import flash.MovieClip;
31#end
32import flash.Lib;
33import Type;
34import Std;
35
36// import our testing API
37import DejaGnu;
38
39// Class must be named with the _as suffix, as that's the same name as the file.
40class XMLDocument_as {
41    static function main() {
42	#if flash9
43        var x1:XMLDocument = new XMLDocument();
44
45        // Make sure we actually get a valid class
46	if (Std.is(x1, XMLDocument)) {
47            DejaGnu.pass("XMLDocument class exists");
48        } else {
49            DejaGnu.fail("XMLDocument class doesn't exist");
50        }
51
52	// Tests to see if all the properties exist. All these do is test for
53	// existance of a property, and don't test the functionality at all. This
54	// is primarily useful only to test completeness of the API implementation.
55	if (Std.is(x1.docTypeDecl, Dynamic)) {
56 	    DejaGnu.pass("XMLDocument.docTypeDecl property exists");
57 	} else {
58 	    DejaGnu.fail("XMLDocument.docTypeDecl property doesn't exist");
59 	}
60	if (Std.is(x1.idMap, Dynamic)) {
61 	    DejaGnu.pass("XMLDocument.idMap property exists");
62 	} else {
63 	    DejaGnu.fail("XMLDocument.idMap property doesn't exist");
64 	}
65	if (Std.is(x1.ignoreWhite, Bool)) {
66	    DejaGnu.pass("XMLDocument.ignoreWhite property exists");
67	} else {
68	    DejaGnu.fail("XMLDocument.ignoreWhite property doesn't exist");
69	}
70	if (Std.is(x1.xmlDecl, Dynamic)) {
71 	    DejaGnu.pass("XMLDocument.xmlDecl property exists");
72 	} else {
73 	    DejaGnu.fail("XMLDocument.xmlDecl property doesn't exist");
74 	}
75
76	// Tests to see if all the methods exist. All these do is test for
77	// existance of a method, and don't test the functionality at all. This
78	// is primarily useful only to test completeness of the API implementation.
79 	if (Type.typeof(x1.createElement)==TFunction) {
80 	    DejaGnu.pass("XMLDocument::createElement() method exists");
81 	} else {
82 	    DejaGnu.fail("XMLDocument::createElement() method doesn't exist");
83 	}
84 	if (Type.typeof(x1.createTextNode)==TFunction) {
85 	    DejaGnu.pass("XMLDocument::createTextNode() method exists");
86 	} else {
87 	    DejaGnu.fail("XMLDocument::createTextNode() method doesn't exist");
88 	}
89	if (Type.typeof(x1.parseXML)==TFunction) {
90	    DejaGnu.pass("XMLDocument::parseXML() method exists");
91	} else {
92	    DejaGnu.fail("XMLDocument::parseXML() method doesn't exist");
93	}
94	if (Type.typeof(x1.toString)==TFunction) {
95	    DejaGnu.pass("XMLDocument::toString() method exists");
96	} else {
97	    DejaGnu.fail("XMLDocument::toString() method doesn't exist");
98	}
99
100        // Call this after finishing all tests. It prints out the totals.
101        DejaGnu.done();
102	#end
103    }
104}
105
106// local Variables:
107// mode: C++
108// indent-tabs-mode: t
109// End:
110
111