Return-Path: X-Original-To: apmail-thrift-commits-archive@www.apache.org Delivered-To: apmail-thrift-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A9B7678A0 for ; Wed, 3 Aug 2011 21:22:11 +0000 (UTC) Received: (qmail 5130 invoked by uid 500); 3 Aug 2011 21:22:11 -0000 Delivered-To: apmail-thrift-commits-archive@thrift.apache.org Received: (qmail 5068 invoked by uid 500); 3 Aug 2011 21:22:11 -0000 Mailing-List: contact commits-help@thrift.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@thrift.apache.org Delivered-To: mailing list commits@thrift.apache.org Received: (qmail 5061 invoked by uid 99); 3 Aug 2011 21:22:10 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Aug 2011 21:22:10 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Aug 2011 21:22:06 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id DCF272388A3C; Wed, 3 Aug 2011 21:21:44 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: svn commit: r1153673 - in /thrift/trunk/lib/js/test: build.xml jsTestDriver.conf json2.js test.html test.js Date: Wed, 03 Aug 2011 21:21:44 -0000 To: commits@thrift.apache.org From: roger@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110803212144.DCF272388A3C@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: roger Date: Wed Aug 3 21:21:43 2011 New Revision: 1153673 URL: http://svn.apache.org/viewvc?rev=1153673&view=rev Log: THRIFT-1249 js-test-driver support (run unittests on multiple browsers and get XML test results) additonal improvements - unit test log in XML - fetch local copy of jslibs to build/js/lib/ - remove unused json2.js - some lint on test.js Added: thrift/trunk/lib/js/test/jsTestDriver.conf (with props) Removed: thrift/trunk/lib/js/test/json2.js Modified: thrift/trunk/lib/js/test/build.xml thrift/trunk/lib/js/test/test.html thrift/trunk/lib/js/test/test.js Modified: thrift/trunk/lib/js/test/build.xml URL: http://svn.apache.org/viewvc/thrift/trunk/lib/js/test/build.xml?rev=1153673&r1=1153672&r2=1153673&view=diff ============================================================================== --- thrift/trunk/lib/js/test/build.xml (original) +++ thrift/trunk/lib/js/test/build.xml Wed Aug 3 21:21:43 2011 @@ -26,7 +26,7 @@ - + @@ -85,26 +85,46 @@ + + + + + + + + + + + + + + - - + + + - + - + + + + + check if Xvfb is available: @@ -119,7 +139,7 @@ - + @@ -139,6 +159,41 @@ + + Starting js-test-driver Server... + + + + + + + + + + + + + Running Unit Tests with js-test-driver + + + + + + + + + + + + + + + + + @@ -148,20 +203,23 @@ - + - + - + - + + + + @@ -177,6 +235,9 @@ + + + @@ -184,7 +245,6 @@ - @@ -193,6 +253,9 @@ + + + Added: thrift/trunk/lib/js/test/jsTestDriver.conf URL: http://svn.apache.org/viewvc/thrift/trunk/lib/js/test/jsTestDriver.conf?rev=1153673&view=auto ============================================================================== --- thrift/trunk/lib/js/test/jsTestDriver.conf (added) +++ thrift/trunk/lib/js/test/jsTestDriver.conf Wed Aug 3 21:21:43 2011 @@ -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"} Propchange: thrift/trunk/lib/js/test/jsTestDriver.conf ------------------------------------------------------------------------------ svn:executable = * Modified: thrift/trunk/lib/js/test/test.html URL: http://svn.apache.org/viewvc/thrift/trunk/lib/js/test/test.html?rev=1153673&r1=1153672&r2=1153673&view=diff ============================================================================== --- thrift/trunk/lib/js/test/test.html (original) +++ thrift/trunk/lib/js/test/test.html Wed Aug 3 21:21:43 2011 @@ -27,11 +27,11 @@ - + - - + + Modified: thrift/trunk/lib/js/test/test.js URL: http://svn.apache.org/viewvc/thrift/trunk/lib/js/test/test.js?rev=1153673&r1=1153672&r2=1153673&view=diff ============================================================================== --- thrift/trunk/lib/js/test/test.js (original) +++ thrift/trunk/lib/js/test/test.js Wed Aug 3 21:21:43 2011 @@ -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("Base Types"); 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 @@ module("Structured Types"); 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 @@ module("Structured Types"); 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 @@ module("Structured Types"); "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 @@ module("Structured Types"); }); 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 @@ module("deeper!"); } } - equals(JSON.stringify(mapMapTestOutput), JSON.stringify(mapMapTestExpectedResult)) + equals(JSON.stringify(mapMapTestOutput), JSON.stringify(mapMapTestExpectedResult)); }); @@ -239,7 +239,7 @@ module("Insanity"); 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 });