xultestrunner 0.2.9 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (162) hide show
  1. data/.document +5 -0
  2. data/.gitignore +4 -1
  3. data/LICENSE +17 -18
  4. data/README.rdoc +18 -0
  5. data/Rakefile +65 -40
  6. data/VERSION +1 -1
  7. data/bin/xultest +1 -12
  8. data/lib/xultestrunner.rb +1 -1
  9. data/test/test_helper.rb +9 -0
  10. data/test/xultestrunner_test.rb +7 -0
  11. data/xpcomcore/app/application.ini +12 -0
  12. data/xpcomcore/app/chrome/chrome.manifest +1 -0
  13. data/xpcomcore/app/chrome/content/xul/main_window.xul +6 -0
  14. data/xpcomcore/app/components/bootstrapper.js +70 -0
  15. data/xpcomcore/app/defaults/preferences/prefs.js +7 -0
  16. data/xultestrunner.gemspec +21 -150
  17. metadata +27 -153
  18. data/.gitmodules +0 -3
  19. data/README +0 -17
  20. data/xulapp/application.ini +0 -9
  21. data/xulapp/chrome/chrome.manifest +0 -2
  22. data/xulapp/chrome/content/interface/boot.xul +0 -20
  23. data/xulapp/chrome/content/interface/testharness.html +0 -30
  24. data/xulapp/chrome/content/lib/xultestcase.js +0 -140
  25. data/xulapp/chrome/content/lib/xultestrunner.js +0 -120
  26. data/xulapp/chrome/content/vendor/prototype/LICENSE +0 -16
  27. data/xulapp/chrome/content/vendor/prototype/prototype.js +0 -4874
  28. data/xulapp/chrome/content/vendor/scriptaculous/LICENSE +0 -20
  29. data/xulapp/chrome/content/vendor/scriptaculous/test.css +0 -90
  30. data/xulapp/chrome/content/vendor/scriptaculous/unittest.js +0 -566
  31. data/xulapp/chrome/content/vendor/xpcomcore/LICENSE +0 -21
  32. data/xulapp/chrome/content/vendor/xpcomcore/README +0 -27
  33. data/xulapp/chrome/content/vendor/xpcomcore/Rakefile +0 -83
  34. data/xulapp/chrome/content/vendor/xpcomcore/VERSION.yml +0 -5
  35. data/xulapp/chrome/content/vendor/xpcomcore/bootstrapper.js +0 -32
  36. data/xulapp/chrome/content/vendor/xpcomcore/components/XPCOMCore.js +0 -120
  37. data/xulapp/chrome/content/vendor/xpcomcore/doc/files.html +0 -241
  38. data/xulapp/chrome/content/vendor/xpcomcore/doc/index.html +0 -243
  39. data/xulapp/chrome/content/vendor/xpcomcore/doc/symbols/Error.html +0 -256
  40. data/xulapp/chrome/content/vendor/xpcomcore/doc/symbols/Kernel.html +0 -1030
  41. data/xulapp/chrome/content/vendor/xpcomcore/doc/symbols/LoadError.html +0 -319
  42. data/xulapp/chrome/content/vendor/xpcomcore/doc/symbols/SelfConceptError.html +0 -319
  43. data/xulapp/chrome/content/vendor/xpcomcore/doc/symbols/_global_.html +0 -316
  44. data/xulapp/chrome/content/vendor/xpcomcore/doc/symbols/src/lib_file.js.html +0 -53
  45. data/xulapp/chrome/content/vendor/xpcomcore/doc/symbols/src/lib_kernel.js.html +0 -251
  46. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/README.txt +0 -186
  47. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/frame/Chain.js +0 -102
  48. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/frame/Dumper.js +0 -144
  49. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/frame/Hash.js +0 -84
  50. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/frame/Link.js +0 -153
  51. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/frame/Namespace.js +0 -10
  52. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/frame/Opt.js +0 -134
  53. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/frame/Reflection.js +0 -26
  54. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/frame/String.js +0 -93
  55. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/frame/Testrun.js +0 -129
  56. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/frame.js +0 -33
  57. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/handlers/FOODOC.js +0 -26
  58. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/handlers/XMLDOC/DomReader.js +0 -159
  59. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/handlers/XMLDOC/XMLDoc.js +0 -16
  60. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/handlers/XMLDOC/XMLParse.js +0 -292
  61. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/handlers/XMLDOC.js +0 -26
  62. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/DocComment.js +0 -200
  63. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/DocTag.js +0 -294
  64. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/JsDoc.js +0 -126
  65. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/JsPlate.js +0 -109
  66. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/Lang.js +0 -144
  67. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/Parser.js +0 -145
  68. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/PluginManager.js +0 -33
  69. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/Symbol.js +0 -645
  70. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/SymbolSet.js +0 -241
  71. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/TextStream.js +0 -41
  72. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/Token.js +0 -18
  73. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/TokenReader.js +0 -332
  74. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/TokenStream.js +0 -133
  75. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/Util.js +0 -32
  76. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC/Walker.js +0 -474
  77. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/lib/JSDOC.js +0 -104
  78. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/main.js +0 -111
  79. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/plugins/commentSrcJson.js +0 -20
  80. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/plugins/frameworkPrototype.js +0 -16
  81. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/plugins/functionCall.js +0 -10
  82. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/plugins/publishSrcHilite.js +0 -62
  83. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/plugins/symbolLink.js +0 -10
  84. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/plugins/tagParamConfig.js +0 -31
  85. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/plugins/tagSynonyms.js +0 -43
  86. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/run.js +0 -348
  87. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/t/TestDoc.js +0 -144
  88. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/t/runner.js +0 -13
  89. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/addon.js +0 -24
  90. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/anon_inner.js +0 -14
  91. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/augments.js +0 -31
  92. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/augments2.js +0 -26
  93. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/borrows.js +0 -46
  94. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/borrows2.js +0 -23
  95. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/config.js +0 -22
  96. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/constructs.js +0 -18
  97. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/encoding.js +0 -10
  98. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/encoding_other.js +0 -12
  99. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/event.js +0 -54
  100. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/exports.js +0 -14
  101. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/functions_anon.js +0 -39
  102. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/functions_nested.js +0 -33
  103. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/global.js +0 -13
  104. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/globals.js +0 -25
  105. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/ignore.js +0 -10
  106. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/inner.js +0 -16
  107. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/jsdoc_test.js +0 -477
  108. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/lend.js +0 -33
  109. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/memberof.js +0 -19
  110. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/memberof_constructor.js +0 -17
  111. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/module.js +0 -17
  112. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/name.js +0 -19
  113. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/namespace_nested.js +0 -23
  114. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/nocode.js +0 -13
  115. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/oblit_anon.js +0 -20
  116. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/overview.js +0 -20
  117. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/param_inline.js +0 -37
  118. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/params_optional.js +0 -8
  119. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/prototype.js +0 -17
  120. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/prototype_nested.js +0 -9
  121. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/prototype_oblit.js +0 -13
  122. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/prototype_oblit_constructor.js +0 -24
  123. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/public.js +0 -10
  124. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/scripts/code.js +0 -5
  125. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/scripts/notcode.txt +0 -5
  126. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/shared.js +0 -42
  127. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/shared2.js +0 -2
  128. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/shortcuts.js +0 -22
  129. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/static_this.js +0 -13
  130. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/synonyms.js +0 -31
  131. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/tosource.js +0 -23
  132. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test/variable_redefine.js +0 -14
  133. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/app/test.js +0 -325
  134. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/changes.txt +0 -96
  135. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/conf/sample.conf +0 -31
  136. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/java/build.xml +0 -36
  137. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/java/build_1.4.xml +0 -36
  138. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/java/classes/js.jar +0 -0
  139. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/java/src/JsDebugRun.java +0 -21
  140. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/java/src/JsRun.java +0 -21
  141. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/jsdebug.jar +0 -0
  142. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/jsrun.jar +0 -0
  143. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/jsrun.sh +0 -52
  144. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/allclasses.tmpl +0 -17
  145. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/allfiles.tmpl +0 -56
  146. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/class.tmpl +0 -646
  147. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/index.tmpl +0 -39
  148. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/publish.js +0 -200
  149. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/static/default.css +0 -162
  150. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/static/header.html +0 -2
  151. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/static/index.html +0 -19
  152. data/xulapp/chrome/content/vendor/xpcomcore/etc/jsdoc-toolkit/templates/jsdoc/symbol.tmpl +0 -35
  153. data/xulapp/chrome/content/vendor/xpcomcore/lib/file.js +0 -46
  154. data/xulapp/chrome/content/vendor/xpcomcore/lib/kernel.js +0 -244
  155. data/xulapp/chrome/content/vendor/xpcomcore/test/file_test.js +0 -16
  156. data/xulapp/chrome/content/vendor/xpcomcore/test/fixtures/love.js +0 -1
  157. data/xulapp/chrome/content/vendor/xpcomcore/test/fixtures/mad_love.js +0 -1
  158. data/xulapp/chrome/content/vendor/xpcomcore/test/fixtures/mad_world.js +0 -1
  159. data/xulapp/chrome/content/vendor/xpcomcore/test/fixtures/syntax_error.js +0 -1
  160. data/xulapp/chrome/content/vendor/xpcomcore/test/kernel_test.js +0 -88
  161. data/xulapp/components/bootstrap.js +0 -93
  162. data/xulapp/defaults/preferences/prefs.js +0 -14
@@ -1,348 +0,0 @@
1
- /**
2
- * @fileOverview
3
- * A bootstrap script that creates some basic required objects
4
- * for loading other scripts.
5
- * @author Michael Mathews, micmath@gmail.com
6
- * @version $Id: run.js 756 2009-01-07 21:32:58Z micmath $
7
- */
8
-
9
- /**
10
- * @namespace Keep track of any messages from the running script.
11
- */
12
- LOG = {
13
- warn: function(msg, e) {
14
- if (JSDOC.opt.q) return;
15
- if (e) msg = e.fileName+", line "+e.lineNumber+": "+msg;
16
-
17
- msg = ">> WARNING: "+msg;
18
- LOG.warnings.push(msg);
19
- if (LOG.out) LOG.out.write(msg+"\n");
20
- else print(msg);
21
- },
22
-
23
- inform: function(msg) {
24
- if (JSDOC.opt.q) return;
25
- msg = " > "+msg;
26
- if (LOG.out) LOG.out.write(msg+"\n");
27
- else if (typeof LOG.verbose != "undefined" && LOG.verbose) print(msg);
28
- }
29
- };
30
- LOG.warnings = [];
31
- LOG.verbose = false
32
- LOG.out = undefined;
33
-
34
- /**
35
- * @class Manipulate a filepath.
36
- */
37
- function FilePath(absPath, separator) {
38
- this.slash = separator || "/";
39
- this.root = this.slash;
40
- this.path = [];
41
- this.file = "";
42
-
43
- var parts = absPath.split(/[\\\/]/);
44
- if (parts) {
45
- if (parts.length) this.root = parts.shift() + this.slash;
46
- if (parts.length) this.file = parts.pop()
47
- if (parts.length) this.path = parts;
48
- }
49
-
50
- this.path = this.resolvePath();
51
- }
52
-
53
- /** Collapse any dot-dot or dot items in a filepath. */
54
- FilePath.prototype.resolvePath = function() {
55
- var resolvedPath = [];
56
- for (var i = 0; i < this.path.length; i++) {
57
- if (this.path[i] == "..") resolvedPath.pop();
58
- else if (this.path[i] != ".") resolvedPath.push(this.path[i]);
59
- }
60
- return resolvedPath;
61
- }
62
-
63
- /** Trim off the filename. */
64
- FilePath.prototype.toDir = function() {
65
- if (this.file) this.file = "";
66
- return this;
67
- }
68
-
69
- /** Go up a directory. */
70
- FilePath.prototype.upDir = function() {
71
- this.toDir();
72
- if (this.path.length) this.path.pop();
73
- return this;
74
- }
75
-
76
- FilePath.prototype.toString = function() {
77
- return this.root
78
- + this.path.join(this.slash)
79
- + ((this.path.length > 0)? this.slash : "")
80
- + this.file;
81
- }
82
-
83
- /**
84
- * Turn a path into just the name of the file.
85
- */
86
- FilePath.fileName = function(path) {
87
- var nameStart = Math.max(path.lastIndexOf("/")+1, path.lastIndexOf("\\")+1, 0);
88
- return path.substring(nameStart);
89
- }
90
-
91
- /**
92
- * Get the extension of a filename
93
- */
94
- FilePath.fileExtension = function(filename) {
95
- return filename.split(".").pop().toLowerCase();
96
- };
97
-
98
- /**
99
- * Turn a path into just the directory part.
100
- */
101
- FilePath.dir = function(path) {
102
- var nameStart = Math.max(path.lastIndexOf("/")+1, path.lastIndexOf("\\")+1, 0);
103
- return path.substring(0, nameStart-1);
104
- }
105
-
106
-
107
- importClass(java.lang.System);
108
-
109
- /**
110
- * @namespace A collection of information about your system.
111
- */
112
- SYS = {
113
- /**
114
- * Information about your operating system: arch, name, version.
115
- * @type string
116
- */
117
- os: [
118
- new String(System.getProperty("os.arch")),
119
- new String(System.getProperty("os.name")),
120
- new String(System.getProperty("os.version"))
121
- ].join(", "),
122
-
123
- /**
124
- * Which way does your slash lean.
125
- * @type string
126
- */
127
- slash: System.getProperty("file.separator")||"/",
128
-
129
- /**
130
- * The path to the working directory where you ran java.
131
- * @type string
132
- */
133
- userDir: new String(System.getProperty("user.dir")),
134
-
135
- /**
136
- * Where is Java's home folder.
137
- * @type string
138
- */
139
- javaHome: new String(System.getProperty("java.home")),
140
-
141
- /**
142
- * The absolute path to the directory containing this script.
143
- * @type string
144
- */
145
- pwd: undefined
146
- };
147
-
148
- // jsrun appends an argument, with the path to here.
149
- if (arguments[arguments.length-1].match(/^-j=(.+)/)) {
150
- if (RegExp.$1.charAt(0) == SYS.slash || RegExp.$1.charAt(1) == ":") { // absolute path to here
151
- SYS.pwd = new FilePath(RegExp.$1).toDir().toString();
152
- }
153
- else { // relative path to here
154
- SYS.pwd = new FilePath(SYS.userDir + SYS.slash + RegExp.$1).toDir().toString();
155
- }
156
- arguments.pop();
157
- }
158
- else {
159
- print("The run.js script requires you use jsrun.jar.");
160
- quit();
161
- }
162
-
163
- // shortcut
164
- var File = Packages.java.io.File;
165
-
166
- /**
167
- * @namespace A collection of functions that deal with reading a writing to disk.
168
- */
169
- IO = {
170
-
171
- /**
172
- * Create a new file in the given directory, with the given name and contents.
173
- */
174
- saveFile: function(/**string*/ outDir, /**string*/ fileName, /**string*/ content) {
175
- var out = new Packages.java.io.PrintWriter(
176
- new Packages.java.io.OutputStreamWriter(
177
- new Packages.java.io.FileOutputStream(outDir+SYS.slash+fileName),
178
- IO.encoding
179
- )
180
- );
181
- out.write(content);
182
- out.flush();
183
- out.close();
184
- },
185
-
186
- /**
187
- * @type string
188
- */
189
- readFile: function(/**string*/ path) {
190
- if (!IO.exists(path)) {
191
- throw "File doesn't exist there: "+path;
192
- }
193
- return readFile(path, IO.encoding);
194
- },
195
-
196
- /**
197
- * @param inFile
198
- * @param outDir
199
- * @param [fileName=The original filename]
200
- */
201
- copyFile: function(/**string*/ inFile, /**string*/ outDir, /**string*/ fileName) {
202
- if (fileName == null) fileName = FilePath.fileName(inFile);
203
-
204
- var inFile = new File(inFile);
205
- var outFile = new File(outDir+SYS.slash+fileName);
206
-
207
- var bis = new Packages.java.io.BufferedInputStream(new Packages.java.io.FileInputStream(inFile), 4096);
208
- var bos = new Packages.java.io.BufferedOutputStream(new Packages.java.io.FileOutputStream(outFile), 4096);
209
- var theChar;
210
- while ((theChar = bis.read()) != -1) {
211
- bos.write(theChar);
212
- }
213
- bos.close();
214
- bis.close();
215
- },
216
-
217
- /**
218
- * Creates a series of nested directories.
219
- */
220
- mkPath: function(/**Array*/ path) {
221
- if (path.constructor != Array) path = path.split(/[\\\/]/);
222
- var make = "";
223
- for (var i = 0, l = path.length; i < l; i++) {
224
- make += path[i] + SYS.slash;
225
- if (! IO.exists(make)) {
226
- IO.makeDir(make);
227
- }
228
- }
229
- },
230
-
231
- /**
232
- * Creates a directory at the given path.
233
- */
234
- makeDir: function(/**string*/ path) {
235
- (new File(path)).mkdir();
236
- },
237
-
238
- /**
239
- * @type string[]
240
- * @param dir The starting directory to look in.
241
- * @param [recurse=1] How many levels deep to scan.
242
- * @returns An array of all the paths to files in the given dir.
243
- */
244
- ls: function(/**string*/ dir, /**number*/ recurse, _allFiles, _path) {
245
- if (_path === undefined) { // initially
246
- var _allFiles = [];
247
- var _path = [dir];
248
- }
249
- if (_path.length == 0) return _allFiles;
250
- if (recurse === undefined) recurse = 1;
251
-
252
- dir = new File(dir);
253
- if (!dir.directory) return [String(dir)];
254
- var files = dir.list();
255
-
256
- for (var f = 0; f < files.length; f++) {
257
- var file = String(files[f]);
258
- if (file.match(/^\.[^\.\/\\]/)) continue; // skip dot files
259
-
260
- if ((new File(_path.join(SYS.slash)+SYS.slash+file)).list()) { // it's a directory
261
- _path.push(file);
262
- if (_path.length-1 < recurse) IO.ls(_path.join(SYS.slash), recurse, _allFiles, _path);
263
- _path.pop();
264
- }
265
- else {
266
- _allFiles.push((_path.join(SYS.slash)+SYS.slash+file).replace(SYS.slash+SYS.slash, SYS.slash));
267
- }
268
- }
269
-
270
- return _allFiles;
271
- },
272
-
273
- /**
274
- * @type boolean
275
- */
276
- exists: function(/**string*/ path) {
277
- file = new File(path);
278
-
279
- if (file.isDirectory()){
280
- return true;
281
- }
282
- if (!file.exists()){
283
- return false;
284
- }
285
- if (!file.canRead()){
286
- return false;
287
- }
288
- return true;
289
- },
290
-
291
- /**
292
- *
293
- */
294
- open: function(/**string*/ path, /**string*/ append) {
295
- var append = true;
296
- var outFile = new File(path);
297
- var out = new Packages.java.io.PrintWriter(
298
- new Packages.java.io.OutputStreamWriter(
299
- new Packages.java.io.FileOutputStream(outFile, append),
300
- IO.encoding
301
- )
302
- );
303
- return out;
304
- },
305
-
306
- /**
307
- * Sets {@link IO.encoding}.
308
- * Encoding is used when reading and writing text to files,
309
- * and in the meta tags of HTML output.
310
- */
311
- setEncoding: function(/**string*/ encoding) {
312
- if (/ISO-8859-([0-9]+)/i.test(encoding)) {
313
- IO.encoding = "ISO8859_"+RegExp.$1;
314
- }
315
- else {
316
- IO.encoding = encoding;
317
- }
318
- },
319
-
320
- /**
321
- * @default "utf-8"
322
- * @private
323
- */
324
- encoding: "utf-8",
325
-
326
- /**
327
- * Load the given script.
328
- */
329
- include: function(relativePath) {
330
- load(SYS.pwd+relativePath);
331
- },
332
-
333
- /**
334
- * Loads all scripts from the given directory path.
335
- */
336
- includeDir: function(path) {
337
- if (!path) return;
338
-
339
- for (var lib = IO.ls(SYS.pwd+path), i = 0; i < lib.length; i++)
340
- if (/\.js$/i.test(lib[i])) load(lib[i]);
341
- }
342
- }
343
-
344
- // now run the application
345
- IO.include("frame.js");
346
- IO.include("main.js");
347
-
348
- main();
@@ -1,144 +0,0 @@
1
- var TestDoc = {
2
- fails: 0,
3
- plans: 0,
4
- passes: 0,
5
- results: []
6
- };
7
-
8
- TestDoc.record = function(result) {
9
- TestDoc.results.push(result);
10
- if (typeof result.verdict == "boolean") {
11
- if (result.verdict === false) TestDoc.fails++;
12
- if (result.verdict === true) TestDoc.passes++;
13
- }
14
- }
15
-
16
- TestDoc.prove = function(filePath) {
17
- if (typeof document != "undefined" && typeof document.write != "undefined") {
18
- if (TestDoc.console) print = function(s) { TestDoc.console.appendChild(document.createTextNode(s+"\n")); }
19
- else print = function(s) { document.write(s+"<br />"); }
20
- }
21
- TestDoc.run(TestDoc.readFile(filePath));
22
- }
23
-
24
- TestDoc.run = function(src) {
25
- try { eval(src); } catch(e) { print("# ERROR! "+e); }
26
-
27
- var chunks = src.split(/\/\*t:/);
28
-
29
- var run = function(chunk) {
30
- // local shortcuts
31
- var is = TestDoc.assertEquals;
32
- var isnt = TestDoc.assertNotEquals;
33
- var plan = TestDoc.plan;
34
- var requires = TestDoc.requires;
35
-
36
- try { eval(chunk); } catch(e) { print("# ERROR! "+e); }
37
- }
38
- for (var start = -1, end = 0; (start = src.indexOf("/*t:", end)) > end; start = end) {
39
- run(
40
- src.substring(
41
- start+4,
42
- (end = src.indexOf("*/", start))
43
- )
44
- );
45
- }
46
- }
47
-
48
- TestDoc.Result = function(verdict, message) {
49
- this.verdict = verdict;
50
- this.message = message;
51
- }
52
-
53
- TestDoc.Result.prototype.toString = function() {
54
- if (typeof this.verdict == "boolean") {
55
- return (this.verdict? "ok" : "not ok") + " " + (++TestDoc.report.counter) + " - " + this.message;
56
- }
57
-
58
- return "# " + this.message;
59
- }
60
-
61
- TestDoc.requires = function(file) {
62
- if (!TestDoc.requires.loaded[file]) {
63
- load(file);
64
- TestDoc.requires.loaded[file] = true;
65
- }
66
- }
67
- TestDoc.requires.loaded = {};
68
-
69
- TestDoc.report = function() {
70
- TestDoc.report.counter = 0;
71
- print("1.."+TestDoc.plans);
72
- for (var i = 0; i < TestDoc.results.length; i++) {
73
- print(TestDoc.results[i]);
74
- }
75
- print("----------------------------------------");
76
- if (TestDoc.fails == 0 && TestDoc.passes == TestDoc.plans) {
77
- print("All tests successful.");
78
- }
79
- else {
80
- print("Failed " + TestDoc.fails + "/" + TestDoc.plans + " tests, "+((TestDoc.plans == 0)? 0 : Math.round(TestDoc.passes/(TestDoc.passes+TestDoc.fails)*10000)/100)+"% okay. Planned to run "+TestDoc.plans+", did run "+(TestDoc.passes+TestDoc.fails)+".")
81
- }
82
- }
83
-
84
- TestDoc.plan = function(n, message) {
85
- TestDoc.plans += n;
86
- TestDoc.record(new TestDoc.Result(null, message+" ("+n+" tests)"));
87
- }
88
-
89
- TestDoc.assertEquals = function(a, b, message) {
90
- var result = (a == b);
91
- if (!result) message += "\n#\n# " + a + " does not equal " + b + "\n#";
92
- TestDoc.record(new TestDoc.Result(result, message));
93
- }
94
-
95
- TestDoc.assertNotEquals = function(a, b, message) {
96
- var result = (a != b);
97
- if (!result) message += "\n#\n# " + a + " equals " + b + "\n#";
98
- TestDoc.record(new TestDoc.Result(result, message));
99
- }
100
-
101
- TestDoc.readFile = (function(){
102
- // rhino
103
- if (typeof readFile == "function") {
104
- return function(url) {
105
- var text = readFile(url);
106
- return text || "";
107
- }
108
- }
109
-
110
- // a web browser
111
- else {
112
- return function(url) {
113
- var httpRequest;
114
-
115
- if (window.XMLHttpRequest) { // Mozilla, Safari, etc
116
- httpRequest = new XMLHttpRequest();
117
- }
118
- else if (window.ActiveXObject) { // IE
119
- try {
120
- httpRequest = new ActiveXObject("Msxml2.XMLHTTP");
121
- }
122
- catch (e) {
123
- try {
124
- httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
125
- }
126
- catch (e) {
127
- }
128
- }
129
- }
130
-
131
- if (!httpRequest) { throw "Cannot create HTTP Request."; }
132
-
133
- httpRequest.open('GET', url, false);
134
- httpRequest.send('');
135
- if (httpRequest.readyState == 4) {
136
- if (httpRequest.status >= 400) {
137
- throw "The HTTP Request returned an error code: "+httpRequest.status;
138
- }
139
- }
140
-
141
- return httpRequest.responseText || "";
142
- }
143
- }
144
- })();
@@ -1,13 +0,0 @@
1
- // try: java -jar ../../jsrun.jar runner.js
2
-
3
- load("TestDoc.js");
4
-
5
- TestDoc.prove("../frame/Opt.js");
6
- TestDoc.prove("../lib/JSDOC.js");
7
- TestDoc.prove("../frame/String.js");
8
- TestDoc.prove("../lib/JSDOC/DocTag.js");
9
- TestDoc.prove("../lib/JSDOC/DocComment.js");
10
- TestDoc.prove("../lib/JSDOC/TokenReader.js");
11
- TestDoc.prove("../lib/JSDOC/Symbol.js");
12
-
13
- TestDoc.report();
@@ -1,24 +0,0 @@
1
- String.prototype.reverse = function() {
2
- }
3
-
4
- String.prototype.reverse.utf8 = function() {
5
- }
6
-
7
- Function.count = function() {
8
- }
9
-
10
- /** @memberOf Function */
11
- Function.count.reset = function() {
12
- }
13
-
14
- /** @memberOf Function */
15
- count.getValue = function() {
16
- }
17
-
18
- /** @memberOf Function.prototype */
19
- getSig = function() {
20
- }
21
-
22
- /** @memberOf Function.prototype */
23
- Function.prototype.getProps = function() {
24
- }
@@ -1,14 +0,0 @@
1
- /**
2
- * @name bar
3
- * @namespace
4
- */
5
-
6
- new function() {
7
- /**
8
- * @name bar-foo
9
- * @function
10
- * @param {number} x
11
- */
12
- function foo(x) {
13
- }
14
- }
@@ -1,31 +0,0 @@
1
- /**
2
- @constructor
3
- */
4
- function Layout(p) {
5
- this.init = function(p) {
6
- }
7
-
8
- this.getId = function() {
9
- }
10
-
11
- /** @type Page */
12
- this.orientation = "landscape";
13
- }
14
-
15
- /**
16
- @constructor
17
- @augments Layout
18
- */
19
- function Page() {
20
- this.reset = function(b) {
21
- }
22
- }
23
-
24
- /**
25
- @extends Page
26
- @constructor
27
- */
28
- function ThreeColumnPage() {
29
- this.init = function(resetCode) {
30
- }
31
- }
@@ -1,26 +0,0 @@
1
- /**
2
- @constructor
3
- */
4
- function LibraryItem() {
5
- this.reserve = function() {
6
- }
7
- }
8
-
9
- /**
10
- @constructor
11
- */
12
- function Junkmail() {
13
- this.annoy = function() {
14
- }
15
- }
16
-
17
- /**
18
- @inherits Junkmail.prototype.annoy as pester
19
- @augments ThreeColumnPage
20
- @augments LibraryItem
21
- @constructor
22
- */
23
- function NewsletterPage() {
24
- this.getHeadline = function() {
25
- }
26
- }
@@ -1,46 +0,0 @@
1
- /**
2
- @constructor
3
- */
4
- function Layout(p) {
5
- /** initilize 1 */
6
- this.init = function(p) {
7
- }
8
-
9
- /** get the id */
10
- this.getId = function() {
11
- }
12
-
13
- /** @type string */
14
- this.orientation = "landscape";
15
-
16
- function getInnerElements(elementSecretId){
17
- }
18
- }
19
-
20
- /** A static method. */
21
- Layout.units = function() {
22
- }
23
-
24
- /**
25
- @constructor
26
- @borrows Layout#orientation
27
- @borrows Layout-getInnerElements
28
- @borrows Layout.units
29
- */
30
- function Page() {
31
- /** reset the page */
32
- this.reset = function(b) {
33
- }
34
- }
35
-
36
- /**
37
- @constructor
38
- @borrows Layout.prototype.orientation as this.orientation
39
- @borrows Layout.prototype.init as #init
40
- @inherits Page.prototype.reset as #reset
41
- */
42
- function ThreeColumnPage() {
43
- /** initilize 2 */
44
- this.init = function(p) {
45
- }
46
- }
@@ -1,23 +0,0 @@
1
- // testing circular borrows
2
-
3
- /**
4
- @class
5
- @borrows Bar#zop as this.my_zop
6
- */
7
- function Foo() {
8
- /** this is a zip. */
9
- this.zip = function() {}
10
-
11
- this.my_zop = new Bar().zop;
12
- }
13
-
14
- /**
15
- @class
16
- @borrows Foo#zip as this.my_zip
17
- */
18
- function Bar() {
19
- /** this is a zop. */
20
- this.zop = function() {}
21
-
22
- this.my_zip = new Foo().zip;
23
- }
@@ -1,22 +0,0 @@
1
- /**
2
- * @constructor
3
- * @param person The person.
4
- * @param {string} person.name The person's name.
5
- * @config {integer} age The person's age.
6
- * @config [id=1] Optional id number to use.
7
- * @param connection
8
- */
9
- function Contact(person, connection) {
10
-
11
- }
12
-
13
- /**
14
- * @constructor
15
- * @param persons
16
- * @config {string} Father The paternal person.
17
- * @config {string} Mother The maternal person.
18
- * @config {string[]} Children And the rest.
19
- */
20
- function Family(/**Object*/persons) {
21
-
22
- }