diff --git a/lib/js/test/build.xml b/lib/js/test/build.xml
index 87fb231..86ab276 100755
--- a/lib/js/test/build.xml
+++ b/lib/js/test/build.xml
@@ -26,7 +26,7 @@
   <property name="genjava" location="gen-java" />
   <property name="genjs" location="gen-js" />
   <property name="build" location="build" />
-  <property name="jar.file" location="${basedir}/jstest.jar" /> 
+  <property name="jar.file" location="${build}/jstest.jar" />
 
   <!-- the root directory, where you unpack thrift distibution (e.g. thrift-0.x.x.tar.gz) -->
   <property name="thrift.dir" location="../../../" />
@@ -85,26 +85,46 @@
   <target name="init" depends="dependencies">
     <tstamp />
     <mkdir dir="${build}"/>
+    <mkdir dir="${build}/js/lib"/>
     <mkdir dir="${build}/lib"/>
     <mkdir dir="${build}/log"/>
+    <mkdir dir="${build}/test"/>
+    <mkdir dir="${build}/test/log"/>
+  </target>
+
+  <target name="jslibs" depends="init, proxy">
+    <get src="http://code.jquery.com/jquery-1.5.2.js" dest="${build}/js/lib" usetimestamp="true"/>
+    <get src="http://js-test-driver.googlecode.com/svn/trunk/JsTestDriver/contrib/qunit/src/equiv.js" dest="${build}/js/lib" usetimestamp="true"/>
+    <get src="http://js-test-driver.googlecode.com/svn/trunk/JsTestDriver/contrib/qunit/src/QUnitAdapter.js" dest="${build}/js/lib" usetimestamp="true"/>
+
+    <get src="http://code.jquery.com/qunit/git/qunit.js" dest="${build}/js/lib" usetimestamp="true"/>
+    <get src="http://code.jquery.com/qunit/git/qunit.css" dest="${build}/js/lib" usetimestamp="true"/>
+    <!-- js-test-driver has issues with relative path...so we need a copy -->
+    <copy file="../thrift.js" todir="${build}/js/"/>
   </target>
 
   <target name="compile" description="compile the test suite" depends="init, generate, resolve">
-    <javac srcdir="${genjava}" destdir="${build}" classpathref="libs.classpath" />
-    <javac srcdir="${src}" destdir="${build}" classpathref="libs.classpath" />
+    <!-- //TODO enable <compilerarg value="-Xlint"/>-->
+    <javac includeantruntime="false" srcdir="${genjava}" destdir="${build}/test" classpathref="libs.classpath"/>
+    <javac includeantruntime="false" srcdir="${src}" destdir="${build}/test" classpathref="libs.classpath"/>
   </target>
 
   <target name="jstest" description="create the test suite jar file" depends="compile">
-    <jar jarfile="${jar.file}" basedir="${build}"/>
+    <jar jarfile="${jar.file}" basedir="${build}/test"/>
   </target>
 
-  <target name="testserver" description="run the test server" depends="jstest">
+  <target name="testserver" description="run the test server" depends="jstest, jslibs">
     <java classname="test.Httpd" fork="true"
       classpathref="test.classpath" failonerror="true">
       <arg value="../" />
     </java>
   </target>
 
+  <target name="proxy" if="proxy.enabled">
+    <setproxy proxyhost="${proxy.host}" proxyport="${proxy.port}"
+      proxyuser="${proxy.user}" proxypassword="${proxy.pass}"/>
+  </target>
+
   <target name="xvfb">
     <echo>check if Xvfb is available:</echo>
     <exec executable="Xvfb" failifexecutionfails="no" resultproperty="xvfb.present" failonerror="false" output="${build}/log/xvfb.log">
@@ -119,7 +139,7 @@
     </exec>
   </target>
 
-  <target name="unittest" description="do unit tests with headless browser phantomjs" depends="init, phantomjs, jstest" if="phantomjs.present">
+  <target name="unittest" description="do unit tests with headless browser phantomjs" depends="init, phantomjs, jstest, jslibs" if="phantomjs.present">
     <parallel>
       <exec executable="Xvfb" spawn="true" failonerror="false">
         <arg line=":99" />
@@ -139,6 +159,41 @@
     </parallel>
   </target>
 
+  <target name="jstestdriver-server" description="start the js-test-driver server" depends="init, resolve">
+    <echo>Starting js-test-driver Server...</echo>
+    <java jar="${build}/lib/jstestdriver-1.3.2.jar" dir="." fork="true"
+            failonerror="true" output="${build}/log/jstestdriver-server.log">
+      <arg line="--port 9876"/>
+    </java>
+  </target>
+
+  <target name="jstestdriver" description="do unit tests with js-test-driver" depends="init, jstest, jslibs">
+    <parallel>
+      <java classname="test.Httpd" fork="true" timeout="10000"
+        classpathref="test.classpath" failonerror="false" output="${build}/log/unittest.log">
+        <arg value="../" />
+      </java>
+      <sequential>
+        <sleep seconds="2"/>
+        <echo>Running Unit Tests with js-test-driver</echo>
+          <java jar="${build}/lib/jstestdriver-1.3.2.jar" dir="." fork="true" 
+            failonerror="true" output="${build}/log/jstestdriver.log">
+            <arg value="--config" />
+            <arg value="jsTestDriver.conf" />
+
+            <arg value="--reset" />
+            <arg value="--verbose" />
+
+            <arg value="--tests" />
+            <arg value="all" />
+
+            <arg value="--testOutput" />
+            <arg value="${build}/test/log/" />
+        </java>
+      </sequential>
+    </parallel>
+  </target>
+
   <target name="generate">
     <exec executable="${thrift.compiler}" failonerror="true">
       <arg line="--gen java ${thrift.dir}/test/ThriftTest.thrift" />
@@ -148,20 +203,23 @@
     </exec>
   </target>
 
-  <target name="test" description="run test suite" depends="init, generate, resolve, lint, jstest, unittest"/>
+  <target name="test" description="run test suite (lint, unittest)" depends="lint, unittest"/>
 
-  <target name="lint" description="code quality checks" depends="generate, gjslint, jslint"/>
+  <target name="lint" description="code quality checks (jslint and gjslint if available)" depends="generate, gjslint, jslint"/>
 
-  <target name="jslint">
+  <target name="jslint" depends="resolve">
     <taskdef uri="antlib:com.googlecode.jslint4java" resource="com/googlecode/jslint4java/antlib.xml" classpathref="libs.classpath" />
     <!--
          the following options would probably make sense in the future:
          browser,undef,eqeqeq,plusplus,bitwise,regexp,strict,newcap,immed
     -->
-    <jsl:jslint options="evil,forin,browser,bitwise,regexp,newcap,immed">
+    <jsl:jslint options="evil,forin,browser,bitwise,regexp,newcap,immed" encoding="UTF-8">
       <formatter type="plain" />
       <fileset dir="${genjs}" includes="**/*.js" />
       <fileset dir=".." includes="thrift.js" />
+
+      <!-- issues with unsafe character -->
+      <!-- fileset dir="." includes="*test*.js" /> -->
     </jsl:jslint>
   </target>
 
@@ -177,6 +235,9 @@
       <arg line="--nojsdoc"/>
       <arg line="${genjs}/*.js"/>
       <arg line="../thrift.js"/>
+
+      <!-- issues with unsafe character, etc. -->
+      <!-- <arg line="*test*.js"/> -->
     </exec>
   </target>
 
@@ -184,7 +245,6 @@
     <delete dir="${build}" />
     <delete dir="${genjava}" />
     <delete dir="${genjs}" />
-    <delete file="${jar.file}" />
   </target>
 
   <target name="resolve" unless="mvn.finished">
@@ -193,6 +253,9 @@
     <artifact:dependencies filesetId="js.test.dependency.jars">
       <dependency groupId="org.apache.httpcomponents" artifactId="httpclient" version="4.0.1"/>
       <dependency groupId="com.googlecode.jslint4java" artifactId="jslint4java-ant" version="1.4.6"/>
+      <!-- get jstestdriver.jar via maven-->
+      <remoteRepository id="jstd-maven-plugin google code repo" url="http://jstd-maven-plugin.googlecode.com/svn/maven2"/>
+      <dependency groupId="com.google.jstestdriver" artifactId="maven-jstestdriver-plugin" version="1.3.2.3"/>
     </artifact:dependencies>
 
     <!-- Copy the dependencies to the build/lib dir -->
diff --git a/lib/js/test/jsTestDriver.conf b/lib/js/test/jsTestDriver.conf
new file mode 100755
index 0000000..22e62ea
--- /dev/null
+++ b/lib/js/test/jsTestDriver.conf
@@ -0,0 +1,17 @@
+server: http://localhost:9876
+
+load:
+# Qunit adapter
+  - build/js/lib/equiv.js
+  - build/js/lib/QUnitAdapter.js
+# dependencies
+  - build/js/lib/jquery-1.5.2.js
+  - build/js/thrift.js
+  - gen-js/ThriftTest_types.js
+  - gen-js/ThriftTest.js
+# the test suite
+  - test.js
+
+# redirect to the Java based Thrift testserver
+proxy:
+ - {matcher: "*", server: " http://localhost:8088"}
diff --git a/lib/js/test/json2.js b/lib/js/test/json2.js
deleted file mode 100644
index a1a3b17..0000000
--- a/lib/js/test/json2.js
+++ /dev/null
@@ -1,482 +0,0 @@
-/*
-    http://www.JSON.org/json2.js
-    2010-03-20
-
-    Public Domain.
-
-    NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
-
-    See http://www.JSON.org/js.html
-
-
-    This code should be minified before deployment.
-    See http://javascript.crockford.com/jsmin.html
-
-    USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
-    NOT CONTROL.
-
-
-    This file creates a global JSON object containing two methods: stringify
-    and parse.
-
-        JSON.stringify(value, replacer, space)
-            value       any JavaScript value, usually an object or array.
-
-            replacer    an optional parameter that determines how object
-                        values are stringified for objects. It can be a
-                        function or an array of strings.
-
-            space       an optional parameter that specifies the indentation
-                        of nested structures. If it is omitted, the text will
-                        be packed without extra whitespace. If it is a number,
-                        it will specify the number of spaces to indent at each
-                        level. If it is a string (such as '\t' or '&nbsp;'),
-                        it contains the characters used to indent at each level.
-
-            This method produces a JSON text from a JavaScript value.
-
-            When an object value is found, if the object contains a toJSON
-            method, its toJSON method will be called and the result will be
-            stringified. A toJSON method does not serialize: it returns the
-            value represented by the name/value pair that should be serialized,
-            or undefined if nothing should be serialized. The toJSON method
-            will be passed the key associated with the value, and this will be
-            bound to the value
-
-            For example, this would serialize Dates as ISO strings.
-
-                Date.prototype.toJSON = function (key) {
-                    function f(n) {
-                        // Format integers to have at least two digits.
-                        return n < 10 ? '0' + n : n;
-                    }
-
-                    return this.getUTCFullYear()   + '-' +
-                         f(this.getUTCMonth() + 1) + '-' +
-                         f(this.getUTCDate())      + 'T' +
-                         f(this.getUTCHours())     + ':' +
-                         f(this.getUTCMinutes())   + ':' +
-                         f(this.getUTCSeconds())   + 'Z';
-                };
-
-            You can provide an optional replacer method. It will be passed the
-            key and value of each member, with this bound to the containing
-            object. The value that is returned from your method will be
-            serialized. If your method returns undefined, then the member will
-            be excluded from the serialization.
-
-            If the replacer parameter is an array of strings, then it will be
-            used to select the members to be serialized. It filters the results
-            such that only members with keys listed in the replacer array are
-            stringified.
-
-            Values that do not have JSON representations, such as undefined or
-            functions, will not be serialized. Such values in objects will be
-            dropped; in arrays they will be replaced with null. You can use
-            a replacer function to replace those with JSON values.
-            JSON.stringify(undefined) returns undefined.
-
-            The optional space parameter produces a stringification of the
-            value that is filled with line breaks and indentation to make it
-            easier to read.
-
-            If the space parameter is a non-empty string, then that string will
-            be used for indentation. If the space parameter is a number, then
-            the indentation will be that many spaces.
-
-            Example:
-
-            text = JSON.stringify(['e', {pluribus: 'unum'}]);
-            // text is '["e",{"pluribus":"unum"}]'
-
-
-            text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t');
-            // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'
-
-            text = JSON.stringify([new Date()], function (key, value) {
-                return this[key] instanceof Date ?
-                    'Date(' + this[key] + ')' : value;
-            });
-            // text is '["Date(---current time---)"]'
-
-
-        JSON.parse(text, reviver)
-            This method parses a JSON text to produce an object or array.
-            It can throw a SyntaxError exception.
-
-            The optional reviver parameter is a function that can filter and
-            transform the results. It receives each of the keys and values,
-            and its return value is used instead of the original value.
-            If it returns what it received, then the structure is not modified.
-            If it returns undefined then the member is deleted.
-
-            Example:
-
-            // Parse the text. Values that look like ISO date strings will
-            // be converted to Date objects.
-
-            myData = JSON.parse(text, function (key, value) {
-                var a;
-                if (typeof value === 'string') {
-                    a =
-/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
-                    if (a) {
-                        return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
-                            +a[5], +a[6]));
-                    }
-                }
-                return value;
-            });
-
-            myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) {
-                var d;
-                if (typeof value === 'string' &&
-                        value.slice(0, 5) === 'Date(' &&
-                        value.slice(-1) === ')') {
-                    d = new Date(value.slice(5, -1));
-                    if (d) {
-                        return d;
-                    }
-                }
-                return value;
-            });
-
-
-    This is a reference implementation. You are free to copy, modify, or
-    redistribute.
-*/
-
-/*jslint evil: true, strict: false */
-
-/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply,
-    call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,
-    getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,
-    lastIndex, length, parse, prototype, push, replace, slice, stringify,
-    test, toJSON, toString, valueOf
-*/
-
-
-// Create a JSON object only if one does not already exist. We create the
-// methods in a closure to avoid creating global variables.
-
-if (!this.JSON) {
-    this.JSON = {};
-}
-
-(function () {
-
-    function f(n) {
-        // Format integers to have at least two digits.
-        return n < 10 ? '0' + n : n;
-    }
-
-    if (typeof Date.prototype.toJSON !== 'function') {
-
-        Date.prototype.toJSON = function (key) {
-
-            return isFinite(this.valueOf()) ?
-                   this.getUTCFullYear()   + '-' +
-                 f(this.getUTCMonth() + 1) + '-' +
-                 f(this.getUTCDate())      + 'T' +
-                 f(this.getUTCHours())     + ':' +
-                 f(this.getUTCMinutes())   + ':' +
-                 f(this.getUTCSeconds())   + 'Z' : null;
-        };
-
-        String.prototype.toJSON =
-        Number.prototype.toJSON =
-        Boolean.prototype.toJSON = function (key) {
-            return this.valueOf();
-        };
-    }
-
-    var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
-        escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
-        gap,
-        indent,
-        meta = {    // table of character substitutions
-            '\b': '\\b',
-            '\t': '\\t',
-            '\n': '\\n',
-            '\f': '\\f',
-            '\r': '\\r',
-            '"' : '\\"',
-            '\\': '\\\\'
-        },
-        rep;
-
-
-    function quote(string) {
-
-// If the string contains no control characters, no quote characters, and no
-// backslash characters, then we can safely slap some quotes around it.
-// Otherwise we must also replace the offending characters with safe escape
-// sequences.
-
-        escapable.lastIndex = 0;
-        return escapable.test(string) ?
-            '"' + string.replace(escapable, function (a) {
-                var c = meta[a];
-                return typeof c === 'string' ? c :
-                    '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
-            }) + '"' :
-            '"' + string + '"';
-    }
-
-
-    function str(key, holder) {
-
-// Produce a string from holder[key].
-
-        var i,          // The loop counter.
-            k,          // The member key.
-            v,          // The member value.
-            length,
-            mind = gap,
-            partial,
-            value = holder[key];
-
-// If the value has a toJSON method, call it to obtain a replacement value.
-
-        if (value && typeof value === 'object' &&
-                typeof value.toJSON === 'function') {
-            value = value.toJSON(key);
-        }
-
-// If we were called with a replacer function, then call the replacer to
-// obtain a replacement value.
-
-        if (typeof rep === 'function') {
-            value = rep.call(holder, key, value);
-        }
-
-// What happens next depends on the value's type.
-
-        switch (typeof value) {
-        case 'string':
-            return quote(value);
-
-        case 'number':
-
-// JSON numbers must be finite. Encode non-finite numbers as null.
-
-            return isFinite(value) ? String(value) : 'null';
-
-        case 'boolean':
-        case 'null':
-
-// If the value is a boolean or null, convert it to a string. Note:
-// typeof null does not produce 'null'. The case is included here in
-// the remote chance that this gets fixed someday.
-
-            return String(value);
-
-// If the type is 'object', we might be dealing with an object or an array or
-// null.
-
-        case 'object':
-
-// Due to a specification blunder in ECMAScript, typeof null is 'object',
-// so watch out for that case.
-
-            if (!value) {
-                return 'null';
-            }
-
-// Make an array to hold the partial results of stringifying this object value.
-
-            gap += indent;
-            partial = [];
-
-// Is the value an array?
-
-            if (Object.prototype.toString.apply(value) === '[object Array]') {
-
-// The value is an array. Stringify every element. Use null as a placeholder
-// for non-JSON values.
-
-                length = value.length;
-                for (i = 0; i < length; i += 1) {
-                    partial[i] = str(i, value) || 'null';
-                }
-
-// Join all of the elements together, separated with commas, and wrap them in
-// brackets.
-
-                v = partial.length === 0 ? '[]' :
-                    gap ? '[\n' + gap +
-                            partial.join(',\n' + gap) + '\n' +
-                                mind + ']' :
-                          '[' + partial.join(',') + ']';
-                gap = mind;
-                return v;
-            }
-
-// If the replacer is an array, use it to select the members to be stringified.
-
-            if (rep && typeof rep === 'object') {
-                length = rep.length;
-                for (i = 0; i < length; i += 1) {
-                    k = rep[i];
-                    if (typeof k === 'string') {
-                        v = str(k, value);
-                        if (v) {
-                            partial.push(quote(k) + (gap ? ': ' : ':') + v);
-                        }
-                    }
-                }
-            } else {
-
-// Otherwise, iterate through all of the keys in the object.
-
-                for (k in value) {
-                    if (Object.hasOwnProperty.call(value, k)) {
-                        v = str(k, value);
-                        if (v) {
-                            partial.push(quote(k) + (gap ? ': ' : ':') + v);
-                        }
-                    }
-                }
-            }
-
-// Join all of the member texts together, separated with commas,
-// and wrap them in braces.
-
-            v = partial.length === 0 ? '{}' :
-                gap ? '{\n' + gap + partial.join(',\n' + gap) + '\n' +
-                        mind + '}' : '{' + partial.join(',') + '}';
-            gap = mind;
-            return v;
-        }
-    }
-
-// If the JSON object does not yet have a stringify method, give it one.
-
-    if (typeof JSON.stringify !== 'function') {
-        JSON.stringify = function (value, replacer, space) {
-
-// The stringify method takes a value and an optional replacer, and an optional
-// space parameter, and returns a JSON text. The replacer can be a function
-// that can replace values, or an array of strings that will select the keys.
-// A default replacer method can be provided. Use of the space parameter can
-// produce text that is more easily readable.
-
-            var i;
-            gap = '';
-            indent = '';
-
-// If the space parameter is a number, make an indent string containing that
-// many spaces.
-
-            if (typeof space === 'number') {
-                for (i = 0; i < space; i += 1) {
-                    indent += ' ';
-                }
-
-// If the space parameter is a string, it will be used as the indent string.
-
-            } else if (typeof space === 'string') {
-                indent = space;
-            }
-
-// If there is a replacer, it must be a function or an array.
-// Otherwise, throw an error.
-
-            rep = replacer;
-            if (replacer && typeof replacer !== 'function' &&
-                    (typeof replacer !== 'object' ||
-                     typeof replacer.length !== 'number')) {
-                throw new Error('JSON.stringify');
-            }
-
-// Make a fake root object containing our value under the key of ''.
-// Return the result of stringifying the value.
-
-            return str('', {'': value});
-        };
-    }
-
-
-// If the JSON object does not yet have a parse method, give it one.
-
-    if (typeof JSON.parse !== 'function') {
-        JSON.parse = function (text, reviver) {
-
-// The parse method takes a text and an optional reviver function, and returns
-// a JavaScript value if the text is a valid JSON text.
-
-            var j;
-
-            function walk(holder, key) {
-
-// The walk method is used to recursively walk the resulting structure so
-// that modifications can be made.
-
-                var k, v, value = holder[key];
-                if (value && typeof value === 'object') {
-                    for (k in value) {
-                        if (Object.hasOwnProperty.call(value, k)) {
-                            v = walk(value, k);
-                            if (v !== undefined) {
-                                value[k] = v;
-                            } else {
-                                delete value[k];
-                            }
-                        }
-                    }
-                }
-                return reviver.call(holder, key, value);
-            }
-
-
-// Parsing happens in four stages. In the first stage, we replace certain
-// Unicode characters with escape sequences. JavaScript handles many characters
-// incorrectly, either silently deleting them, or treating them as line endings.
-
-            text = String(text);
-            cx.lastIndex = 0;
-            if (cx.test(text)) {
-                text = text.replace(cx, function (a) {
-                    return '\\u' +
-                        ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
-                });
-            }
-
-// In the second stage, we run the text against regular expressions that look
-// for non-JSON patterns. We are especially concerned with '()' and 'new'
-// because they can cause invocation, and '=' because it can cause mutation.
-// But just to be safe, we want to reject all unexpected forms.
-
-// We split the second stage into 4 regexp operations in order to work around
-// crippling inefficiencies in IE's and Safari's regexp engines. First we
-// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we
-// replace all simple value tokens with ']' characters. Third, we delete all
-// open brackets that follow a colon or comma or that begin the text. Finally,
-// we look to see that the remaining characters are only whitespace or ']' or
-// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
-
-            if (/^[\],:{}\s]*$/.
-test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@').
-replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']').
-replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
-
-// In the third stage we use the eval function to compile the text into a
-// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
-// in JavaScript: it can begin a block or an object literal. We wrap the text
-// in parens to eliminate the ambiguity.
-
-                j = eval('(' + text + ')');
-
-// In the optional fourth stage, we recursively walk the new structure, passing
-// each name/value pair to a reviver function for possible transformation.
-
-                return typeof reviver === 'function' ?
-                    walk({'': j}, '') : j;
-            }
-
-// If the text is not JSON parseable, then a SyntaxError is thrown.
-
-            throw new SyntaxError('JSON.parse');
-        };
-    }
-}());
diff --git a/lib/js/test/test.html b/lib/js/test/test.html
index 9b225f0..c3fd0b1 100755
--- a/lib/js/test/test.html
+++ b/lib/js/test/test.html
@@ -27,11 +27,11 @@
   <script src="gen-js/ThriftTest.js"       type="text/javascript" charset="utf-8"></script>
 
   <!-- jQuery -->
-  <script type="text/javascript" src="http://code.jquery.com/jquery-1.5.2.js" charset="utf-8"></script>
+  <script type="text/javascript" src="build/js/lib/jquery-1.5.2.js" charset="utf-8"></script>
   
   <!-- QUnit Test framework-->
-  <script type="text/javascript" src="http://code.jquery.com/qunit/git/qunit.js" charset="utf-8"></script>
-  <link rel="stylesheet" href="http://code.jquery.com/qunit/git/qunit.css" type="text/css" media="screen" />
+  <script type="text/javascript" src="build/js/lib/qunit.js" charset="utf-8"></script>
+  <link rel="stylesheet" href="build/js/lib/qunit.css" type="text/css" media="screen" />
   
   <!-- the Test Suite-->
   <script type="text/javascript" src="test.js" charset="utf-8"></script>
diff --git a/lib/js/test/test.js b/lib/js/test/test.js
index e24cb92..caf34a2 100755
--- a/lib/js/test/test.js
+++ b/lib/js/test/test.js
@@ -1,4 +1,4 @@
-﻿/*
+/*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements. See the NOTICE file
  * distributed with this work for additional information
@@ -62,11 +62,11 @@
 module("Structured Types");
 
   test("Struct", function() {
-    var structTestInput = new ThriftTest.Xtruct()
-    structTestInput.string_thing = 'worked'
-    structTestInput.byte_thing = 0x01
-    structTestInput.i32_thing = Math.pow(2,30)
-    structTestInput.i64_thing = Math.pow(2,60)
+    var structTestInput = new ThriftTest.Xtruct();
+    structTestInput.string_thing = 'worked';
+    structTestInput.byte_thing = 0x01;
+    structTestInput.i32_thing = Math.pow(2,30);
+    structTestInput.i64_thing = Math.pow(2,60);
 
     var structTestOutput = client.testStruct(structTestInput);
 
@@ -75,20 +75,20 @@
     equals(structTestOutput.i32_thing, structTestInput.i32_thing);
     equals(structTestOutput.i64_thing, structTestInput.i64_thing);
     
-    equals(JSON.stringify(structTestOutput), JSON.stringify(structTestInput))
+    equals(JSON.stringify(structTestOutput), JSON.stringify(structTestInput));
   });
 
   test("Nest", function() {
-    var xtrTestInput = new ThriftTest.Xtruct()
-    xtrTestInput.string_thing = 'worked'
-    xtrTestInput.byte_thing = 0x01
-    xtrTestInput.i32_thing = Math.pow(2,30)
-    xtrTestInput.i64_thing = Math.pow(2,60)
+    var xtrTestInput = new ThriftTest.Xtruct();
+    xtrTestInput.string_thing = 'worked';
+    xtrTestInput.byte_thing = 0x01;
+    xtrTestInput.i32_thing = Math.pow(2,30);
+    xtrTestInput.i64_thing = Math.pow(2,60);
     
-    var nestTestInput = new ThriftTest.Xtruct2()
-    nestTestInput.byte_thing = 0x02
-    nestTestInput.struct_thing = xtrTestInput
-    nestTestInput.i32_thing = Math.pow(2,15)
+    var nestTestInput = new ThriftTest.Xtruct2();
+    nestTestInput.byte_thing = 0x02;
+    nestTestInput.struct_thing = xtrTestInput;
+    nestTestInput.i32_thing = Math.pow(2,15);
     
     var nestTestOutput = client.testNest(nestTestInput);
     
@@ -99,13 +99,13 @@
     equals(nestTestOutput.struct_thing.i64_thing, nestTestInput.struct_thing.i64_thing);
     equals(nestTestOutput.i32_thing, nestTestInput.i32_thing);
     
-    equals(JSON.stringify(nestTestOutput), JSON.stringify(nestTestInput))
+    equals(JSON.stringify(nestTestOutput), JSON.stringify(nestTestInput));
   });
 
   test("Map", function() {
     var mapTestInput = {7:77, 8:88, 9:99};
 
-    var mapTestOutput = client.testMap(mapTestInput)
+    var mapTestOutput = client.testMap(mapTestInput);
 
     for (var key in mapTestOutput) {
       equals(mapTestOutput[key], mapTestInput[key]);
@@ -118,7 +118,7 @@
       "longValue":stringTest, stringTest:"long key"
     };
 
-    var mapTestOutput = client.testStringMap(mapTestInput)
+    var mapTestOutput = client.testStringMap(mapTestInput);
 
     for (var key in mapTestOutput) {
       equals(mapTestOutput[key], mapTestInput[key]);
@@ -126,12 +126,12 @@
   });
 
   test("Set", function() {
-    var setTestInput = new Array(1,2,3)
+    var setTestInput = [1,2,3];
     ok(client.testSet(setTestInput), setTestInput);
   });
 
   test("List", function() {
-    var listTestInput = new Array(1,2,3)
+    var listTestInput = [1,2,3];
     ok(client.testList(listTestInput), listTestInput);
   });
 
@@ -161,7 +161,7 @@
       }
     }
     
-    equals(JSON.stringify(mapMapTestOutput), JSON.stringify(mapMapTestExpectedResult))
+    equals(JSON.stringify(mapMapTestOutput), JSON.stringify(mapMapTestExpectedResult));
   });
 
 
@@ -239,7 +239,7 @@
     var res = client.testInsanity("");
     ok(res, JSON.stringify(res));
     ok(insanity, JSON.stringify(insanity));
-    equals(JSON.stringify(res), JSON.stringify(insanity)) //TODO: read and compare maps recursively
+    equals(JSON.stringify(res), JSON.stringify(insanity)); //TODO: read and compare maps recursively
   });
 
 
