thrift/lib/js/test
Alex Volanis 7004a61e44 THRIFT-(1418|1507|3983|4120|4178|4259|4294): Multiple issues
Client: java

THRIFT-4294: Java Configure Fails for Ant >= 1.10
THRIFT-4259: Thrift does not compile due to Ant Maven task errors
THRIFT-4178: Java libraries missing from package when using cmake
THRIFT-3983: libthrift is deployed on central with pom packaging
             instead of jar
THRIFT-1507: Maven can't download resource from central when behind
             a proxy and won't use local repository
THRIFT-1418: Compiling Thrift from source: Class
             org.apache.tools.ant.taskdefs.ConditionTask doesn't
             support the nested "typefound" element

Refactor CMake install hook to allow using "sudo make install/fast"
which avoids the THRIFT-1507 and THRIFT-1418 issues.

New Gradle based build system for Thrift Java Library

* Add Gradle 4.4.1 Wrapper artifacts to enable builds
Using the Gradle Wrapper helps normalize the builds on all platforms
so we use a consistent build tool independent of package managers.

The Gradle build logic was partitioned into multiple specific
scripts to simplify understanding and maintenance of the build.

This is now hooked into CMake and Autoconf processing steps
and can build/test/publish to Maven. The README.md was updated
to illustrate the new build options and add some documentation
on the requirements for Maven publication.

Cleaned up the CMake files to reduce reliance on file globbing
which is known to cause confusion when multiple users contribute.

* Fix two minor issues in Javadoc and unit test

Return values were undeclared in Javadoc
Test was asserting on the wrong test object instance

* Create simple runner scripts for cross-check

Using Gradle as a java execution wrapper is too heavy.
I simplified the test client/server execution by using a
three generated scripts in the build directory direcly
callable by the cross-check test harness.

* Cleanup the remaining Ant build scripts

Pulled the Maven Ant task properties out of the Java build
since they are no longer used there.
Deleted the no longer used build.xml and build.properties
files from the Java build.
Made each Ant build own the Maven Ant task details in their
build.properties file.

* Fix the build issue with Java SSL in the ubuntu-trusty container

The latest Trusty JDK7 builds seem to have encountered this issue
because the OpenJDK removed the SunEC algorithms.

* Update the developer info as requested in review

Use the generic Apache Thrift developer list for contact information

* Add Clover Code coverage for easy access by developers

Clover plugin for Gradle was applied and configured which enables
code coverage reports to be available on demand via a command line
option. The documentation in the README.md was enhanced to give
the details of this change and how to take advantage of it.
2018-01-24 12:28:55 -05:00
..
src/test THRIFT-3140 ConcurrentModificationException is thrown by JavaScript test server 2015-05-10 18:25:56 +02:00
build.properties THRIFT-(1418|1507|3983|4120|4178|4259|4294): Multiple issues 2018-01-24 12:28:55 -05:00
build.xml THRIFT-(1418|1507|3983|4120|4178|4259|4294): Multiple issues 2018-01-24 12:28:55 -05:00
deep-constructor.test.js THRIFT-3627 fix missing basic code style consistency of JavaScript. 2017-04-06 19:12:28 -04:00
jsTestDriver.conf THRIFT-3142 Make JavaScript use downloaded libraries 2015-05-10 18:25:56 +02:00
Makefile.am THRIFT-2768: Whitespace Fixup 2014-10-03 20:42:54 +02:00
phantom-client.js THRIFT-3627 fix missing basic code style consistency of JavaScript. 2017-04-06 19:12:28 -04:00
phantomjs-qunit.js THRIFT-3627 fix missing basic code style consistency of JavaScript. 2017-04-06 19:12:28 -04:00
README.md THRIFT-2407 use markdown (rename README => README.md) 2014-03-19 06:47:47 +01:00
server_http.js THRIFT-3627 fix missing basic code style consistency of JavaScript. 2017-04-06 19:12:28 -04:00
server_https.js THRIFT-3627 fix missing basic code style consistency of JavaScript. 2017-04-06 19:12:28 -04:00
test_handler.js THRIFT-3627 fix missing basic code style consistency of JavaScript. 2017-04-06 19:12:28 -04:00
test-async.js THRIFT-4406: Optionally generate ES6 compatible JavaScript where service methods return Promises 2018-01-04 09:15:24 -05:00
test-deep-constructor.html THRIFT-3122 Javascript struct constructor should properly initialize struct and container members from plain js arguments 2015-06-25 22:31:41 +10:00
test-es6.html THRIFT-4406: Optionally generate ES6 compatible JavaScript where service methods return Promises 2018-01-04 09:15:24 -05:00
test-es6.js THRIFT-4406: Optionally generate ES6 compatible JavaScript where service methods return Promises 2018-01-04 09:15:24 -05:00
test-jq.js THRIFT-3627 fix missing basic code style consistency of JavaScript. 2017-04-06 19:12:28 -04:00
test-nojq.html THRIFT-3142 Make JavaScript use downloaded libraries 2015-05-10 18:25:56 +02:00
test-nojq.js THRIFT-3627 fix missing basic code style consistency of JavaScript. 2017-04-06 19:12:28 -04:00
test.html fix whitespaces detected by .editorconfig 2015-06-14 22:30:22 +02:00
test.js THRIFT-3627 fix missing basic code style consistency of JavaScript. 2017-04-06 19:12:28 -04:00
testws.html THRIFT-3142 Make JavaScript use downloaded libraries 2015-05-10 18:25:56 +02:00

Thrift Javascript Library

This browser based Apache Thrift implementation supports RPC clients using the JSON protocol over Http[s] with XHR and WebSocket.

License

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 regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Test Servers

drwxr-xr-x 2 randy randy 4096 Feb 8 15:44 sec -rw-r--r-- 1 randy randy 2183 Feb 9 04:01 server_http.js -rw-r--r-- 1 randy randy 2386 Feb 9 05:39 server_https.js

server_http.js is a Node.js web server which support the standard Apache Thrift test suite (thrift/test/ThriftTest.thrift). The server supports Apache Thrift XHR and WebSocket clients.

server_https.js is the same but uses SSL/TLS. The server key and cert are pulled from the thrift/test/keys folder.

Both of these servers support WebSocket (the http: supports ws:, and the https: support wss:).

To run the client test with the Java test server use: $ make check (requires the Apache Thrift Java branch and make check must have been run in thrift/lib/java previously).

To run the client tests with the Node servers run the grunt build in the parent js directory (see README there).

Test Clients

-rw-r--r-- 1 randy randy 13558 Feb 9 07:18 test-async.js -rw-r--r-- 1 randy randy 5724 Feb 9 03:45 test_handler.js -rwxr-xr-x 1 randy randy 2719 Feb 9 06:04 test.html -rw-r--r-- 1 randy randy 4611 Feb 9 06:05 test-jq.js -rwxr-xr-x 1 randy randy 12153 Feb 9 06:04 test.js -rw-r--r-- 1 randy randy 2593 Feb 9 06:16 test-nojq.html -rw-r--r-- 1 randy randy 1450 Feb 9 06:14 test-nojq.js -rw-r--r-- 1 randy randy 2847 Feb 9 06:31 testws.html

There are three html test driver files, all of which are QUnit based. test.html tests the Apache Thrift jQuery generated code (thrift -gen js:jquery). The test-nojq.html runs almost identical tests against normal JavaScript builds (thrift -gen js). Both of the previous tests use the XHR transport. The testws.html runs similar tests using the WebSocket transport. The test*.js files are loaded by the html drivers and contain the actual Apache Thrift tests.