Permalink
Please sign in to comment.
Showing
with
9,007 additions
and 0 deletions.
- +50 −0 app/emptyPage.html
- +333 −0 app/jsUnitCore.js
- +33 −0 app/jsUnitStyle.css
- +646 −0 app/jsUnitTestManager.js
- +85 −0 app/jsUnitTestSuite.js
- +114 −0 app/jsUnitTracer.js
- +52 −0 app/main-counts-errors.html
- +52 −0 app/main-counts-failures.html
- +52 −0 app/main-counts-runs.html
- +61 −0 app/main-counts.html
- +174 −0 app/main-data.html
- +62 −0 app/main-errors.html
- +63 −0 app/main-frame.html
- +87 −0 app/main-loader.html
- +65 −0 app/main-progress.html
- +77 −0 app/main-results.html
- +51 −0 app/main-status.html
- +59 −0 app/testContainer.html
- +109 −0 app/testContainerController.html
- +305 −0 app/xbDebug.js
- +120 −0 css/jsUnitStyle.css
- +388 −0 docs/gnugpl.html
- +18 −0 docs/readme.txt
- BIN images/green.gif
- BIN images/logo_jsunit.gif
- BIN images/red.gif
- +56 −0 licenses/JDOM_license.txt
- +159 −0 licenses/Jetty_license.html
- +470 −0 licenses/MPL-1.1.txt
- +340 −0 licenses/gpl-2.txt
- +92 −0 licenses/index.html
- +504 −0 licenses/lgpl-2.1.txt
- +35 −0 licenses/mpl-tri-license-c.txt
- +35 −0 licenses/mpl-tri-license-html.txt
- +1 −0 results/bin/.cvsignore
- +31 −0 results/build.xml
- BIN results/lib/javax.servlet.jar
- BIN results/lib/jdom.jar
- BIN results/lib/jsunit.jar
- BIN results/lib/junit.jar
- BIN results/lib/org.mortbay.jetty-jdk1.2.jar
- BIN results/lib/xercesImpl.jar
- +1 −0 results/logs/.cvsignore
- +2 −0 results/resultAcceptor.bat
- +2 −0 results/resultAcceptor.sh
- +115 −0 results/src/net/jsunit/ResultAcceptor.java
- +56 −0 results/src/net/jsunit/ResultAcceptorServlet.java
- +64 −0 results/src/net/jsunit/ResultDisplayerServlet.java
- +93 −0 results/src/net/jsunit/StandaloneTest.java
- +103 −0 results/src/net/jsunit/TestCaseResult.java
- +27 −0 results/src/net/jsunit/TestCaseResultBuilder.java
- +34 −0 results/src/net/jsunit/TestCaseResultWriter.java
- +183 −0 results/src/net/jsunit/TestSuiteResult.java
- +54 −0 results/src/net/jsunit/TestSuiteResultBuilder.java
- +64 −0 results/src/net/jsunit/TestSuiteResultWriter.java
- +61 −0 results/src/net/jsunit/Utility.java
- +59 −0 results/src/net/jsunit/example/ExampleStandaloneTest.java
- +206 −0 results/src/net/jsunit/test/DummyHttpRequest.java
- +58 −0 results/src/net/jsunit/test/JsUnitTest.java
- +115 −0 results/src/net/jsunit/test/ResultAcceptorTest.java
- +53 −0 results/src/net/jsunit/test/Suite.java
- +94 −0 results/src/net/jsunit/test/TestCaseResultTest.java
- +115 −0 results/src/net/jsunit/test/TestSuiteResultTest.java
- +2 −0 results/standaloneTest.bat
- +213 −0 testRunner.html
- +113 −0 tests/data/data.html
- +36 −0 tests/data/staff.css
- +17 −0 tests/data/staff.dtd
- +57 −0 tests/data/staff.xml
- +90 −0 tests/index.html
- +178 −0 tests/jsUnitAssertionTests.html
- +145 −0 tests/jsUnitAutoDiscoveryTestsIndex.html
- +184 −0 tests/jsUnitDeclAssertionTests.html
- +111 −0 tests/jsUnitDeclFrameworkUtilityTests.html
- +89 −0 tests/jsUnitDeclSetUpTearDownTests.html
- +86 −0 tests/jsUnitDeclTestLoadData.html
- +84 −0 tests/jsUnitDeclTestSetUpPages.html
- +72 −0 tests/jsUnitDeclTestSetUpPagesSuite.html
- +79 −0 tests/jsUnitDeclTestSuite.html
- +108 −0 tests/jsUnitDeclUtilityTests.html
- +72 −0 tests/jsUnitDeclarationTests.html
- +132 −0 tests/jsUnitDeclarationTestsIndex.html
- +105 −0 tests/jsUnitFrameworkUtilityTests.html
- +83 −0 tests/jsUnitSetUpTearDownTests.html
- +102 −0 tests/jsUnitTestFailures.html
- +80 −0 tests/jsUnitTestLoadData.html
- +100 −0 tests/jsUnitTestLoadStaff.html
- +78 −0 tests/jsUnitTestSetUpPages.html
- +72 −0 tests/jsUnitTestSetUpPagesSuite.html
- +79 −0 tests/jsUnitTestSuite.html
- +102 −0 tests/jsUnitUtilityTests.html
@@ -0,0 +1,50 @@ | ||
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" | ||
+ "http://www.w3.org/TR/html4/loose.dtd"> | ||
+<html> | ||
+<!-- JsUnit --> | ||
+<!-- ***** BEGIN LICENSE BLOCK ***** | ||
+ - Version: MPL 1.1/GPL 2.0/LGPL 2.1 | ||
+ - | ||
+ - The contents of this file are subject to the Mozilla Public License Version | ||
+ - 1.1 (the "License"); you may not use this file except in compliance with | ||
+ - the License. You may obtain a copy of the License at | ||
+ - http://www.mozilla.org/MPL/ | ||
+ - | ||
+ - Software distributed under the License is distributed on an "AS IS" basis, | ||
+ - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | ||
+ - for the specific language governing rights and limitations under the | ||
+ - License. | ||
+ - | ||
+ - The Original Code is Edward Hieatt code. | ||
+ - | ||
+ - The Initial Developer of the Original Code is | ||
+ - Edward Hieatt, edward@jsunit.net. | ||
+ - Portions created by the Initial Developer are Copyright (C) 2001 | ||
+ - the Initial Developer. All Rights Reserved. | ||
+ - | ||
+ - Contributor(s): | ||
+ - Edward Hieatt, edward@jsunit.net (original author) | ||
+ - Bob Clary, bc@bclary.com | ||
+ - | ||
+ - Alternatively, the contents of this file may be used under the terms of | ||
+ - either the GNU General Public License Version 2 or later (the "GPL"), or | ||
+ - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), | ||
+ - in which case the provisions of the GPL or the LGPL are applicable instead | ||
+ - of those above. If you wish to allow use of your version of this file only | ||
+ - under the terms of either the GPL or the LGPL, and not to allow others to | ||
+ - use your version of this file under the terms of the MPL, indicate your | ||
+ - decision by deleting the provisions above and replace them with the notice | ||
+ - and other provisions required by the LGPL or the GPL. If you do not delete | ||
+ - the provisions above, a recipient may use your version of this file under | ||
+ - the terms of any one of the MPL, the GPL or the LGPL. | ||
+ - | ||
+ - ***** END LICENSE BLOCK ***** --> | ||
+ | ||
+ <head> | ||
+ <title>emptyPage</title> | ||
+ </head> | ||
+ | ||
+ <body> | ||
+ </body> | ||
+</html> | ||
+ |
@@ -0,0 +1,333 @@ | ||
+/* jsUnit */ | ||
+/* ***** BEGIN LICENSE BLOCK ***** | ||
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | ||
+ * | ||
+ * The contents of this file are subject to the Mozilla Public License Version | ||
+ * 1.1 (the "License"); you may not use this file except in compliance with | ||
+ * the License. You may obtain a copy of the License at | ||
+ * http://www.mozilla.org/MPL/ | ||
+ * | ||
+ * Software distributed under the License is distributed on an "AS IS" basis, | ||
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | ||
+ * for the specific language governing rights and limitations under the | ||
+ * License. | ||
+ * | ||
+ * The Original Code is Edward Hieatt code. | ||
+ * | ||
+ * The Initial Developer of the Original Code is | ||
+ * Edward Hieatt, edward@jsunit.net. | ||
+ * Portions created by the Initial Developer are Copyright (C) 2001 | ||
+ * the Initial Developer. All Rights Reserved. | ||
+ * | ||
+ * Contributor(s): | ||
+ * Edward Hieatt, edward@jsunit.net (original author) | ||
+ * Bob Clary, bc@bclary.com | ||
+ * | ||
+ * Alternatively, the contents of this file may be used under the terms of | ||
+ * either the GNU General Public License Version 2 or later (the "GPL"), or | ||
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), | ||
+ * in which case the provisions of the GPL or the LGPL are applicable instead | ||
+ * of those above. If you wish to allow use of your version of this file only | ||
+ * under the terms of either the GPL or the LGPL, and not to allow others to | ||
+ * use your version of this file under the terms of the MPL, indicate your | ||
+ * decision by deleting the provisions above and replace them with the notice | ||
+ * and other provisions required by the GPL or the LGPL. If you do not delete | ||
+ * the provisions above, a recipient may use your version of this file under | ||
+ * the terms of any one of the MPL, the GPL or the LGPL. | ||
+ * | ||
+ * ***** END LICENSE BLOCK ***** */ | ||
+ | ||
+ | ||
+var JSUNIT_UNDEFINED_VALUE; | ||
+var isTestPageLoaded = false; | ||
+ | ||
+//hack for NS62 bug | ||
+function jsUnitFixTop() { | ||
+ var tempTop = top; | ||
+ if (!tempTop) { | ||
+ tempTop = window; | ||
+ while (tempTop.parent) { | ||
+ tempTop = tempTop.parent; | ||
+ if (tempTop.top && tempTop.top.jsUnitTestSuite) { | ||
+ tempTop = tempTop.top; | ||
+ break; | ||
+ } | ||
+ } | ||
+ } | ||
+ try { | ||
+ window.top = tempTop; | ||
+ } catch (e) {} | ||
+} | ||
+ | ||
+jsUnitFixTop(); | ||
+ | ||
+function _displayStringForValue(aVar) { | ||
+ if (aVar === null) | ||
+ return 'null'; | ||
+ | ||
+ if (aVar === top.JSUNIT_UNDEFINED_VALUE) | ||
+ return 'undefined'; | ||
+ | ||
+ return aVar; | ||
+} | ||
+ | ||
+function fail(failureMessage) { | ||
+ throw new JsUnitException(null, failureMessage); | ||
+} | ||
+ | ||
+function error(errorMessage) { | ||
+ var errorObject = new Object(); | ||
+ errorObject.description = errorMessage; | ||
+ throw errorObject; | ||
+} | ||
+ | ||
+function argumentsIncludeComments(expectedNumberOfNonCommentArgs, args) { | ||
+ return args.length == expectedNumberOfNonCommentArgs + 1; | ||
+} | ||
+ | ||
+function commentArg(expectedNumberOfNonCommentArgs, args) { | ||
+ if (argumentsIncludeComments(expectedNumberOfNonCommentArgs, args)) | ||
+ return args[0]; | ||
+ | ||
+ return null; | ||
+} | ||
+ | ||
+function nonCommentArg(desiredNonCommentArgIndex, expectedNumberOfNonCommentArgs, args) { | ||
+ return argumentsIncludeComments(expectedNumberOfNonCommentArgs, args) ? | ||
+ args[desiredNonCommentArgIndex] : | ||
+ args[desiredNonCommentArgIndex - 1]; | ||
+} | ||
+ | ||
+function _validateArguments(expectedNumberOfNonCommentArgs, args) { | ||
+ if (!( args.length == expectedNumberOfNonCommentArgs || | ||
+ (args.length == expectedNumberOfNonCommentArgs + 1 && typeof(args[0]) == 'string') )) | ||
+ error('Incorrect arguments passed to assert function'); | ||
+} | ||
+ | ||
+function _assert(comment, booleanValue, failureMessage) { | ||
+ if (!booleanValue) | ||
+ throw new JsUnitException(comment, failureMessage); | ||
+} | ||
+ | ||
+function assert() { | ||
+ _validateArguments(1, arguments); | ||
+ var booleanValue=nonCommentArg(1, 1, arguments); | ||
+ | ||
+ if (typeof(booleanValue) != 'boolean') | ||
+ error('Bad argument to assert(boolean)'); | ||
+ | ||
+ _assert(commentArg(1, arguments), booleanValue === true, 'Call to assert(boolean) with false'); | ||
+} | ||
+ | ||
+function assertTrue() { | ||
+ _validateArguments(1, arguments); | ||
+ var booleanValue=nonCommentArg(1, 1, arguments); | ||
+ | ||
+ if (typeof(booleanValue) != 'boolean') | ||
+ error('Bad argument to assertTrue(boolean)'); | ||
+ | ||
+ _assert(commentArg(1, arguments), booleanValue === true, 'Call to assertTrue(boolean) with false'); | ||
+} | ||
+ | ||
+function assertFalse() { | ||
+ _validateArguments(1, arguments); | ||
+ var booleanValue=nonCommentArg(1, 1, arguments); | ||
+ | ||
+ if (typeof(booleanValue) != 'boolean') | ||
+ error('Bad argument to assertFalse(boolean)'); | ||
+ | ||
+ _assert(commentArg(1, arguments), booleanValue === false, 'Call to assertFalse(boolean) with true'); | ||
+} | ||
+ | ||
+function assertEquals() { | ||
+ _validateArguments(2, arguments); | ||
+ var var1=nonCommentArg(1, 2, arguments); | ||
+ var var2=nonCommentArg(2, 2, arguments); | ||
+ _assert(commentArg(2, arguments), var1 === var2, 'Expected ' + var1 + ' (' + typeof(var1) + ') but was ' + _displayStringForValue(var2) + ' (' + typeof(var2) + ')'); | ||
+} | ||
+ | ||
+function assertNotEquals() { | ||
+ _validateArguments(2, arguments); | ||
+ var var1=nonCommentArg(1, 2, arguments); | ||
+ var var2=nonCommentArg(2, 2, arguments); | ||
+ _assert(commentArg(2, arguments), var1 !== var2, 'Expected not to be ' + _displayStringForValue(var2)); | ||
+} | ||
+ | ||
+function assertNull() { | ||
+ _validateArguments(1, arguments); | ||
+ var aVar=nonCommentArg(1, 1, arguments); | ||
+ _assert(commentArg(1, arguments), aVar === null, 'Expected null but was ' + _displayStringForValue(aVar)); | ||
+} | ||
+ | ||
+function assertNotNull() { | ||
+ _validateArguments(1, arguments); | ||
+ var aVar=nonCommentArg(1, 1, arguments); | ||
+ _assert(commentArg(1, arguments), aVar !== null, 'Expected not to be null'); | ||
+} | ||
+ | ||
+function assertUndefined() { | ||
+ _validateArguments(1, arguments); | ||
+ var aVar=nonCommentArg(1, 1, arguments); | ||
+ _assert(commentArg(1, arguments), aVar === top.JSUNIT_UNDEFINED_VALUE, 'Expected undefined but was ' + _displayStringForValue(aVar)); | ||
+} | ||
+ | ||
+function assertNotUndefined() { | ||
+ _validateArguments(1, arguments); | ||
+ var aVar=nonCommentArg(1, 1, arguments); | ||
+ _assert(commentArg(1, arguments), aVar !== top.JSUNIT_UNDEFINED_VALUE, 'Expected not to be undefined'); | ||
+} | ||
+ | ||
+function assertNaN() { | ||
+ _validateArguments(1, arguments); | ||
+ var aVar=nonCommentArg(1, 1, arguments); | ||
+ _assert(commentArg(1, arguments), isNaN(aVar), 'Expected NaN'); | ||
+} | ||
+ | ||
+function assertNotNaN() { | ||
+ _validateArguments(1, arguments); | ||
+ var aVar=nonCommentArg(1, 1, arguments); | ||
+ _assert(commentArg(1, arguments), !isNaN(aVar), 'Expected not NaN'); | ||
+} | ||
+ | ||
+function isLoaded() { | ||
+ return isTestPageLoaded; | ||
+} | ||
+ | ||
+function setUp() { | ||
+} | ||
+ | ||
+function tearDown() { | ||
+} | ||
+ | ||
+function getFunctionName(aFunction) { | ||
+ var name = aFunction.toString().match(/function (\w*)/)[1]; | ||
+ | ||
+ if ((name == null) || (name.length == 0)) | ||
+ name = 'anonymous'; | ||
+ | ||
+ return name; | ||
+} | ||
+ | ||
+function getStackTrace() { | ||
+ var result = ''; | ||
+ | ||
+ for (var a = arguments.caller; a != null; a = a.caller) { | ||
+ result += '> ' + getFunctionName(a.callee) + '\n'; | ||
+ if (a.caller == a) { | ||
+ result += '*'; | ||
+ break; | ||
+ } | ||
+ } | ||
+ | ||
+ return result; | ||
+} | ||
+ | ||
+function JsUnitException(comment, message) { | ||
+ this.isJsUnitException = true; | ||
+ this.comment = comment; | ||
+ this.jsUnitMessage = message; | ||
+ this.stackTrace = getStackTrace(); | ||
+} | ||
+ | ||
+function warn() { | ||
+ if (top.tracer != null) | ||
+ top.tracer.warn(arguments[0], arguments[1]); | ||
+} | ||
+ | ||
+function inform() { | ||
+ if (top.tracer != null) | ||
+ top.tracer.inform(arguments[0], arguments[1]); | ||
+} | ||
+ | ||
+function info() { | ||
+ inform(arguments[0], arguments[1]); | ||
+} | ||
+ | ||
+function debug() { | ||
+ if (top.tracer != null) | ||
+ top.tracer.debug(arguments[0], arguments[1]); | ||
+} | ||
+ | ||
+function setjsUnitTracer(ajsUnitTracer) { | ||
+ top.tracer=ajsUnitTracer; | ||
+} | ||
+ | ||
+function trim(str) { | ||
+ if (str == null) | ||
+ return null; | ||
+ | ||
+ var startingIndex = 0; | ||
+ var endingIndex = str.length-1; | ||
+ | ||
+ while (str.substring(startingIndex, startingIndex+1) == ' ') | ||
+ startingIndex++; | ||
+ | ||
+ while (str.substring(endingIndex, endingIndex+1) == ' ') | ||
+ endingIndex--; | ||
+ | ||
+ if (endingIndex < startingIndex) | ||
+ return ''; | ||
+ | ||
+ return str.substring(startingIndex, endingIndex+1); | ||
+} | ||
+ | ||
+function isBlank(str) { | ||
+ return trim(str) == ''; | ||
+} | ||
+ | ||
+function newOnLoadEvent() { | ||
+ isTestPageLoaded = true; | ||
+} | ||
+ | ||
+// the functions push(anArray, anObject) and pop(anArray) | ||
+// exist because the JavaScript Array.push(anObject) and Array.pop() | ||
+// functions are not available in IE 5.0 | ||
+ | ||
+function push(anArray, anObject) { | ||
+ anArray[anArray.length]=anObject; | ||
+} | ||
+function pop(anArray) { | ||
+ if (anArray.length>=1) { | ||
+ delete anArray[anArray.length - 1]; | ||
+ anArray.length--; | ||
+ } | ||
+} | ||
+window.onload=newOnLoadEvent; | ||
+ | ||
+if (top.xbDEBUG && top.xbDEBUG.on && top.testManager) | ||
+{ | ||
+ top.xbDebugTraceObject('top.testManager.containerTestFrame', 'JSUnitException'); | ||
+ // asserts | ||
+ top.xbDebugTraceFunction('top.testManager.containerTestFrame', '_displayStringForValue'); | ||
+ top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'error'); | ||
+ top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'argumentsIncludeComments'); | ||
+ top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'commentArg'); | ||
+ top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'nonCommentArg'); | ||
+ top.xbDebugTraceFunction('top.testManager.containerTestFrame', '_validateArguments'); | ||
+ top.xbDebugTraceFunction('top.testManager.containerTestFrame', '_assert'); | ||
+ top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'assert'); | ||
+ top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'assertTrue'); | ||
+ top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'assertEquals'); | ||
+ top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'assertNotEquals'); | ||
+ top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'assertNull'); | ||
+ top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'assertNotNull'); | ||
+ top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'assertUndefined'); | ||
+ top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'assertNotUndefined'); | ||
+ top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'assertNaN'); | ||
+ top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'assertNotNaN'); | ||
+ top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'isLoaded'); | ||
+ top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'setUp'); | ||
+ top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'tearDown'); | ||
+ top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'getFunctionName'); | ||
+ top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'getStackTrace'); | ||
+ top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'warn'); | ||
+ top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'inform'); | ||
+ top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'debug'); | ||
+ top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'setjsUnitTracer'); | ||
+ top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'trim'); | ||
+ top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'isBlank'); | ||
+ top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'newOnLoadEvent'); | ||
+ top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'push'); | ||
+ top.xbDebugTraceFunction('top.testManager.containerTestFrame', 'pop'); | ||
+} | ||
+ |

Oops, something went wrong.
0 comments on commit
648bc48